[OpenLayers-Users] Vector layer: overlapping data

Daniel Degasperi daniel.degasperi at r3-gis.com
Tue Apr 6 05:44:40 EDT 2010


Hi Tim,
I finally got the time to test the z-Index Feature and it works great!!
Thank you for updating the stylemap example.

Best regards,
Daniel

Am 25.03.2010 18:14, schrieb Tim Schaub:
> Tim Schaub wrote:
>    
>> Daniel Degasperi wrote:
>>      
>>> Hi,
>>> I have a Vector Layer with Linestrings, which can also overlapp and I've
>>> applied a SelectFeature Control (with hover effect) to this Vector Layer.
>>> My question is, is it possible to bring the current selected feature on
>>> top of all features?
>>>        
>>      
> I updated [1] the StyleMap example [2] to demonstrate how to use
> z-indexing with different render intents.
>
> In addition to using a graphicZIndex (will eventually be zIndex)
> property in your symbolizers, you need to enable z-indexing on the
> renderer.  To do this, set rendererOptions on your layer as shown in the
> example.
>
> To see z-indexing with selection in action, refresh the example until
> you see overlapping points.  When you hover over a point, the render
> intent changes to "select" and you should see the selected feature drawn
> over others.
>
> Tim
>
> [1] http://trac.openlayers.org/changeset/10144
> [2] http://openlayers.org/dev/examples/stylemap.html
>
>    
>> See http://trac.openlayers.org/ticket/1066 for the change that made this
>> the expected behavior (not to bring selected features to the top).
>>
>> We could provide an option to change this behavior.
>>
>> Alternatively, you should be able to give your vector layer a style map
>> with different styles for the "default" and "select" rendering intents.
>>    Using a graphicZIndex property in your symbolizers, you could have
>> selected features rendered above unselected features.
>>
>> The graphicZIndex property is poorly named.  It looks to me like it
>> should apply to any symbolizer - not just a symbolizer that uses an
>> external graphic.  I'll confirm this and open a ticket about adding
>> support for a more appropriately named "zIndex" property on symbolizers.
>>
>> Relevant examples:
>>
>> Using graphicZIndex
>> http://openlayers.org/dev/examples/marker-shadow.html
>>
>> Using a StyleMap with multiple render intents
>> http://openlayers.org/dev/examples/stylemap.html
>>
>> Tim
>>
>>      
>>> Best regards,
>>> Daniel
>>>
>>>        
>>
>>      
>
>    


-- 
   Daniel Degasperi
   Software Developer
   daniel.degasperi at r3-gis.com

---------------------------
   R3 GIS Srl
   Via Johann Kravogl 2
   I-39010 Merano - Sinigo (BZ)
   Tel. +39 0473 494949
   Fax. +39 0473 069902
   Web  http://www.r3-gis.com
-----------------------------




More information about the Users mailing list