Skip to content

Google Map API

April 4, 2009
Google Map

Google Map

Google Maps API

It provides an Application Programming Interface to use the tool on any website. Google Maps uses JavaScript extensively. To use this you should be familiar in JavaScript. By using the Google Maps API, it is possible to embed the full Google Maps into an external website. The Maps API is a free service, available for any web site that is free to consumers.

Links

Home Page: http://code.google.com/apis/maps/
Documentation: http://code.google.com/apis/maps/documentation/
Demos: http://code.google.com/apis/maps/documentation/demogallery.html
Examples: http://code.google.com/apis/maps/documentation/examples/index.html

While Integrating Google Maps in your website, you should use the API key which will be provided by the google. The API key will be unique for each and every domain. Sign for the Google Maps API

For example The API for http://localhost/ will be,

ABQIAAAAkGMwVXYXPd1ca9opxkmJeRT2yXp_ZAY8_ufC3CFXhHIE1N
vwkxQ-135Pijwz1dke1QlhBlEzIQPfbQ

Within the JavaScript Maps API, place the key within the script tag when you load the API:

<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;
sensor=true_or_false&amp;
key=ABQIAAAAkGMwVXYXPd1ca9opxkmJeRT2yXp_ZAY8_ufC3CFXhH
IE1NvwkxQ-135Pijwz1dke1QlhBlEzIQPfbQ"
type="text/javascript">
</script>

Simple Map Example

Code:

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google Maps JavaScript API Example: Simple Map</title>
<script src="http://maps.google.com/maps?file=api&amp;v=2.x&amp;
sensor=false&amp;
key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDV
G8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA"
type="text/javascript"></script>

<script type="text/javascript">
function initialize()
{
    if (GBrowserIsCompatible())
    {
        var map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(9.999958,78.155365), 13);
        map.setUIToDefault();
    }
}

</script>
</head>

<body onload="initialize()" onunload="GUnload()">
<div id="map_canvas" style="width: 500px; height: 300px"></div>
</body>
</html>

(Copy and paste this in a .html file)

Map:

For more Examples

Advertisements

From → Google API

2 Comments
  1. pls tell me on how this api stuff go

    • Aravind permalink

      ur question is..???
      could u gimme more specific…??

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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

%d bloggers like this: