Skip to content

Instantly share code, notes, and snippets.

@adhipg
Created June 29, 2010 10:35
Show Gist options
  • Save adhipg/457057 to your computer and use it in GitHub Desktop.
Save adhipg/457057 to your computer and use it in GitHub Desktop.
<script src="http://maps.google.com/maps?file=api&amp;v=2.x&amp;key=ABQIAAAAEX95M5gKl7Nn_i4Mzl1TAhT4b5KCiYFj3ZfOJov1Qpq4YsRyghTrgMf7VDdXUg9oULkwfWhrlOumiQ" type="text/javascript"></script>
<script type="text/javascript">
var map = null;
var geocoder = null;
function initialize() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(29.427394,-98.624654), 15);
geocoder = new GClientGeocoder();
}
}
function showAddress(address) {
if (geocoder) {
geocoder.getLatLng(
address,
function(point) {
if (!point) {
alert(address + " not found");
} else {
map.setCenter(point, 15);
var marker = new GMarker(point);
map.addOverlay(marker);
}
});
}
}
initialize();
showAddress ( '8008 Military Dr. West, San Antonio, TX 78227' );
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment