[mapserver-users] PHP/Mapscript CLASS TEXT
Daniel Morissette
dmorissette at mapgears.com
Fri Jun 26 13:19:45 PDT 2009
Charlotte Declercq wrote:
>
> With TEXT = " ", the layer is drawn without the labels. If TEXT property
> is present, I am unable to draw the labels,
> because I can't remove the TEXT property and I can't find a way to write
> TEXT [attribute_name] with mapscript (do the binding as for example
> $oStyle->setbinding(MS_STYLE_BINDING_SIZE, "FIELD_NAME")).
>
> Anyone has solution :
> - to remove the TEXT property ?
I don't think there is a way to remove the text property with the
current version. Could you please file a ticket and we'll try to fix
that in the next release? It will likely be done by calling
$class->setText(null)
> - to set the TEXT property with the attribute ?
>
The following should work:
$class->setText("([FIELD_NAME])");
Okay, I'll admit that was not obvious. The TEXT parameter works
differently from regular attribute binding. It actually goes through the
logical expression parser, that's why there is a special setTExt()
method and the round brackets are required.
Daniel
--
Daniel Morissette
http://www.mapgears.com/
More information about the MapServer-users
mailing list