[mapguide-trac] #419: Composite line style element selection bug

MapGuide Open Source trac_mapguide at osgeo.org
Fri Sep 19 22:36:38 EDT 2008


#419: Composite line style element selection bug
----------------------+-----------------------------------------------------
 Reporter:  skorpion  |         Owner:  tonyfang
     Type:  defect    |        Status:  closed  
 Priority:  medium    |     Milestone:          
Component:  General   |       Version:  2.0.0   
 Severity:  major     |    Resolution:  fixed   
 Keywords:            |   External_id:  1055212 
----------------------+-----------------------------------------------------
Changes (by tonyfang):

  * status:  assigned => closed
  * resolution:  => fixed

Comment:

 http://trac.osgeo.org/mapguide/changeset/3333

 When a polyline with a composite line style is stylized, it breaks up each
 style, and renders each style individually. See
 DefaultStylizer::StylizeVectorLayer. So it ends up calling StylizeVLHelper
 for each style. This makes the composite line style ?\226?\128?\152look
 nice?\226?\128?\153.

 E.g. If you have road network, and you use a really thick red line style
 and a thin yellow line style ?\226?\128?\147 you will see the thin yellow
 line segments all connected together. Otherwise, the red thicker outer
 line will surround each line segment ?\226?\128?\147 and the thinner
 yellow line segments won?\226?\128?\153t appear connected.

 When you select a feature, RenderForSelection calls StylizeVectorLayer,
 and goes through the above mentioned code. This results in the selected
 feature id being added to the selection multiple times (once for every
 composite line style).

 Since there are multiple features in your selection, the Ajax viewer
 reports multiple features being selected ?\226?\128?\147 even though there
 should only be one. This also prevents shift-select from working correctly
 in the Ajax viewer.

 To fix this, we need to prevent duplicate ids from being added to the
 selection. When RenderForSelection calls StylizeVectorLayer, it uses a
 FeatureInfoRenderer (a class derived from Renderer). We will add a virtual
 method called RequiresCompositeLineStyleSeparation to Renderer which
 defaults to returning true. For FeatureInfoRenderer, it will return false.
 In DefaultStylizer::StylizeVectorLayer, it will check the
 Renderer::RequiresCompositeLineStyleSeparation(). If it is true, it will
 continue on to the composite line style separation code (if appropriate).
 If it is false, it will simply call StylizeVLHelper one time.

-- 
Ticket URL: <http://trac.osgeo.org/mapguide/ticket/419#comment:4>
MapGuide Open Source <http://mapguide.osgeo.org/>
MapGuide Open Source Internals


More information about the mapguide-trac mailing list