Created
December 12, 2011 14:50
-
-
Save halan/1467619 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function showAddress(address) { | |
if (geocoder) { | |
geocoder.getLatLng( | |
address, | |
function(point) { | |
if (!point) { | |
alert(address + " not found"); | |
} else { | |
map.setCenter(point, 13); | |
var marker = new GMarker(point); | |
map.addOverlay(marker); | |
// As this is user-generated content, we display it as | |
// text rather than HTML to reduce XSS vulnerabilities. | |
marker.openInfoWindow(document.createTextNode(address)); | |
} | |
} | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment