Archive for March, 2008

Google Maps JavaScript API By Example

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”content-type” content=”text/html; charset=utf-8″/>
<title>Google Maps JavaScript API Example</title>
<script src=”http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAHPjbBusRXFNvZ5sYJ0ZIORQ6mvWlf2zELyCHQKoLvoF6IcjeARQcFQhyvkw_-9UhlUmN6JU879v6LQ”
type=”text/javascript”></script>
<script type=”text/javascript”>

//<![CDATA[

function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
}
}

//]]>
</script>
</head>
<body onload=”load()” onunload=”GUnload()”>
<div id=”map” style=”width: 500px; height: 300px”></div>
</body>
</html>

Above mantioned code is a example of google map api which you can find from google when you sign up for google map.
Using your site url
And also there are a key that’s are valid only for your given link or site.

Hope your script running nice But one things!

You may confused!
<code>
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
</code>
How can you set GLatlng parameter! is not it?
yap This two parameter is

1) Latitude
2) Longitude

For More about Latitude and Longitude Just search in google by writing
1) define:Latitude
2) define:Longitude

You may understand just visit this link(By Yahoo inc) where you find a given addresses latitude and longitude
http://www.batchgeocode.com/lookup/

Suppose your address is
1304 Chicago Ave, Evanston, IL 60201
Then
Enter this address in Map It! field
1304 Chicago Ave, Evanston, IL 60201

By click on Map It you got latitude and longitude’s value then add it in google api code.

Thanks again

Add comment March 24, 2008



Jewel Ahmed's Facebook profile
Jewel Ahmed's Facebook profile

Pages

Categories

 

March 2008
M T W T F S S
« Feb   Oct »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Blogroll

Recent Comments

Wardell on MySql Type Casting
Ahsan on Other to FLV file conversion i…
mySql Type Casting t… on MySql Type Casting
bibomedia on About

Recent Posts

Archives