Select to view content in your preferred language

Multiple BaseMap Layers

1028
2
01-21-2011 03:03 AM
philippschnetzer
Frequent Contributor
I am using three basemaps in my application:  a basemap consisting of a set of provincial layers which I have called 'surround', an aerial image basemap and also a DEM basemap.  My study area consists of three small areas in the province.  I am using the 'surround' basically just to add some context outside of the stuudy area.  My aerial and DEM basemaps fully cover the study area.  I always want to have the 'surround' basemap showing and then want to be able to toggle on/off the aerial and DEM basemaps as overlays on the surround.

So far I have only been able to show the surround overlaid with either the aerial or DEM but with no option to toggle on/off (this might be that 'hybrid' basemap functionality...).  As soon as I add the MapSwitcher widget and select the aerial or DEM basemaps the surround disappears.

How can I make the 'surround' always visible with no option to switch on/off but give the user the ability to turn on/off the aerial or DEM basemaps while the surround is still visible??

Help is much appreciated!
Tags (2)
0 Kudos
2 Replies
philippschnetzer
Frequent Contributor
So this can all be done in the config.xml now... 

In my case I made a basemap layer for the 'surround' and names it 'surround'.  Then I made one for the aerial and named it 'aerial' and copied and pasted the the 'surround' beneath it but renamed it to 'aerial' as well.  By naming two layers with the same layer name it creates a hybrid map which you can then toggle on/off if you enable the MapSwitcher widget.
0 Kudos
philippschnetzer
Frequent Contributor
I have this working pretty good now with my basemap portion of the config.xml as follows:

<basemaps>       
         
         <layer label="Surround" type="tiled" visible="true" 
          url="http://192.168.80.100/ArcGIS/rest/services/SURROUND/MapServer"/>   
         
         <layer label="Aerial" type="tiled" visible="false" 
          url="http://192.168.80.100/ArcGIS/rest/services/SURROUND/MapServer"/>       
          
     <layer label="Aerial" type="tiled" visible="false" 
          url="http://192.168.80.100/ArcGIS/rest/services/AERIAL/MapServer"/>    
          
  <layer label="DEM" type="tiled" visible="false" 
          url="http://192.168.80.100/ArcGIS/rest/services/SURROUND/MapServer"/>       
          
     <layer label="DEM" type="tiled" visible="false" 
          url="http://192.168.80.100/ArcGIS/rest/services/DEM/MapServer"/>    
                                                           
        </basemaps>


But, the only issue I have is that when either the Aerial or DEM button is clicked on the app then the 'Surround' basemap actually has to redraw.  I have not been able to figure out a way to just keep the 'Surround' always visible without having it redrawn when the Aerial or DEM is selected....

Also, another nice feature would be able to hide/exclude a certain basemap from appearing on the buttons..ideally I would have just a button for 'Aerial' and one for 'DEM' that when clicked toggle that layer on/off.  Right now I basically have three buttons - 'Surround', 'Aerial' and 'DEM' and the 'Surround' button just functions as a button to clear either the 'Aerial' or 'DEM' layers if they are turned on...
0 Kudos