[mapserver-users] Styling KML output

Martin Høgh mh at mapcentia.com
Thu Dec 3 05:21:10 PST 2020


I've setup KML/KMZ output for WFS with these definitions:

         OUTPUTFORMAT
             NAME kml
             DRIVER "OGR/KML"
             MIMETYPE "application/vnd.google-earth.kml+xml"
             IMAGEMODE FEATURE
             EXTENSION "kml"
             FORMATOPTION "FORM=simple"
             FORMATOPTION 'FILENAME=gmap75.kml'
             FORMATOPTION "maxfeaturestodraw=1000"
         END

         OUTPUTFORMAT
             NAME kmz
             DRIVER "OGR/LIBKML"
             MIMETYPE "application/vnd.google-earth.kmz"
             IMAGEMODE FEATURE
             EXTENSION "kmz"
             FORMATOPTION "FORM=simple"
             FORMATOPTION 'FILENAME=gmap75.kmz'
             FORMATOPTION "maxfeaturestodraw=1000"
         END

It works fine.

When serving KML polygons they all have a red outline and no fill:

<Style><LineStyle><color>ff0000ff</color></LineStyle><PolyStyle><fill>0</fill></PolyStyle></Style>

Is it supposed to use the classes in the MapFile? Or is there another 
way to style KML output?

Best regards,

Martin Høgh




More information about the mapserver-users mailing list