0

I'm a totally newbie in MapServer. I'm using MapServer 6.0.3. I have managed to label some lines but I cannot create a background colour for the labels.

Using QGIS 2.10 I got something near to what I'm trying to do with MapServer. I tried to export using RT MapServer Exporter but the map file that was created didn't do the job at all.

enter image description here

Now, this is the map file that I have so far:

MAP
  FONTSET "H:/mapserver/data/fonts/fonts.list"
  EXTENT 19 33 30 42
  IMAGETYPE "png24"
  NAME "airways"
  SIZE 1280 1024
  STATUS ON

  LAYER
    NAME "airways"
    DATA "H:/mapserver/data/airways.shp"    
    TYPE LINE    
    LABELITEM "NAME"

    CLASS
      NAME "airways"
      LABEL
        COLOR 0 0 0
        TYPE TRUETYPE
        FONT Vera
        SIZE 7
        ANTIALIAS TRUE
        POSITION CC     
        ANGLE AUTO      
      END # end of label

      STYLE
        COLOR 0 0 0
        WIDTH 0.25
      END # STYLE
    END # CLASS

  END # LAYER

END # MAP

The output of this map file is the following:

enter image description here

I have added in LABEL the following lines to create background colour for the labels, changing at the same time the color in LABEL to 255 255 255 (white font, black background)

STYLE
  GEOMTRANSFORM 'labelpoly'
  COLOR 0 0 0
END # STYLE

The STYLE block was added exactly below the ANGLE AUTO.

Only one label was drawn on the map, the last entry in my shapefile. It has white color and black background but it's only one label.

Any guidance on how to keep all my labels with background color?

1 Answer 1

1

Moving from mapserver 6.0.3 to 6.4.1 solved the problem. The output now is as it was expected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.