[OpenLayers-Users] Ensure that a wms layer is always on top

Eric Lemoine eric.c2c at gmail.com
Thu Feb 12 15:59:24 EST 2009


On Thu, Feb 12, 2009 at 4:47 PM, Robert Hicks <robhyx at gmail.com> wrote:
> Hi all, I am adding a OpenLayers.Layer.Markers layer to my map but when I
> add an additional WMS layer, the WMS ends up on top of the markers. I am
> using the final release of MapBuilder but I am programatically adding the
> Markers layer via just OpenLayers. I saw setZIndex() which seems like that
> might be a good candidate (after lopping over all the layers and getting
> each zIndex), but  I was wondering if there is a way to move the marker
> layer to the top via the API?

Hi, you may find the map.raiseLayer(layer, delta),
map.setLayerIndex(layer, idx) and map. getNumLayers() methods useful.

--
Eric



More information about the Users mailing list