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)

DID1194652.patch (1.6 KB ) - added by cuic 16 years ago.
From_SiteServer_20100223_DID 1194652.01 Scale and Legend.mgp (18.0 KB ) - added by liuar 15 years ago.

Download all attachments as: .zip

Change History (13)

by cuic, 16 years ago

Attachment: DID1194652.patch added

comment:1 by brucedechant, 16 years ago

Owner: changed from cuic to brucedechant
Status: newassigned

comment:2 by tomfukushima, 15 years ago

Owner: brucedechant removed
Status: assignednew

comment:3 by madair, 15 years ago

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

comment:4 by liuar, 15 years ago

Hi Mike,

I think this defect still can be reproduced by following steps

  1. 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.
  2. Update the scale range settings for each layer. Layer1(0-1500) and layer2(0-Infinity)
  3. Adjust the initial view of map to make sure the initial scale is larger than 1500.
  4. Preview the weblayout. Only layer2 is displayed in map and legend
  5. 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 madair, 15 years ago

Owner: set to madair
Status: newassigned

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 madair, 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 madair, 15 years ago

Resolution: fixed
Status: assignedclosed

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.

comment:8 by liuar, 15 years ago

Resolution: fixed
Status: closedreopened

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 jng, 13 years ago

Milestone: 2.4

comment:10 by jng, 12 years ago

Milestone: 2.42.5

comment:11 by jng, 12 years ago

Resolution: duplicate
Status: reopenedclosed
Note: See TracTickets for help on using tickets.