Google Maps API v3 integration

7 views
Skip to first unread message

Paul Spencer

unread,
Sep 28, 2011, 10:06:29 AM9/28/11
to mod-ge...@googlegroups.com
Hi,

just a quick post about GMaps integration, the example on the wiki is only for v2.  There are two options for v3.  The simple one (described here) is this:

var map = new google.maps.Map("<element-id>", { /* options */ });

var layerOptions = {
  getTileUrl: function(coord, zoom) {
    return "<url-to-geocache>/" + zoom + "/" + coord.x + "/" + coord.y + ".png";
  },
  tileSize: new google.maps.Size(256,256) // or whatever
};
map.overlayMapTypes.insertAt(0, new google.maps.ImageMapType(layerOptions));

The more complicated version requires subclassing OverlayView and is described here

Cheers

Paul
Reply all
Reply to author
Forward
0 new messages