I\'m using Google\'s Geocoder to find lat lng coordinates for a given address.
var geocoder = new google.maps.Geocoder();
geocoder.geocode(
{
The following code will get the first matching address in the UK without the need to modify the address.
var geocoder = new google.maps.Geocoder();
geocoder.geocode(
{
'address': address,
'region': 'uk'
}, function(results, status) {
if(status == google.maps.GeocoderStatus.OK) {
for (var i=0; i= 0) {
if (results[i].address_components[j].short_name == "GB") {
return_address = results[i].formatted_address;
return_lat = results[i].geometry.location.lat();
return_lng = results[i].geometry.location.lng();
...
return;
}
}
}
}
});