Problems with Dynamic Layer and Transparency

Ragnvald ragnvald at MINDLAND.COM
Wed Mar 30 05:00:36 EST 2005


Hello Ian,
     I saw your request on the MAPSERVER-USERS regarding php Mapscript and
transparency. I do not have the answers for you, and truly hope you have got
some good answers from the community. That is why I am sending this mail.

I am working on a project where I need to set the transparency on a layer.
The layer is defined in the .map-file and is further manipulated through php
mapscript. It seems like it is not possible to set the transparency for the
layer. Could I instead do this on a object-level by changing this code?

        if ($instances>0) {
              $classObj = $oCurrLayer->getClass(0);
                $styleobj = $classObj->getstyle(0);

                //for less than 6 instances add brighter color
                if ($instances<6) {
                        $styleobj->color->setRGB( 200,150,150);
                }
                //more instances add darker color
                else if ($instances>=6) {
                        $styleobj->color->setRGB( 150,100,100);
                }
            // then draw the shape:
            $shapeObj->draw( $map, $oCurrLayer, $image);
        }

I already tried this:

$oCurrLayer->set("transparency", 10);

But it seems like it won't affect the transparency for this layer in
general, or for the objects subsequently drawn on the layer.

Did you get any further on this matter?


Regards,

Ragnvald Larsen
TAWIRI



More information about the mapserver-users mailing list