ThinkGeo.com    |     Documentation    |     Premium Support

How Disable layers dialog popout?

Hi,


Is there a way to disable the Layers Switcher  popout ? 


By default, it expands and lets the user to select the layers but would like it to be hidden and only popup when the user click on the side arrow on the right.


Used to be hidden on the previous version of mapsuite


Thanks.



Hello!!  
  
 Are the Mapsuite team out there somewhere ?

Hi, 
  
 I think by default, the overlay switcher is disabled. Only when you set the following code it will be visible. 
  
             Map1.MapTools.OverlaySwitcher.Enabled = True  
  
 So just remove it all set it to false, it will be fine. 
  
 Thanks, 
  
 Ben

I think you didn’t understand my question. 
  
 I still want to user to enable/disable layers but the popup (by default) is annoying. 
  
 It will be nice if there’s a way to minimize the popup. 
  





 


I see. You still want the switcher but just minimize it by default.  Here by adding the following script to the head block, you can do it.



var OnMapCreated = function(map) {
var layerSwitcher = map.getControlsByClass("OpenLayers.Control.LayerSwitcher")[0];
layerSwitcher.minimizeControl();
}

Also for more client APIs, please check here.


dev.openlayers.org/docs/file...er-js.html


Thanks,


Ben.