Created
June 29, 2010 10:35
-
-
Save adhipg/457057 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<script src="http://maps.google.com/maps?file=api&v=2.x&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