The goal of this tutorial is to explain how to get Google Maps working within your website. So, first I should explain that there are several ways to display a Google map on your site. The first way is to create a link to a map and every time someone clicks on it, it takes them to the Google site. Second way is to create a "static" map. So, the map is physically on your site, but there is no interaction. You can pan, zoom, or get directions. Third way is to create a "dynamic" map. This will require you to get a Google maps API key. But, the best part is that it's free. Go to http://code.google.com/apis/maps. Once you have the key, all you need to do is code the map. There are lots of examples on the Google site. Here's what I did. And here's my attempt to explain the code.
<script src=" http ://maps.google.com/?file=api&v=2.x&key=<<replace this with your Google maps API key>>" type="text/javascript">
</script><script type="text/javascript">
var map;
var gdir;
var geocoder = null;
var addressMarker;
function initialize() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map_canvas"));
gdir = new GDirections(map, document.getElementById("directions"));
GEvent.addListener(gdir, "load", onGDirectionsLoad);
setDirections("Elizabeth, NJ", "700 Bayway Avenue, Elizabeth, NJ 07202");
}
} function setDirections(fromAddress, toAddress) {
gdir.load("from: " + fromAddress + " to: " + toAddress, { "locale": "en" });
} function onGDirectionsLoad(){
// Use this function to access information about the latest load()
// results.
// e.g.
// document.getElementById("getStatus").innerHTML = gdir.getStatus().code;
// and yada yada yada...
}
</script> </head>
<body onload="initialize()" onunload="GUnload()"> <form action="#" onsubmit="setDirections(this.from.value, this.to.value); return false">
<div align="center">
From: <input type="text" size="35" id="fromAddress" name="from" value="Elizabeth, NJ"/> To: <input type="text" size="35" id="toAddress" name="to" value="700 Bayway Avenue, Elizabeth, NJ 07202"/> <input name="submit" type="submit" value="Get Directions!" />
</div>
</form> <div id="map_canvas" style="width: 660px; height: 500px"></div>
<div id="directions" style="width: 660px"></div>
</body>I hope this post was helpful. If you want to see the actual map that all this code created, visit http://www.basileaministries.o....
Wat abt the GMAP module guys
Wat abt the GMAP module guys ? would dat not suffice .. or does dis do something different? Also, I wanted to know if it was possible to have "Get Directions " functionality of the Google maps embedded within the website.
I still haven't really
I still haven't really understood the point of Google Maps.

