[mapserver-users] A problem about setting transparent raster layer.

thomas bonfort thomas.bonfort at gmail.com
Thu Jul 18 02:54:02 PDT 2013


(please keep your messages on the list)

change pc256 to rgba in your mapfile.

add format:"image/png" to your openlayers options (same level as
alpha:true, which is not needed).

That said, there still very well could be a bug in the raster
classification code as opacity wasn't a first class citizen back in
the GD days....

as for client side opacity: add opacity:0.5 to your javascript (same
level as isBaseLayer)

--
thomas

On 18 July 2013 11:46, Guo YU <yuguo365 at gmail.com> wrote:
> Dear Thomas,
>       Thanks for your reply.
>       The mapserver I am using is from MS4W, so it is MS4W Setup Installer
> v3.0.6 (May 26, 2012).
>        What Do you mean by use opacity at the client level? Where should I
> set it?
>        I changed the driver from GD to AGG, but nothing changed.
>
> OUTPUTFORMAT
>     NAME "png"
>     MIMETYPE "image/png"
>     DRIVER "AGG/PNG"
>     EXTENSION "png"
>     IMAGEMODE "PC256"
>     TRANSPARENT on
>   END
>
>
> On Thu, Jul 18, 2013 at 10:38 AM, thomas bonfort <thomas.bonfort at gmail.com>
> wrote:
>>
>> Guo,
>>
>> Why not use opacity at the client level only ?
>> That said, this does seem like a bug. Can you specify which mapserver
>> version you are using, and which outputformat your are using (and if
>> you are using a GD one, try switching to AGG).
>>
>> --
>> thomas
>>
>>
>> On 18 July 2013 11:28, Guo YU <yuguo365 at gmail.com> wrote:
>> >
>> > Dear All,
>> >       Since I need to show the code and figures about my problem, I post
>> > it
>> > on the Stack Exchange.
>> > I got problem with Setting a Transparent Raster Layer and then show this
>> > layer though OpenLayer.
>> >
>> > Here is the link :
>> >
>> > http://gis.stackexchange.com/questions/66388/how-to-make-a-raster-layer-transparent-via-mapserver
>> >
>> > Thanks for your time.
>> > --
>> > YU Guo
>> > MSc. Hydroinformatics and Water Management
>> > Email: yuguo365 at gmail.com
>> > Phone: +33 668 195803
>> >
>> >
>> >
>> >
>> > _______________________________________________
>> > mapserver-users mailing list
>> > mapserver-users at lists.osgeo.org
>> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
>> >
>
>
>
>
> --
> YU Guo
> MSc. Hydroinformatics and Water Management
> Email: yuguo365 at gmail.com
> Phone: +33 668 195803
>
>
>



More information about the MapServer-users mailing list