Opened 16 years ago
Closed 12 years ago
#940 closed defect (duplicate)
Scale dependent layers appearing as the user zooms in added to bottom of the legend
Reported by: | cuic | Owned by: | madair |
---|---|---|---|
Priority: | medium | Milestone: | 2.5 |
Component: | General | Version: | 2.1.0 |
Severity: | major | Keywords: | |
Cc: | External ID: | 1194652 |
Description
Steps:
1) Using any map with several layers, make one of the layers scale range dependent and set it's draw order to be on the top 2) Add the map to a flexible web layout and preview it 3) Zoom in and notice in the legend that the layer is added to the bottom of the legend, if the layer is in a group, it's added to the bottom of the group.
Expected: the legend of this layer should also be on the top (according to the draw order in map)
Analysis: When the map scale is changed (set manually on the bottom, click zoom in/out button, or drag the scroll bar on the top right), "updatelayer" is called. The tree of legend is updated there. It will go through all the layers group by group. If the scale range contains the scale we set, a legend of this layer is created and appended to the legend tree instead of being inserted according to the draw order.
Solution: Remove all the items in the legend tree before it goes through all the layers. Then if the layer already has a legend treeitem, just append it to the tree and ignore the creating process.
Attachments (2)
Change History (13)
by , 16 years ago
Attachment: | DID1194652.patch added |
---|
comment:1 by , 16 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 15 years ago
Owner: | removed |
---|---|
Status: | assigned → new |
comment:3 by , 15 years ago
comment:4 by , 15 years ago
Hi Mike,
I think this defect still can be reproduced by following steps
- You can simply add two layers(layer1 and layer2) in a map and update the map's draw order to make layer1 display over layer2.
- Update the scale range settings for each layer. Layer1(0-1500) and layer2(0-Infinity)
- Adjust the initial view of map to make sure the initial scale is larger than 1500.
- Preview the weblayout. Only layer2 is displayed in map and legend
- Zoom in to 1:1000 and I could see layer1 displayed over layer2 in map, but in the legend, the layer1 is below layer2 which is inconsistent with draw order.
Thanks,
Arthur
comment:5 by , 15 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
Arthur,
I still can't reproduce this. Following the steps above, at step 4, both layers show up for me in the Legend initially and stay there no matter what scale the map is at. I think there may be some other error happening here. Can you capture the output of LoadMap.php and LoadScaleRanges.php and attach to the ticket please?
comment:6 by , 15 years ago
Sorry, spoke to soon on the last comment, I can see this now but only in IE. Looking into it further.
comment:7 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
fixed at rev 2071 of Fusion.
Re-creating the entire Legend tree is a relatively expensive operation so it is better to just re-insert the new node in the place of the old one.
by , 15 years ago
Attachment: | From_SiteServer_20100223_DID 1194652.01 Scale and Legend.mgp added |
---|
comment:8 by , 15 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Please test against the packet "From_SiteServer_20100223_DID 1194652.01 Scale and Legend.mgp".
After Zoom in to 1:1400, you can see layer Building displayed on the top of layer Districts, but Districts displayed on top of Building in legend.
comment:9 by , 12 years ago
Milestone: | → 2.4 |
---|
comment:10 by , 12 years ago
Milestone: | 2.4 → 2.5 |
---|
comment:11 by , 12 years ago
Resolution: | → duplicate |
---|---|
Status: | reopened → closed |
Moved to: http://trac.osgeo.org/fusion/ticket/560
testing this with current Fusion trunk and the Sheboygan dataset and I'm not seeing this behaviour. Out-of-scale layers come up listed in the legend (but unchecked).
Note that Group order takes precedence over layer order