[OpenLayers-Users] Custom layer switcher

Slawomir Messner slawomir.messner at staff.uni-marburg.de
Wed Nov 21 08:02:27 PST 2012


Hi,
you're probably looking for the "ascending" attribute. It's not well 
documented.
http://dev.openlayers.org/releases/OpenLayers-2.12/doc/apidocs/files/OpenLayers/Control/LayerSwitcher-js.html#OpenLayers.Control.LayerSwitcher.ascending
Try:
new OpenLayers.Control.LayerSwitcher({'div': 
document.getElementById('layerSwitcher'),"ascending":false})

Am 21.11.2012 16:57, schrieb Paul Meems:
> I want to create a custom layer switcher.
> I can put the 'normal' text in another div, but I also want to change 
> the order:
> The base layers at the bottom and the overlays on top.
> Looking at the docs I think I need to use baseLayersDiv and 
> dataLayersDiv but when I use those nothing happens.
>
> This is working:
> new OpenLayers.Control.LayerSwitcher({'div': 
> document.getElementById('layerSwitcher')})
> but with the default ordering.
>
> This isn't working:
> new OpenLayers.Control.LayerSwitcher({'baseLayersDiv': 
> document.getElementById('baseLayers'), 'dataLayersDiv': 
> document.getElementById('dataLayers')})
>
> Does anybody has experience with this?
> Searching didn't resulted in any example.
>
> Thanks,
>
> Paul
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20121121/bd1251d0/attachment.html>


More information about the Users mailing list