Opened 17 years ago

Closed 16 years ago

Last modified 16 years ago

#419 closed defect (fixed)

Composite line style element selection bug

Reported by: skorpion Owned by: tonyfang
Priority: medium Milestone:
Component: General Version: 2.0.0
Severity: major Keywords:
Cc: External ID: 1055212

Description

When I select in mapview composite line style element (AJAX viewer) I get message on status bar "3 features selected". In my opinion it should be "1 feature selected".

Attachments (2)

Image1.PNG (39.9 KB ) - added by skorpion 17 years ago.
Composite line style definition (3 components)
Image2.png (9.4 KB ) - added by skorpion 17 years ago.
3 features selected - should be 1 feature selected

Download all attachments as: .zip

Change History (9)

by skorpion, 17 years ago

Attachment: Image1.PNG added

Composite line style definition (3 components)

by skorpion, 17 years ago

Attachment: Image2.png added

3 features selected - should be 1 feature selected

comment:1 by tomfukushima, 17 years ago

Milestone: 2.0

comment:2 by isca, 17 years ago

It is also not possible to select multiple features (with SHIFT key) when a linefeature with composite line style is selected.

comment:3 by tonyfang, 16 years ago

External ID: 1055212
Owner: set to tonyfang
Status: newassigned

comment:4 by tonyfang, 16 years ago

Resolution: fixed
Status: assignedclosed

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.

comment:5 by tonyfang, 16 years ago

Note there is still a problem with shift-selecting composite line style features in the Fusuon Viewer. This fix has not addressed that.

comment:6 by tomfukushima, 16 years ago

Is there a Fusion trac ticket for the Fusion problem referenced above?

Note: See TracTickets for help on using tickets.