#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)
Change History (9)
by , 17 years ago
Attachment: | Image1.PNG added |
---|
comment:1 by , 17 years ago
Milestone: | 2.0 |
---|
comment:2 by , 16 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 , 16 years ago
External ID: | → 1055212 |
---|---|
Owner: | set to |
Status: | new → assigned |
comment:4 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
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 , 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.
Composite line style definition (3 components)