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

Dizzle lacertosa_domenick at bah.com
Tue Jan 27 11:46:00 EST 2009


I saw that example and I'm still having problems.  I have a function:
function sendToBack(selectedFeature) {
// selectedFeature is a OpenLayers.Feature.Vector
??
}
I can't get the z-index of selected feature to change.  It was a polygon
created by using wkt.read("POLYGON((......))");

I've tried things like this:
selectedFeature.style = OpenLayers.Util.applyDefaults({ graphicZIndex: 1},
OpenLayers.Feature.Vector.style['default']);
to no avail.  Any help would be appreciated.

- Dom

Andreas Hocevar-2 wrote:
> 
> 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.
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 

-- 
View this message in context: http://n2.nabble.com/Set-Z-Index-of-a-Feature-tp2226539p2226777.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list