[mapserver-users] question about TRANSPARENT ON
Richard Greenwood
richard.greenwood at gmail.com
Fri Oct 16 16:42:47 PDT 2009
Stephen -
Thanks!
It appears that:
OUTPUTFORMAT
TRANSPARENT ON
works.
And that:
OUTPUTFORMAT
FORMATOPTION "TRANSPARENT=ON"
does not.
I've tested in 5.0 and 5.4 so I think I should submit a bug report. It
would seem to be more of a 'bug' in the documentation than in the
software.
Thanks for your help!
Rich
On Fri, Oct 16, 2009 at 5:00 PM, Stephen Woodbridge
<woodbri at swoodbridge.com> wrote:
> Richard,
>
> Here is a mapfile I used from something, an you can see I was probably have
> the same issue you are because I have transparent on in three places:
>
> MAP
> NAME "ZCTA"
> STATUS ON
> EXTENT -180 -90 180 90
> SIZE 640 480
> IMAGECOLOR 0 0 0
> TRANSPARENT ON
> SHAPEPATH "/u/data/tiger-maps/"
> SYMBOLSET "/u/data/tiger-maps/symbols/symbol.sym"
> FONTSET "/u/data/tiger-maps/fontset.txt"
> UNITS DD
> IMAGETYPE png
> OUTPUTFORMAT
> NAME png
> DRIVER "GD/PNG"
> MIMETYPE "image/png"
> IMAGEMODE PC256
> EXTENSION "png"
> TRANSPARENT ON
> FORMATOPTION "TRANSPARENT=ON"
> END
> WEB
> IMAGEPATH "/tmp/ms_tmp/"
> IMAGEURL "/tmp/"
> HEADER "dummy.html"
> FOOTER "dummy.html"
> TEMPLATE "dummy.html"
> END
> LAYER
> NAME "Zcta"
> STATUS DEFAULT
> TYPE POLYGON
> MAXSCALE 1000100
> TILEINDEX "tiger2k-misc"
> TEMPLATE "ttt.html"
> LABELITEM ZCTA
> CLASS
> COLOR -1 -1 -1
> OUTLINECOLOR 255 255 255
> LABEL
> TYPE BITMAP
> SIZE small
> END
> END
> END
> END
>
>
> Richard Greenwood wrote:
>>
>> Thanks Stephen, I tried with and w/o the "=", but no joy.
>>
>> Daniel - thanks for your suggestion to use the AGG RGBA mode, but
>> still no luck there either.
>>
>> Varun - thanks for the reply, but opacity isn't exactly what I'm
>> after. That effects everything in the layer, I just want a transparent
>> background.
>>
>> It seems like my OUTPUTFORMAT is being ignored. I have it just at the
>> MAP level, not within the WEB section or within a LAYER definition,
>> which I believe to be correct. I am using this layer to highlight
>> selected features in an OpenLayers interface. So it lies above another
>> (background) layer and needs to be transparent so that the background
>> layer is visible. I'm pretty confident that I'm getting a PNG image,
>> because that's what FireFox tells me. I'm using MODE=MAP, but I also
>> tried MODE=BROWSE and saved the images and examined them in Photoshop.
>> When I set TRANSPARENT ON in the MAP section of my map file I get
>> what I want - a PNG in which the background is transparent, but when I
>> set FORMATOPTION "TRANSPARENT=ON" in an OUTPUTFORMAT definition, I
>> get a PHG with a non-transparent white background.
>>
>> Thanks for all of your replies,
>> Rich
>>
>>
>>
>> On Fri, Oct 16, 2009 at 3:17 PM, Stephen Woodbridge
>> <woodbri at swoodbridge.com> wrote:
>>>
>>> Richard,
>>>
>>> Try:
>>>
>>> FORMATOPTION "TRANSPARENT=ON"
>>>
>>> -Steve W
>>>
>>> Richard Greenwood wrote:
>>>>
>>>> I have been using TRANSPARENT ON in the MAP section of my map file,
>>>> but the documentation says that is deprecated and to use the
>>>> FORMATOPTION. I'm trying to do this, but not getting transparent
>>>> images back. I am creating PNG images with MapServer 5.4.2. My output
>>>> format is as follows:
>>>>
>>>> OUTPUTFORMAT
>>>> NAME png
>>>> DRIVER "GD/PNG"
>>>> MIMETYPE "image/png"
>>>> IMAGEMODE PC256
>>>> EXTENSION "png"
>>>> FORMATOPTION "TRANSPARENT ON"
>>>> END
>>>>
>>>> What am I missing?
>>>>
>>>> Thanks,
>>>
>>
>>
>>
>
>
--
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com
More information about the MapServer-users
mailing list