I have some data that I would like to display in greater detail as the user zooms into the interactive Gooogle map. Does google support dynamically turning layers on and off depending on the scale?
2 Answers
This is how it can be done: (taken from https://gis.stackexchange.com/a/17434/5436)
google.maps.event.addListener(map, 'zoom_changed', function() {
zoomLevel = map.getZoom();
if (zoomLevel >= minZoomLevel) {
FTlayer.setMap(map);
} else {
FTlayer.setMap(null);
}
});
You may use the Region and LoD KML elements:
Lod Lod is an abbreviation for Level of Detail. describes the size of the projected region on the screen that is required in order for the region to be considered "active."
You need to convert the zoom level value into screen pixel size.
I know it works in G-Earth - I suppose it works in G-Map...