url = "blablabl/cgi-wms/mapserv?map=patate&randomnumber" + mt_rand() + "&"; <br><br>layer->set("connection",url)<br><br>and everything is good<br><br><br><br><div class="gmail_quote">
2011/5/19 Marc-André Trottier <span dir="ltr"><<a href="mailto:trottier.marcandre@gmail.com">trottier.marcandre@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">i'm using MapScript to create un mapObj.<br>finally a draw the image with Map->draw();<br><br>but the OPACITY is not good. Just one OPACITY, of my two layers, is set to all image<br><br>i got this for my Outputformat :<br>
<br> OUTPUTFORMAT<br> NAME "aggpng24"<br> MIMETYPE "image/png; mode=24bit"<br> DRIVER "AGG/PNG"<br> EXTENSION "png"<br></div><div class="im"><div> IMAGEMODE "RGBA"<br>
TRANSPARENT TRUE<br>
END<br><br></div></div><div class="im">i think it's good. <br>
<br></div>
if the address is not the same in the parameter CONNECTION<br>
it's all good. <br>
<br>
can i add a random number in my CONNECTION ? <br>
with the mapscript<br><font color="#888888"><br>Marc-André Trottier</font><div class="im"><br><br><br><br>2011/5/12 thomas bonfort <span dir="ltr"><<a href="mailto:thomas.bonfort@gmail.com" target="_blank">thomas.bonfort@gmail.com</a>></span><br>
</div><div><div></div><div class="h5">
Opacity is set as a single integer between 0 and 100 on the layer level.<br>
There are no limitations on setting it on multiple layers, but in that<br>
case the opacity adds up, so if you have two layers with opacity 50,<br>
the final opacity of the image ends up being 75.<br>
<br>
If your final images end up with no opacity, this could be because<br>
your are also including a layer with full opacity, or because you are<br>
using a format which does not support an alpha channel (i.e. jpeg)<br>
<br>
regards,<br>
thomas<br>
<div><div><br>
On Mon, May 9, 2011 at 19:18, Marc-André Trottier<br>
<<a href="mailto:trottier.marcandre@gmail.com" target="_blank">trottier.marcandre@gmail.com</a>> wrote:<br>
> hi!<br>
> how can i get a output with opacity on 2 or more layers.<br>
> with only 1 layer it's working fine but not with 2 or more.<br>
><br>
> How should be written OPACITY when using IMAGEMODE RGBA ? (ALPHA)<br>
> i tried something like OPACITY 22,22,22,22 but looks bad<br>
><br>
> in all my tests, all i got was my 2 layers with full opacity (100) ...<br>
><br>
> here is my mapfile :<br>
><br>
> MAP<br>
> EXTENT -8146324.306063 5632144.09953312 -8137075.425642 5638229.88815488<br>
> FONTSET "fonts"<br>
> IMAGECOLOR 255 255 255<br>
> IMAGETYPE AGGA<br>
> SIZE 732 482<br>
> STATUS ON<br>
> UNITS METERS<br>
> NAME "MS"<br>
><br>
> OUTPUTFORMAT<br>
> NAME 'AGGA'<br>
> DRIVER AGG/PNG<br>
> IMAGEMODE RGBA<br>
> TRANSPARENT TRUE<br>
> END<br>
><br>
> PROJECTION<br>
> "init=epsg:900913"<br>
> END<br>
> LEGEND<br>
> IMAGECOLOR 255 255 255<br>
> KEYSIZE 20 10<br>
> KEYSPACING 5 5<br>
> LABEL<br>
> ANGLE 0.000000<br>
> ANTIALIAS TRUE<br>
> FONT "arial"<br>
> MAXSIZE 256<br>
> MINSIZE 4<br>
> SIZE 10<br>
> TYPE TRUETYPE<br>
> BUFFER 0<br>
> COLOR 255 255 255<br>
> FORCE FALSE<br>
> MINDISTANCE -1<br>
> MINFEATURESIZE -1<br>
> OFFSET 0 0<br>
> PARTIALS TRUE<br>
> END<br>
> OUTLINECOLOR 0 0 0<br>
> POSITION LR<br>
> POSTLABELCACHE TRUE<br>
> STATUS EMBED<br>
> TRANSPARENT FALSE<br>
> END<br>
><br>
> QUERYMAP<br>
> COLOR 255 255 0<br>
> SIZE -1 -1<br>
> STATUS OFF<br>
> STYLE HILITE<br>
> END<br>
><br>
> SCALEBAR<br>
> ALIGN CENTER<br>
> COLOR 0 0 0<br>
> IMAGECOLOR 255 255 255<br>
> INTERVALS 4<br>
> LABEL<br>
> SIZE MEDIUM<br>
> TYPE BITMAP<br>
> BUFFER 0<br>
> COLOR 0 0 0<br>
> FORCE FALSE<br>
> MINDISTANCE -1<br>
> MINFEATURESIZE -1<br>
> OFFSET 0 0<br>
> PARTIALS TRUE<br>
> POSITION CR<br>
> END<br>
> OUTLINECOLOR 0 0 0<br>
> POSITION LL<br>
> SIZE 200 3<br>
> STATUS EMBED<br>
> STYLE 0<br>
> UNITS METERS<br>
> END<br>
><br>
> WEB<br>
> IMAGEPATH "path"<br>
> IMAGEURL ""<br>
> QUERYFORMAT text/html<br>
> LEGENDFORMAT text/html<br>
> BROWSEFORMAT text/html<br>
> END<br>
><br>
> LAYER<br>
> CONNECTION "PATATE3"<br>
> CONNECTIONTYPE WMS<br>
> DEBUG 5<br>
> METADATA<br>
> "wms_srs" "EPSG:900913"<br>
> "wms_name" "PATATE3"<br>
> "wms_format" "image/png"<br>
> "wms_server_version" "1.1.1"<br>
> END<br>
> NAME "Carte"<br>
> PROCESSING "CLOSE_CONNECTION=NORMAL"<br>
> PROJECTION<br>
> "init=epsg:900913"<br>
> END<br>
> STATUS ON<br>
> TRANSFORM FALSE<br>
> TYPE RASTER<br>
> UNITS METERS<br>
> END<br>
><br>
> LAYER<br>
> CONNECTION "PATATE2"<br>
> CONNECTIONTYPE WMS<br>
> DEBUG 5<br>
> METADATA<br>
> "wms_srs" "EPSG:900913"<br>
> "opacity" "100"<br>
> "wms_name" "PATATE2"<br>
> "wms_format" "image/png"<br>
> "wms_server_version" "1.1.1"<br>
> END<br>
> NAME "PATATE2"<br>
> PROCESSING "CLOSE_CONNECTION=NORMAL"<br>
> PROJECTION<br>
> "init=epsg:900913"<br>
> END<br>
> STATUS ON<br>
> TRANSFORM FALSE<br>
> TYPE RASTER<br>
> UNITS METERS<br>
> END<br>
><br>
> LAYER<br>
> CONNECTION "PATATE"<br>
> CONNECTIONTYPE WMS<br>
> DEBUG 5<br>
> METADATA<br>
> "wms_srs" "EPSG:900913"<br>
> "opacity" "40"<br>
> "wms_name" "PATATE"<br>
> "wms_format" "image/png"<br>
> "wms_server_version" "1.1.1"<br>
> END<br>
> NAME "PATATE"<br>
> PROJECTION<br>
> "init=epsg:900913"<br>
> END<br>
> STATUS ON<br>
> OPACITY 40<br>
> TYPE RASTER<br>
> UNITS METERS<br>
> END<br>
><br>
> END<br>
><br>
><br>
</div></div>> ______________________________<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">_________________<br>
> mapserver-users mailing list<br>
> <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">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>
></blockquote><br>
</div></div></blockquote></div><br>