[mapserver-users] Label frame offset with leader line

Stephen O'Connell stephen.oconnell at navigraph.com
Thu Sep 15 07:19:22 PDT 2016


Hello.

I have a problem with label rendering Mapserver, and I haven't been able 
to find a solution myself.

I'm rendering point labels with GEOMTRANSFORM 'labelpoly' to get a frame 
around the label. To get more labels to show, I have enabled LEADER so 
that labels are more likely to be visible but farther away from the 
point. However, when a label is moved away and attached with a LEADER, 
then the frame around the label gets an offset both vertically and 
horizontally. See the image 
https://www.dropbox.com/s/hwbt370d8371oqw/labeloffset.png?dl=0 where the 
bottom left label has a leader, but the green frame is moved a few 
pixels down and to the right.

Is the combination of LEADER and GEOMTRANSFORM 'labelpoly' not 
supported, or am I doing something wrong?

Here is a section of my mapfile for the relevant layer:

LABEL
     WRAP "!"
     ALIGN center
     TEXT ('[name]' + "!D116.7 " + '[ident]')
     MAXSCALEDENOM 2600064
     POSITION auto
     PARTIALS false
     SIZE 8
     COLOR 100 150 100
     TYPE truetype
     FONT vera
     FORCE false
     STYLE
         GEOMTRANSFORM 'labelpoly'
         OFFSET 2 2
         COLOR 150 200 150
         OUTLINECOLOR 150 200 150
         WIDTH 1
         OPACITY 100
     END
     STYLE
         GEOMTRANSFORM 'labelpoly'
         COLOR 255 255 255
         OUTLINECOLOR 150 200 150
         WIDTH 1
         OPACITY 95
     END
END
LEADER
     GRIDSTEP 40
     MAXDISTANCE 1000
     STYLE
         COLOR 150 200 150
         WIDTH 2
     END
END


I appreciate any assistance or comments.

Kind regards,

Stephen



More information about the mapserver-users mailing list