From GamingWiki
Jump to: navigation, search
Line 49: Line 49:
 
function addMarkerByAddress(address, title, description) {
 
function addMarkerByAddress(address, title, description) {
 
if (geocoder) {
 
if (geocoder) {
geocoder.geocode({request:address, callback:function(latlng) {
+
geocoder.geocode(address, function(result, status) {
if (!latlng) {
+
if (status != google.maps.Geocoder.OK) {
alert(address + " not found");
+
alert(address + " not found: "+result+"; "+status);
 
} else {
 
} else {
 
var marker = new google.maps.Marker({position:latlng, map:map, title:name});
 
var marker = new google.maps.Marker({position:latlng, map:map, title:name});
 
google.maps.event.addListener(marker, "click", function() { infowindow.open(map,marker); });
 
google.maps.event.addListener(marker, "click", function() { infowindow.open(map,marker); });
 
}
 
}
}});
+
});
 
}
 
}
 
}
 
}

Revision as of 01:18, 25 October 2010