Wrong resolution factor during LegendIcon creation with KEYIMAGE #4885

wants to merge 1 commit into


None yet

3 participants

barotto commented Mar 16, 2014

MapServer 6.4.1.
I'm using the createLegendIcon class method with PHP Mapscript to generate a high resolution legend.
The RESOLUTION value in the mapfile is modified with php the script to obtain a 300 DPI legend icon.
Problem is, if the class has a KEYIMAGE defined, the symbol is scaled wrongly and zoomed way too much.
My solution is to modify maplegend.c at line 223, in function msDrawLegendIcon, and remove image_draw->resolutionfactor when theclass->keyimage != NULL:


@sdlime any reason we should not apply this one? Seems reasonable not to scale up a legend image if it has been explicitely supplied by the user. Side effect here will be a legend icon that does not expand in size when changing resolution ....

sdlime commented Mar 24, 2014

I can't think of any reason not to apply. Side affect seems pretty minor since not that many folks use the resolution parameter. -- Steve


applied in 7b86158

@tbonfort tbonfort closed this Mar 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment