[mapguide-trac] #940: Scale dependent layers appearing as the user zooms in added to bottom of the legend

MapGuide Open Source trac_mapguide at osgeo.org
Tue Mar 31 03:46:43 EDT 2009


#940: Scale dependent layers appearing as the user zooms in added to bottom of
the legend
-----------------------+----------------------------------------------------
   Reporter:  cuic     |       Owner:  cuic 
       Type:  defect   |      Status:  new  
   Priority:  medium   |   Milestone:       
  Component:  General  |     Version:  2.1.0
   Severity:  major    |    Keywords:       
External_id:  1194652  |  
-----------------------+----------------------------------------------------
 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.

-- 
Ticket URL: <http://trac.osgeo.org/mapguide/ticket/940>
MapGuide Open Source <http://mapguide.osgeo.org/>
MapGuide Open Source Internals


More information about the mapguide-trac mailing list