2

I'm trying to overlay a building floor-plan on a google map. However zoom level 21 is too small to show indoor detail. I need zoom 23-26.

I tried settings like:

var mapOptions = {
    zoom : 24,
            maxZoom: 26,
    center : new google.maps.LatLng(52.226071,20.950115),
    mapTypeId: google.maps.MapTypeId.SATELLITE,
};

but it does not work. I get the default behavior.

var mapOptions = {
    zoom : 22
            maxZoom: 26,
            minZoom: 22,
    center : new google.maps.LatLng(52.226071,20.950115),
    mapTypeId: google.maps.MapTypeId.SATELLITE,
};

This, does force more zoom, but i can't get beyond 22.

Surely there has to be some solution for floor-plan overlaying on a map. Any ideas?

4

2 回答 2

4

The maxZoom for the built-in mapTypes is predefined(depending on the mapType and the location)

What you can do:
Use a custom mapType (you may define a maxZoom for it that fit's your requirements)

Observe the zoom_changed-event of the map. When to zoom reaches the maxZoom for the particular location(21 in this case) switch from the built-in mapType to your custom mapType(and switch back when the zoom goes below 21).

于 2014-01-13T18:56:13.673 回答
1

I got this working (albeit with a few bugs) by using a modified version of https://github.com/tilemapjp/ZoomTMSLayer. Instead of using my own tile map service, I just used the same urls that Google was making network calls to.

Essentially you extend google.maps.ImageMapType and redefined the getTile() and getTileUrl() methods. For any zoom level greater than the max zoom level supported by Google at that location, grab the tile that Google would have returned at the max zoom, then scale it and transform each tile so that they line up.

I put my code on Github for viewing convenience: https://github.com/dallinski/GoogleMapsSuperZoomMapType

于 2017-02-02T23:15:23.217 回答