Google Maps on your website
Do you know how to put a google map on your website ? If no take a minute to lean.
First off all get your api from http://code.google.com/apis/maps/signup.html
Now put the code on your website and replace with your address
<script src="http://maps.google.com/maps?file=api&v=2&key=YOUR_API_KEY_HERE" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ function loadmap() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map")); var geocoder = new GClientGeocoder(); map.setCenter(new GLatLng(coordonates, coordonates), 13); map.addControl(new GSmallMapControl()); var address = "your adress"; geocoder.getLatLng( address, function(point) { if (!point) { alert(address + " not found"); } else { map.setCenter(point, 13); var marker = new GMarker(point); map.addOverlay(marker); marker.openInfoWindowHtml( "<strong>Location</strong>"+ " <br>Type your location"); } } ); } } // this part uses jquery: $(window).load(function(){loadmap()}); // if you dont have jquery, do something like: window.onload = loadmap; //]]> </script> <div id="map" style="width: 300px; height: 400px"> </div>
You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.
A very nice niche blog, and a good design there sparks Simplicity yet complex algorithm of the internet. Thank You
[...] Google Maps on your website | BNCScripts [...]