1/ Use Google maps to find the longitude and latitude of the address you want to map – when the map pin is in the middle of the screen, paste this code into your browser…

javascript: void(prompt('',gApplication.getMap().getCenter()));

2/ generate a google maps API key. If you’ve got more than one map in your site, don’t just genereate a key for your domain name, use the full location of the directory e.g. pmlmedia.co.uk/testwebsites/newsite1/

3/ Edit this code with your newly generated API key, longitude and lattitude, and address (for when someone clicks on your map pin) then paste the edited code into the head of your webpage.

<script src="http://maps.google.com/maps?file=api&v=2&key=REPLACETHISTEXTWITHYOURAPIKEY&sensor=true" type="text/javascript"></script> <script type="text/javascript">// <![CDATA[
/* <![CDATA[ */

    function initialize() {
        if (GBrowserIsCompatible()) {

            var a = REPLACETHISTEXTWITHYOURLONGITUDE;
            var b = REPLACETHISTEXTWITHYOURLATITIDE;
            var zoom = 16;
            var html = '

<div class="htmlwindow">
REPLACEWITHNAMEOFBUSINESS
REPLACEWITH1STLINEOFADDRESS
REPLACEWITH2NDLINEOFADDRESS<'+'/div>';

            var map = new GMap2(document.getElementById("map_canvas"));
            map.setCenter(new GLatLng((a+0.001), b), zoom);
			map.addControl(new GSmallMapControl());
			//map.addControl(new GMapTypeControl());
 			map.enableScrollWheelZoom();

            var marker = new GMarker(new GLatLng(a, b));
            GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); });
            map.addOverlay(marker);
            //GEvent.trigger(marker, "click");
        }
    }
    /*  */
// ]]></script>

4/ Paste these event functions into your opening body tag…

<body onload="initialize()" onunload="GUnload()">

…and create a DIV wherever you want your map to appear and set the width and height for your map.

 <div id="map_canvas" style="width: 529px; height: 300px"></div>