I am updating my codes from Google Map API V2 to V3. In V2, I used GlocalSearch to get the latitude and longitude for a given address.
In V3, I saw google.maps.Geocoder () and tried to get similar details. However, the lat & long specified by the V3 function is not accurate.
Please see the following screenshot here:

My codes for V3 are as follows:
var geocoder = new google.maps.Geocoder();
function codeAddress(address) {
if (geocoder)
{
address = address + ", UK";
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var latlng = results[0].geometry.location;
addMarker(latlng);
} else {
alert("Geocode was not successful for the following reason: " + status);
}
});
}
}
Is there a better way to get accurate results in V3 API? Thank you
source
share