[mapguide-trac] #1428: GETMAPLEGENDIMAGE should omit empty layer groups from being rendered

MapGuide Open Source trac_mapguide at osgeo.org
Tue Sep 7 13:12:56 EDT 2010


#1428: GETMAPLEGENDIMAGE should omit empty layer groups from being rendered
---------------------------------+------------------------------------------
   Reporter:  jng                |       Owner:                   
       Type:  enhancement        |      Status:  new              
   Priority:  medium             |   Milestone:                   
  Component:  Rendering Service  |     Version:                   
   Severity:  trivial            |    Keywords:  legend, rendering
External_id:                     |  
---------------------------------+------------------------------------------
Changes (by tomfukushima):

 * cc: brucedechant (added)


Comment:

 The code in the patch looks like it will work, but should we be concerned
 about efficiency?  For example, if there are 20 groups and 800 layers in
 the map then that loop will execute the statement "layer->!IsVisible() &&
 layer->!GetGroup() == mggroup.p" 20 x 800 = 16,000 times. Should we
 instead do something like the following...

 {{{
 define Hashtable of groups
 for each layer
  if isVisible & !groups.Contains(layer.groupName)
    add the group name to the Hashtable

 for each group
  if groups.Contains(group.name)
    execute the code to add group
 }}}

 Now, assuming the hashtable has a good implementation, this might be
 substantially faster.

-- 
Ticket URL: <http://trac.osgeo.org/mapguide/ticket/1428#comment:2>
MapGuide Open Source <http://mapguide.osgeo.org/>
MapGuide Open Source Internals


More information about the mapguide-trac mailing list