#1428 closed enhancement (fixed)
GETMAPLEGENDIMAGE should omit empty layer groups from being rendered
Reported by: | jng | Owned by: | brucedechant |
---|---|---|---|
Priority: | medium | Milestone: | 2.3 |
Component: | Rendering Service | Version: | 2.1.0 |
Severity: | trivial | Keywords: | legend, rendering |
Cc: | External ID: |
Description (last modified by )
The current GETMAPLEGENDIMAGE operation has a limitation whereby all layer groups in the current map are included in the rendered legend image.
If the map in question has lots of layer groups but the layers contained within are not visible in the current map view/scale, then this results in a rendered image containing lots of empty layer groups, cluttering up the image.
The GETMAPLEGENDIMAGE operation should be changed to omit empty layer groups from being rendered to the resulting legend image. This was the behaviour in MapGuide 6.5
Attachments (1)
Change History (8)
comment:1 by , 14 years ago
Description: | modified (diff) |
---|---|
Summary: | GETMAPLEGENDIMAGE should have option to omit empty layer groups from being rendered → GETMAPLEGENDIMAGE should omit empty layer groups from being rendered |
comment:2 by , 14 years ago
Cc: | added |
---|
comment:3 by , 14 years ago
From a cursory glance of the legend rendering code, it appears that performance is not a function of the map size, rather it is a function of the height of the requested image.
So whether a map has 8 layers or 800 layers, it will render at relatively the same speed given the same image height, since it will only render up to the specified height.
This may become a factor if we're dealing with an large image height (in the 100k/millions of pixels high), but an image of such a height doesn't exactly fall into our standard user scenario (A4-sized printout from AJAX viewer, the only known consumer of GETMAPLEGENDIMAGE)
comment:4 by , 14 years ago
Cc: | removed |
---|---|
Owner: | set to |
by , 14 years ago
Attachment: | 1428.patch added |
---|
comment:6 by , 14 years ago
Milestone: | → 2.3 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Version: | → 2.1.0 |
Fixed. r5162
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...
Now, assuming the hashtable has a good implementation, this might be substantially faster.