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" <[EMAIL PROTECTED]> 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);
>From the map file (relevant parts)
OUTPUTFORMAT
NAME png24
DRIVER "GD/PNG"
MIMETYPE "image/png"
IMAGEMODE rgba
EXTENSION "png"
TRANSPARENT ON
END
LAYER
NAME "City Streets"
METADATA
DESCRIPTION "City Streets"
wms_title "City_Streets"
"RESULT_FIELDS" "street_name"
END
TYPE POLYGON
CONNECTIONTYPE OGR
connection "MapInfo\Cadastre\City_Streets.TAB"
LABELITEM "street_name"
TRANSPARENCY 50
CLASS
name "City Streets"
template "dummy.html"
color 145 137 103
END
end
Thanks,
Mike Merrett