Comments (5)
I am having a similar problem. Triggering the geocoder via javascript as in examples such as:
$("#examples a").click(function(){
$("input[name=geo_autocomplete]").val($(this).text()).trigger("geocode");
return false;
});
returns a limited result set compared to selecting the same location manually. For example, the "name" attribute is occasionally populated, when when triggered via js.
from geocomplete.
I did some experiments on this. When a location is selected from the autocomplete list, request sent to the geocoding service is a PlaceService.GetPlaceDetails
request with the location's ID
. This returns the full result set. When geocoding is triggered via javascript giving a place name, even if the name is an exact match to the full name, the generated request is a GeocodeService.Search
request, which returns a subset of the GetPlaceDetails
request.
Apparently, the autocomplete drop-down has the ID
of the location and builds the request based on that. But, as far as I can see, that ID
is not provided in the results of a GeocodeService.Search
request. So, making a search query, getting the id, and making another getDetails query won't seem to work neither.
Any suggestions?
from geocomplete.
@omat - thanks for figuring this out. I've been trying desperately to parse the extra place details that are retained only with the GetPlaceDetails
request (specifically formatted_phone_number
). Are you saying that these details are not retrieved only when trigger the geocoder via javascript? I can't seem to figure out how or where they are retrieved either way.
from geocomplete.
to get all the details, GetPlaceDetails
should be called with the place id. there may be a way to query the geocoding service with name and retrieve the ID and then make the GetPlaceDetails request, i am not sure. otherwise, with the place name, you would do a GeocodeService.Search
request and get a limited result about a place. at the time i was working on that, the id was not provided. it is probably still the same. good luck, and i'd appreciate if you share any updates on that.
from geocomplete.
The following solution may help. you can refer to this link for further details.
var _this = this.input;
google.maps.event.addDomListener(_this,'keydown',function(e){
console.log(e.triggered)
if(e.keyCode===13 && !e.triggered){
google.maps.event.trigger(_this,'keydown',{keyCode:40})
google.maps.event.trigger(_this,'keydown',{keyCode:13,triggered:true})
}
});
from geocomplete.
Related Issues (20)
- Package Doesn't autocomplete all places that google.com/maps does! HOT 1
- Add place_changed function with the geocomplete plugin
- Script block missing HOT 1
- Does not working HOT 1
- Not responding if open a html with this plugin on iPhone UIWebView
- More than a single default location
- Blocking request until query length minimum is reached
- Adding custom search results to Autocomplete results
- Uncaught TypeError: this.$input.on is not a function
- Country Restriction HOT 1
- Map not display! HOT 1
- City not loaded HOT 2
- Select First result from listing after press tab
- Add postal_town HOT 1
- Get short version of State
- Problem of operation in some locations. HOT 1
- initialize map in lat lng HOT 2
- why newer places does not pop on recommendations
- Don't get all location
- the map not showing in div. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geocomplete.