You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
tbonfort
added a commit
to MapServer/msautotest_DEPRECATED
that referenced
this issue
Aug 9, 2013
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.
The text was updated successfully, but these errors were encountered: