Displaying detailed local tiled maps over a local tiled basemap

567
2
03-28-2014 06:14 AM
KristopherJohnson
New Contributor II
I have an application that starts by displaying a statewide map, which is an AGSLocalTiledLayer. As the user zooms in, we want to display more detailed maps (also AGSLocalTiledLayer) for particular areas of the state.

My initial attempt at this was to load the statewide map layer, and then in -mapViewDidLoad, I add the more detailed map layers, hoping that as the user went to various locations the detailed maps would be displayed. However, this does not work: the detailed maps are not displayed over the basemap.

So, I'm thinking that what I really need to do is respond to changes in the map envelope by checking whether there is a detailed map that corresponds to the current location and change the map view's basemap as necessary. Is this correct, or is there some easier way to accomplish this?

-- Kris
0 Kudos
2 Replies
KristopherJohnson
New Contributor II
My initial attempt at this failed: I tried to determine which detail map was appropriate for the zoomed-in area, then remove the existing basemap and insert the new detail basemap at index zero. The result was that no map was visible.

So what I am doing now is blowing away the map view and creating a new map view with the detail basemap as its basemap. This seems to work, but seems like a heavy-handed way to accomplish this, and I am concerned about resource usage and memory leaks. Is there some easier way that I am overlooking?
0 Kudos
KristopherJohnson
New Contributor II
OK, it turns out there was a relatively easy way to get this to work. The problem was that there was a big gap between the maxScale of the big map and the minScale of the detailed maps, so there was a range of scaling levels where none of the maps were visible, and the map view wouldn't allow zooming down to the detail map's scale range.

Here was what I did to get everything working:

- Load the big map layer and all the detail map layers.
- Set each detail map layer's minScale to match the big map layer's maxScale
- Set the map view's minScale to the big map's minScale, and set its maxScale to the maximum maxScale of all the detail maps

The result is now I can continuously zoom in on some area, and at some point the big map will become invisible and the detail map will become visible.
0 Kudos