transparency not working in dynamic layer

Mark Phillips mbp at GEOMTECH.COM
Mon Jul 4 20:28:38 EDT 2005


Hi,

I'm using Perl mapscript to manually draw a rectangle on a map.  I'd
like the rectangle to be transparent, so I'm drawing it in a layer
that is already defined in the mapfile as follows:

    LAYER
      NAME         RECT
      STATUS       ON
      TYPE         POLYGON
      TRANSPARENCY 50
      CLASS
        COLOR         210 210 150
        OUTLINECOLOR  0   0 0
      END
    END

The rectangle always comes out opaque, though.  Here's the relevant part
of my perl script:

    $map = new mapscript::mapObj( ... );
    ...
    $img = $map->draw();
    ...
    $layerobj = $map->getLayerByName('RECT');
    $layerobj->{status} = 1;
    $rectobj = new mapscript::rectObj();
    $rectobj->{minx} = -82.331429;
    $rectobj->{maxx} = -82.323929;
    $rectobj->{miny} =  35.508876;
    $rectobj->{maxy} =  35.516376;
    $rectobj->draw($map, $layerobj, $img, undef, "");
    ...
    $img->save($filename);

Does anyone know what I'm doing wrong?  I've seen references to similar problems
with transparency in dynamic layers in the list archives, but I haven't seen
a resolution.

Thanks for any help,

--Mark

Mark Phillips @ Geometry Technologies LLC
77 Owenby Cove Road
Fairview, NC  28730
Phone: 828-628-0489
mbp at geomtech.com       http://www.geomtech.com



More information about the mapserver-users mailing list