When drawing a shape is it supposed to use the layer transparency?
Steve Lime
steve.lime at DNR.STATE.MN.US
Fri Mar 3 14:50:25 PST 2006
Transparency is a layer-level parameter so drawing a shape directly won't work. You have
a couple of options:
- use a layer with transparency defined for drawing (this need not be the parcel layer) and add the shape to that layer, then draw
- grab a unique attribue value from the result shape and use is to set a an expression in the parcel layer to hilight the shape, that is
one class for selected features and one for everything else
- you might even be able to combine the attribute query and drawing using class expressions depending on the backend data
source
The first option is likely the fastest...
Steve
>>> "Merrett, Mike" <mike.merrett at WHITEHORSE.CA> 03/03/06 3:36 PM >>>
Hi:
I have a queryByAttributes result which gives me a shapeobj
-- if I then try to draw that shape it does draw but it
is not transparent like the layer is set to
Should it? (is this a feature or a bug)
Below is the code I am using ( assume a zoom in to show the features at
a scale which show that it isn't transparent - I cut out that part for
clarity)
$oParcelLayer = $gpoMap->getLayerByName("City Streets" );
$y = @$oParcelLayer->queryByAttributes('street_name', $the_street,
MS_SINGLE ); // assume it found one (real code has an if)
$oResult = $oParcelLayer->getResult(0 );
$oParcelLayer->open();
$oShape = $oParcelLayer->getShape($oResult->tileindex,
$oResult->shapeindex );
$img = $gpoMap->draw();
$rrr = $oShape->draw( $gpoMap, $oParcelLayer, $img);
More information about the MapServer-users
mailing list