[OpenLayers-Users] Re: Customize the LayerSwitcher

Dennis Ströer dennis.stroeer at geosysnet.de
Wed May 16 01:27:01 PDT 2012


Hello,

I found a simple solution by myself. The Layerswitcher have to be a 
global variable. Within the function init() you have to register an event;

map.events.register("changebaselayer", map, function (closeevt)

{closeLayerSwitcher(closeevt)});


At last, you need a function to close the LayerSwitcher:

function closeLayerSwitcher(closeevt)

{

     if(closeevt.layer.name!=this.name){

     layerswitcher.minimizeControl();

     }

}


Best regards,
D. Ströer

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120516/72a1f0fa/attachment.html


More information about the Users mailing list