[OpenLayers-Users] Set Z-Index of a Feature

Andreas Hocevar ahocevar at opengeo.org
Tue Jan 27 11:10:43 EST 2009


Hi,

On Tue, Jan 27, 2009 at 5:02 PM, Dizzle <lacertosa_domenick at bah.com> wrote:
>
> I have a vector layer that contains many polygons created using
> wkt.read(...).
>
> Is it possible to programatically set the z-index of a polygon?  For
> example, a user can select a polygon that may have polygons inside of it.
> Once the outer polygon is selected, the user cannot select an inner polygon.
> I'd like to be able to allow the user to select a polygon and
> programatically "send to back".

It is possible. See
http://www.openlayers.org/dev/examples/ordering.html for an example.
Other than in the example, you won't need y-ordering, just z-indexing.
So you need to pass zIndexing: true (instead of yOrdering: true) to
the vector layer's options hash.

Regards,
Andreas.

-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.



More information about the Users mailing list