gismapserverumn-mapserverumn

How do you get transparent background in a layer with UMN mapserver?


I want to include different sources of maps in a mapclient. One source I provide myself with a self-written mapfile rendered by an UMN-mapserver. Problem is, that UMN renders the background (places there no feature is) as white, and if I combine this in the mapclient, this hides all layers behind. What do I write into the mapfile, that the background is transparent?


Solution

  • Also in your MAP object you can set the TRANSPARENT ON and IMAGECOLOR to something that suits

    note:

    IMAGECOLOR [r] [g] [b]

    Color to initialize the map with (i.e. background color). When transparency is enabled (TRANSPARENT ON) for the typical case of 8-bit pseudocolored map generation, this color will be marked as transparent in the output file palette. Any other map components drawn in this color will also be transparent, so for map generation with transparency it is best to use an otherwise unused color as the background color.

    from http://mapserver.org/mapfile/map.html