kwaxy
kwaxy

Reputation:

How can I Add Google My Maps API on my website?

I want to add Google Maps API to my website, but I didn't find any good reference.

Upvotes: 4

Views: 24821

Answers (4)

Juan Hernandez
Juan Hernandez

Reputation: 26

You can simply generate the code to display your map at http://www.map-embed.com. I hope it helps.

Upvotes: 0

J.R.
J.R.

Reputation: 1

No API key is needed for v3 of the API now

I have not been able to find anything yet that allows you to get at the "my maps" type interface you get at https://www.google.com/maps/mm

Upvotes: 0

Bogdan M.
Bogdan M.

Reputation: 11

Google maps provide a very good API so you can show google maps on your website. Most webmasters are using google maps to help customers find the location of their business ( usually on contact pages ). Others are building full applications based on google maps. It is very easy to implement google maps on any website. Read Here

Upvotes: 1

gm3dmo
gm3dmo

Reputation: 345

First you need to register with google and get a MAPS api key:

http://code.google.com/apis/maps/signup.html

Then you need to embed some javascript in your pages/templates:

 <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=__your_key_here__" type="text/javascript"></script>

Another bit to draw the actual map:

<script type="text/javascript">
    //<![CDATA[ 
    function createMarker(point,html) {
        var marker = new GMarker(point);
        GEvent.addListener(marker, "click", function() {
        marker.openInfoWindowHtml(html);
        });
    return marker;
    }

    function load() {
    if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(51.16349933440274, 4.371164292063712 ), 6);
        var point = new GLatLng(51.16349933440274, 4.371164292063712);
        var marker = createMarker(point,'<div style="width:240px"> \
          Place:    <b>ANTWERPEN          </b><br> \
          </div>')
          map.addOverlay(marker);
    }
   }
   //]]>
  </script>

This tutorial was useful:

http://econym.org.uk/gmap

The maps API documentation is very good:

http://code.google.com/apis/maps/documentation/javascript/

Note that version 3 of the maps api has recently been released (it has lots of enhancements for mobile browsers, so you might want to look into that).

This might be a candidate to be moved to stackoverflow.com

Upvotes: 4

Related Questions