First you need to register with google and get the MAPS api key:
http://code.google.com/apis/maps/signup.html
Then you need to embed some javascript in your pages / templates:
<script src="http://maps.google.com/maps?file=api&v=2&key=__your_key_here__" type="text/javascript"></script>
Another bit for drawing the actual map:
<script type="text/javascript"> //<![CDATA[ function createMarker(point,html) { var marker = new GMarker(point); GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); return marker; } function load() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map")); map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); map.setCenter(new GLatLng(51.16349933440274, 4.371164292063712 ), 6); var point = new GLatLng(51.16349933440274, 4.371164292063712); var marker = createMarker(point,'<div style="width:240px"> \ Place: <b>ANTWERPEN </b><br> \ </div>') map.addOverlay(marker); } } //]]> </script>
This guide was helpful:
http://econym.org.uk/gmap
The map API documentation is very good:
http://code.google.com/apis/maps/documentation/javascript/
Please note that version 3 of the api maps has recently been released (it has many improvements for mobile browsers, so you may need to learn).
It could be a candidate to move to stackoverflow.com
source share