[OpenLayers-Dev] Rearranging stack order of layers

Jason Lee jaslee.st at gmail.com
Fri Aug 10 01:55:25 PDT 2012


Hi,
I have an OpenLayers application which initially has 4 layers, called
(a),(b),(c) & (d). The app then allows the creation of a new layer (e)
which I want it to "swap" places with layer (b) so that the order should be
(a),(e),(c),(d),(b).

I use the map.setLayerIndex and layer.getZIndex to try and do this but I
realise that the layers are in a FIFO like queue, so when I temporarily
re-assign layer (b) the other layers automatically reorder themselves to
(a),(c),(d),(e) ...or at least that's what I think it happening.

Could anyone show me how I can simply swap the z-order of 2 layers?

Thanks

Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20120810/199ce939/attachment.html>


More information about the Dev mailing list