Hello Everyone, I was wondering how to change the map type by clicking a navigation toolbar button. I'm thinking of creating another web map with Aerial as a base map. Then, on click of button reloading the map with new aerial web map. Is there an easier method?
If you have an AGSWebMap whose basemap layers you want to use, use the AGSWebMap::baseMap property to get an AGSWebMapBaseMap object, and pass that in to one of the above function on the AGSWebMap whose basemap you want to update.
Note, you could just use the stock basemaps (although Bing and OSM may be special cases) rather than creating your own.
Hope this helps, though I'm not 100% sure I understood your question.
Thanks for the reply. It sounds like what I'm looking for. Do you know of any examples using AGSWebMap::openIntoMapView:withAlternateBaseMap: and AGSWebMap::openIntoMapView:withAlternateBaseMap:resetMapView:?
For simplicity, I load up a few WebMaps ahead of time (you might want to do this on-the-fly in your app). I'll use these as basemap options. I'll also load up one WebMap with actual content. When the user picks a different basemap, I reference the content WebMap and the appropriate basemap WebMap.
The only additional trick is to store and set the extent "around" the basemap change, otherwise each basemap change returns the map view to the content WebMap's default (saved) extent.
I also don't initially set the basemap, but just rely on the "Content" basemap. You'd want to take care of that in a real app.