Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolutionfactor not used during LegendIcon creation (AGG) #4725

Closed
jpmaloberti opened this issue Aug 9, 2013 · 0 comments
Closed

resolutionfactor not used during LegendIcon creation (AGG) #4725

jpmaloberti opened this issue Aug 9, 2013 · 0 comments
Assignees
Milestone

Comments

@jpmaloberti
Copy link

I'm using the createLegendIcon class method, in a PHPMapscript script to generate a high resolution legend (PNG icons with AGG/PNG driver), inserted in a PDF document. The RESOLUTION value in the mapfile is modified from the script to obtain a medium (150 DPI) or high (300 DPI) resolution map. The DEFRESOLUTION is always 75. The map is scaled correctly but the legend icons are always in a poor resolution (normal size) or not well scaled (if oversized). It seems they are generated in a screen resolution.
Here the PHP code for 30 px x 20 px icons :
$factSize = ($myMap -> resolution) / ($myMap -> defresolution);
$myIcon = $myClass -> createLegendIcon(30 * $factSize, 20 * factSize);

Searching in maplegend.c I modified the calls to msDrawLineSymbol and msDrawShadeSymbol in msDrawLegendIcon function : I changed the last parameter from lp->scalefactor to lp-scalefactor * (image_draw->resolutionfactor) and the results are now ok.
I did'nt modify the call to msDrawMarkerSymbol for now.

tbonfort added a commit to MapServer/msautotest_DEPRECATED that referenced this issue Aug 9, 2013
@ghost ghost assigned tbonfort Aug 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants