[GIS] How to implement Google Maps API V3 Image Map Type

google-maps-api

I'm new to the Google Maps API V3 and I am trying to add a set of map tiles via the image map type. I followed the steps in this article, and have had no dramas creating the Tileset. I used GDAL2TILES and the the tilesets looks as expected in the preview apps that are generated with the program.

However I cannot get the tilset to show up in my google maps application. My implementation of the Image map type looks like this below

    //The index.html and 'sma_map_1989' folder are in the same directory 
    var smaMapOverlay = new google.maps.ImageMapType({
      getTileUrl: function(coord, zoom) {
        return 'sma_map_1989' + '/' +zoom+ '/' +coord.x+ '/' + coord.y +'.png';
      },
      tileSize: new google.maps.Size(256, 256)
    });
    map.overlayMapTypes.push(smaMapOverlay);

Am I missing something here? It's such a simple thing to do in leaflet and Openlayers.

Best Answer

This stack exchange post solved my problem Google Maps V3 Custom tiles.

My issue was related to the line map.overlayMapTypes.insertAt(0, maptiler); which defines a z-index and the MapType to load. So previously I think the tileset was drawing but not displayed as the top most layer.