In google maps API v3, I’m creating my own custom map types by calling
map.mapTypes.set('my map', new google.maps.ImageMapType({
getTileUrl: ...
minZoom: 12,
maxZoom: 20,
...
}));
The layers have of course limited zoom range (12-20 in this example). Now the problem is the default behaviour of google maps. When I see map in scale 7 for example and switch to my map, the map automatically zooms in to zoom 12.
Instead, when I am in zoom 7 and switch to my map, I would like to see tiles with text “No map data in this scale, please zoom in”.
- Is there some standard option / way how to do this within API v3?
- Is there some commonly used solution to this problem?
- If not, what would be the easiest way to do it?
Thanks in advance.
Avoid
minZoomandmaxZoomoptions and try something like this: