Problems with Dynamic Layer and Transparency

Ian Erickson ierickson at ANALYGIS.COM
Wed Dec 1 11:49:06 EST 2004


I must be doing something wrong (MapServer 4.2.5, PHP 4, Apache 2,
Windows 2000 Pro) .  I've been able to create a dynamic layer, add
points to this layer and set the color and symbol styles for all
objects.  What I have not been able to do is set the transparency for
the layer.  If I manually set the transparency for any layer in my .MAP
file, I have no problem, but I've tried a number of different ways, all
with no success.

This is what I'm doing:

$daLayer = ms_newLayerObj($map);

$daLayer->set("type", MS_LAYER_POINT);
$daLayer->setProjection("init=epsg:4326");
$daLayer->set("status",  MS_ON);

//Setting this property seems to have absolutely no effect...WHY?
$daLayer->set("transparency", 40);

//Alternatively, I've tried the following with the no results...
$daLayer->transparency = 40;

$class = ms_newClassObj($daLayer);
$class->label->color->setRGB(0,0,0);
$class->label->outlinecolor->setRGB(255,255,255);
$class->label->set("type", MS_TRUETYPE);
$class->label->set("size", 7);
$class->label->set("font", "arial-bold");
$class->label->set("position", MS_UR);
$style = ms_newStyleObj($class);
$style->color->setRGB(128,0,0);
$style->outlinecolor->setRGB(255,255,255);
$style->set("symbolname", "circle");
$style->set("size", 12);

$point = ms_newPointObj();
$point->setXY(-122.0, 38.0);

$lineObj = ms_newLineObj();
$lineObj->add($point);

$shapeObj = ms_newShapeObj(MS_SHAPE_POINT);
$shapeObj->add($lineObj);

$shapeObj->set("text", "MY LABEL");
$daLayer->addFeature($shapeObj);

$point->draw($map, $daLayer, $mapimage, 0, "MY LABEL");

$shapeObj->free();
$lineObj->free();
$point->free();

Any help would be most appreciated!

--
Ian Erickson
AnalyGIS, LLC
Gold Canyon, AZ  85218
http://www.analygis.com/



More information about the mapserver-users mailing list