[mapguide-internals] Patch for ticket 2380 (GETMAPLEGENDIMAGE should skip groups with no visible layers)

Jackie Ng jumpinjackie at gmail.com
Fri Nov 22 06:40:10 PST 2013


Hi All,

I've attached a patch for ticket 2380 (GETMAPLEGENDIMAGE should skip groups
with no visible layers)

http://trac.osgeo.org/mapguide/ticket/2380

This adds a "compilation" step to the legend rendering where we compile the
following information about the MgMap to avoid repeated linear searches for
this information:

 - The number of visible layers for each group (as a typedef'd
std::map<STRING, int> )
 - The list of child groups for each group (as a typedef'd std::map<STRING,
std::vector<STRING>> )

Then for each child group we find in
MgLegendPlotUtil::ProcessLayersForLegend(), we check if that group has any
visible child layers using the above compiled information. If there are no
visible layers for that group, we skip the recursive call back into
MgLegendPlotUtil::ProcessLayersForLegend() for that particular group.

The net result is that visible groups that have no visible child layers are
not drawn into the legend, reducing the clutter of empty groups in the
rendered legend.

Please review. Thanks.

- Jackie



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Patch-for-ticket-2380-GETMAPLEGENDIMAGE-should-skip-groups-with-no-visible-layers-tp5090688.html
Sent from the MapGuide Internals mailing list archive at Nabble.com.


More information about the mapguide-internals mailing list