JAVASCRIPT
Im sure this a very simple problem.
I am modifying the line below and want to replace (53, 0) with a variable. However, the variable that is created called 'result', is equal to '(34, 2)', ie it already has the brackets around it.
center: new google.maps.LatLng.(53, 0)
i have tried
center: new google.maps.LatLng.(result)
center: new google.maps.LatLng.result
center: new google.maps.LatLng.({result})
and it no working!
FULL CODE
var geocoder = new google.maps.Geocoder();
if (geocoder) {
geocoder.geocode({ 'address': address }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
window.result = results[0].geometry.location;
alert(result);
}
else {
alert('nothing');
}
});
}
function load() {
map = new google.maps.Map(document.getElementById("map"), {
center: new google.maps.LatLng.(53, 0),
zoom: 10,
mapTypeId: 'roadmap',
mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU}
});
}
For reference, alert(result) returns
(53.8622017, -2.405405999999971)