ubilabs / geocomplete

jQuery Geocoding and Places Autocomplete Plugin
http://ubilabs.github.com/geocomplete/
MIT License
1.22k stars 406 forks source link

Pass coordinates to find return ZERO_RESULTS #254

Open vlazarov90 opened 8 years ago

vlazarov90 commented 8 years ago

Until last week when pass coordinates to method "find" everything works fine, but now with this example below does not return results, when drag the marker always returns ZERO_RESULTS. Someone to have any suggestions why ?

.bind("geocode:dragged", function(event, latLng){ geocomplete.geocomplete("find", (new google.maps.LatLng(latLng.lat(), latLng.lng())).toString()); })

server-izetov commented 8 years ago

I'm not completely understand why you use this construction: (new google.maps.LatLng(latLng.lat(), latLng.lng())).toString()). if you already have latLng object, try to use it without create a new one.

And one more note, for some reason latLng.toString() return string with brackets, for example: (-33.87940222788091, 151.2546811516952)

Try to use something like this: .bind("geocode:dragged", function(event, latLng){ geocomplete.geocomplete("find", latLng.lat()+", "+latLng.lng()); }) may be it will be helpful for you.