From GamingWiki
Line 49: | Line 49: | ||
function addMarkerByAddress(address, title, description) { | function addMarkerByAddress(address, title, description) { | ||
if (geocoder) { | if (geocoder) { | ||
− | geocoder.geocode( | + | geocoder.geocode(address, function(result, status) { |
− | if (! | + | 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