ThinkGeo.com    |     Documentation    |     Premium Support

OverlaySwitcher Position

Can the overlay switcher be in a different location, off the map.


The evaluation of the project is to make it part of a larger DNN portal where civil construction project are managed. The map will live in a content container and the overlaySwitcher in a container in the right. Other tools like info etc, will also be off-map.


Is this possible?


 



 


Guss, 
 
We don’t have any built-in control outside the map, but sure you can still make it. Here we have 3 solutions.
 
1.       Modify the style of OverlaySwitcher. Paste the following code to your aspx page and make sure the OverlaySwitcher map tool is enabled.
 

      function OnMapCreated(map) {
            var overlaySwitcher = map.getControlsByClass("OpenLayers.Control.LayerSwitcher")[0];
            // Set the position of OverlaySwitcher
            overlaySwitcher.div.style.position = "fixed";
            overlaySwitcher.div.style.right = "200px";
            overlaySwitcher.div.style.top = "200px";
            overlaySwitcher.layersDiv.style.paddingRight = "0px";
        }

         
2.       Create a control using our server side APIs, for example, make a radio button list and change overlays’ visibility in its selectedIndexChanged event.
 
3.       Web Edition client side features is based on OpenLayers, so the OverlaySwitcher can also be created by you using OpenLayers library, here is a online-sample in OpenLayers,
 
openlayers.org/dev/examples/layerswitcher.html
openlayers.org/dev/examples/...tside.html
 
Hope that helps!
 
Ben

Thanks again Ben for answering all my questions. The sample as links all will work create for me.

That’s great! Very pleasure to help:)