- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i currently have the following code in my JavaScript file. When i run the app, the 'reverse geocode' button appears, which i click on. Once i click on the button the following error appears: "Geocoder failed due to: ZERO_RESULTS. Am i missing something?
This has been testing on my mobile device and the error is also appearing. Any help would be appreciated. Thank you.
function click_button_reverseGeo(currentLatitude, currentLongitude){
var latlng = new google.maps.LatLng(currentLatitude, currentLongitude);
var geocoder = new google.maps.Geocoder();
geocoder.geocode({'latLng': latlng}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
if (results[1]) {
alert(results[1].formatted_address);
} else {
alert('No results found');
}
} else {
alert('Geocoder failed due to: ' + status);
}
});
}
- Tags:
- HTML5
- Intel® XDK
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello.
Make a call to maps.googleapis.com/geocode/xml from your server after getting the latlng.
Geocoding service will give you appropriate results when you send a request from your back end.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page