Opened 20 years ago
Last modified 18 years ago
#1147 assigned defect
symbol sizes wrong in legend
Reported by: | Owned by: | sdlime | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | MapServer CGI | Version: | 4.8 |
Severity: | normal | Keywords: | |
Cc: |
Description
I have the following layer to define a 4 kilometers cross: LAYER ... SIZEUNITS meters CLASS SYMBOL "cross" SIZE 4000 COLOR 0 0 0 END END When i get the legend of this layer (mapserver?mode=legend) i get an ugly legend because the size of symbol "+" is too big. If i try: LAYER ... SIZEUNITS kilometers CLASS SYMBOL "cross" SIZE 4 COLOR 0 0 0 END END I get very small symbols on the legend. How can i do to get symbols the right size?
Attachments (1)
Change History (7)
comment:2 by , 20 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
I think it is a bug. LEGENG object doesn't take into account "SIZEUNITS" tag and it seems to assume "pixels" as unit. If a symbol size is bigger than KEYSIZE then i think it should be scaled down in order to fit into the symbol key box. I have attached an example of wrong legend. If you consider it wasn't a bug, please consider it a feature request.
comment:4 by , 18 years ago
Version: | unspecified → 4.8 |
---|
This bug is still alive in mapserver 4.8.2. Is this going to be fixed at any time?
comment:6 by , 18 years ago
Cc: | added |
---|---|
Status: | reopened → assigned |
I think I got this one. The layer scalefactor used when map drawing was not being computed (or used) when creating legend icons. I think that was appropriate for layers with symbolscale set since the default size in any given style is good to use in a legend. However, in the case of non-pixel sizeunits there is no good default symbol size so we have to use whatever image dimentions are available to us. So, I did 2 things. In msDrawLegend we compute the layer scalefactor and in msDrawLegendIcon we use that scalefactor in calls to the symbol renderer's. The default scalefactor is 1.0 (which is what was being passed previously) so this should only have any effect in a case like Francisco's. This will fix the full legend images and in most cases the legend icon creation, but I suspect maptemplate.c still needs a check. Francisco, can you try this in CVS HEAD and let me know if it works? Steve
Note:
See TracTickets
for help on using tickets.