Skip to content

Instantly share code, notes, and snippets.

@halan
Created December 12, 2011 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save halan/1467619 to your computer and use it in GitHub Desktop.
Save halan/1467619 to your computer and use it in GitHub Desktop.
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