how to use google map api

Google Maps

<link rel="stylesheet" href="style.css" type="text/css" media="all" title="" /

Loading Map

Now create a JavaScript file called map.js:
Copy code

function load () {
var map = document.getElementById(“map”);
if (GBrowserIsCompatible()) {
var gmap = new GMap2(map);
gmap.addControl( new GSmallMapControl() );
gmap.addControl( new GMapTypeControl()) ;
gmap.addControl( new GOverviewMapControl(new GSize(100,100)) );
gmap.setCenter( new GLatLng(54.7,-4), 5 );
} else {
alert(“Sorry, your browser cannot handle the true power of Google Maps”);
window.onload = load;
window.onunload = GUnload;


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s