Krishna Rajendra Alapati

IT Professional having 4+ years of experience on Java and JEE technologies. Good experience in working with Servlets, JSP, EJB2, XML, XSLT and JEE Design patterns. Good experience in working with open source frameworks like Struts, Spring, Hibernate, ANT, JUnit and JMock.

My Photo
Name:
Location: London, Ilford, United Kingdom

Saturday, December 06, 2008

I am here in Google Map.

Here is my Google Map Example:
Using is Google MAPs API is as simple as shown here. All you need to do is go to http://code.google.com/apis/maps/signup.html and get the KEY for your web site. And then add the below code. I have customized it as per my requirement, you can do customize as per your needs.
<!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&sensor=true&key=ABQIAAAAjgX3miT717zapeVW6zuHRxT1IMuN1NXMfAxi-ffadLCYQNWCfBQyHqO9wnyZnk3imlkKMth72H2WRg"
type="text/javascript"></script>
<script type="text/javascript">



function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.setMapType(GMapType.G_HYBRID_MAP);
var myLocation = new GLatLng(51.55477,0.08027);
map.setCenter(myLocation, 16);
map.addControl(new GSmallMapControl());
var type = new GMenuMapTypeControl();
//var type = new GHierarchicalMapTypeControl();
map.addControl(type);
var myMarker = new GMarker(myLocation);
map.addOverlay(myMarker);
GEvent.addListener(myMarker, "click", function() {
myMarker.openInfoWindowHtml("Hi Friends! Krishna Rajendra is here.");
});
}
}


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

The above code will be shown in your site like this: