[OpenLayers-Users] Custom layer switcher

Paul Meems bontepaarden at gmail.com
Wed Nov 21 23:42:44 PST 2012


Thanks Slawomir,

Adding "ascending":false solved my problem.

Thanks again,

Paul


2012/11/21 Slawomir Messner <slawomir.messner at staff.uni-marburg.de>

>  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 listUsers at lists.osgeo.orghttp://lists.osgeo.org/mailman/listinfo/openlayers-users
>
>
> _______________________________________________
> 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/20121122/e98f58e2/attachment.html>


More information about the Users mailing list