<div dir="ltr"><div><div>Thanks Thomas, <br></div>    Set the Opacity on the Openlayer level works. <br></div>    But on the Mapserver side, those changes still doesn't work. Anyway, the problem is solved. Thanks. <br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jul 18, 2013 at 10:54 AM, thomas bonfort <span dir="ltr"><<a href="mailto:thomas.bonfort@gmail.com" target="_blank">thomas.bonfort@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">(please keep your messages on the list)<br>
<br>
change pc256 to rgba in your mapfile.<br>
<br>
add format:"image/png" to your openlayers options (same level as<br>
alpha:true, which is not needed).<br>
<br>
That said, there still very well could be a bug in the raster<br>
classification code as opacity wasn't a first class citizen back in<br>
the GD days....<br>
<br>
as for client side opacity: add opacity:0.5 to your javascript (same<br>
level as isBaseLayer)<br>
<br>
--<br>
thomas<br>
<div class="HOEnZb"><div class="h5"><br>
On 18 July 2013 11:46, Guo YU <<a href="mailto:yuguo365@gmail.com">yuguo365@gmail.com</a>> wrote:<br>
> Dear Thomas,<br>
>       Thanks for your reply.<br>
>       The mapserver I am using is from MS4W, so it is MS4W Setup Installer<br>
> v3.0.6 (May 26, 2012).<br>
>        What Do you mean by use opacity at the client level? Where should I<br>
> set it?<br>
>        I changed the driver from GD to AGG, but nothing changed.<br>
><br>
> OUTPUTFORMAT<br>
>     NAME "png"<br>
>     MIMETYPE "image/png"<br>
>     DRIVER "AGG/PNG"<br>
>     EXTENSION "png"<br>
>     IMAGEMODE "PC256"<br>
>     TRANSPARENT on<br>
>   END<br>
><br>
><br>
> On Thu, Jul 18, 2013 at 10:38 AM, thomas bonfort <<a href="mailto:thomas.bonfort@gmail.com">thomas.bonfort@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Guo,<br>
>><br>
>> Why not use opacity at the client level only ?<br>
>> That said, this does seem like a bug. Can you specify which mapserver<br>
>> version you are using, and which outputformat your are using (and if<br>
>> you are using a GD one, try switching to AGG).<br>
>><br>
>> --<br>
>> thomas<br>
>><br>
>><br>
>> On 18 July 2013 11:28, Guo YU <<a href="mailto:yuguo365@gmail.com">yuguo365@gmail.com</a>> wrote:<br>
>> ><br>
>> > Dear All,<br>
>> >       Since I need to show the code and figures about my problem, I post<br>
>> > it<br>
>> > on the Stack Exchange.<br>
>> > I got problem with Setting a Transparent Raster Layer and then show this<br>
>> > layer though OpenLayer.<br>
>> ><br>
>> > Here is the link :<br>
>> ><br>
>> > <a href="http://gis.stackexchange.com/questions/66388/how-to-make-a-raster-layer-transparent-via-mapserver" target="_blank">http://gis.stackexchange.com/questions/66388/how-to-make-a-raster-layer-transparent-via-mapserver</a><br>

>> ><br>
>> > Thanks for your time.<br>
>> > --<br>
>> > YU Guo<br>
>> > MSc. Hydroinformatics and Water Management<br>
>> > Email: <a href="mailto:yuguo365@gmail.com">yuguo365@gmail.com</a><br>
>> > Phone: <a href="tel:%2B33%20668%20195803" value="+33668195803">+33 668 195803</a><br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> > _______________________________________________<br>
>> > mapserver-users mailing list<br>
>> > <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
>> > <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
>> ><br>
><br>
><br>
><br>
><br>
> --<br>
> YU Guo<br>
> MSc. Hydroinformatics and Water Management<br>
> Email: <a href="mailto:yuguo365@gmail.com">yuguo365@gmail.com</a><br>
> Phone: <a href="tel:%2B33%20668%20195803" value="+33668195803">+33 668 195803</a><br>
><br>
><br>
><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div>
                <div style="font-family:Tahoma;font-size:11pt;color:#0592c4"><b>YU Guo<br></b></div>
                <div style="font-family:Tahoma;font-size:8pt;color:#666666">MSc. Hydroinformatics and Water
                  Management
                  <br>
                  <b>Email</b>:<span style="color:rgb(0,0,153)"> <u><a href="mailto:yuguo365@gmail.com" target="_blank">yuguo365@gmail.com</a></u></span><br>
                  <b>Phone</b>: <a style="color:rgb(0,0,153)" value="+447413333915">+33 668 195803</a>
                </div><pre style="font-family:comic sans ms,sans-serif" cols="72"><br></pre><br></div>
</div>