Google maps api: setting MapTypeControl for individual map overlays

I have many pieces of (non-geographic) data that I am trying to view through Google maps. It is basically broken down into N 'maps', each containing M 'layers'.

This example shows what I want to do: http://code.google.com/apis/maps/documentation/javascript/examples/map-simple.html

I can make it switch between two different maps by providing two custom MapTypes (similar to the Map / Sattelite transition in the sample), but I cannot figure out how to do this so that I can switch the additional overlay layer on and off (for example, the relief flag) )

White papers vaguely mention this ( http://code.google.com/apis/maps/documentation/javascript/maptypes.html#MapTypeInterface ), but unfortunately the bit I need (see "Adding MapType controls 'below') is a dead link, and I cannot find this bit of documentation.

Does anyone know where the documentation is about whether switch boxes exist?

thanks

+4
source share
1 answer

If you want a specific overlay to appear or disappear based on the checkbox, you can check http://geojason.info/2010/overlay-map-management-with-google-maps-api-v3/ .

However, this includes checkboxes that are not actually on the map. They need to go to the sidebar or above the map or whatever. If you hope that you can add elements to the control where the โ€œlandscapeโ€ and โ€œlayerโ€ checkboxes appear, I donโ€™t think there are any interceptors in the Google Maps API version 3. I would be happy to make a mistake, but I do not think it is simple, and I expect that any decision that could be implemented would be fragile.

0
source

All Articles