Re: [mapserver-users] PHP/Mapscript CLASS TEXT

2009-06-29 Thread Charlotte Declercq

Daniel Morissette a écrit :

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

Thanks a lot,
$class-setText(([FIELD_NAME]));
is working !

--
Charlotte DECLERCQ

ALKANTE SAS
Ingénieur RD SIG
1, rue du Chêne Morand
35 510 Cesson-Sévigné
Bur: + 33 (0) 2 99 22 25 70
fax : + 33 (0) 2 99 32 12 76



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] PHP/Mapscript CLASS TEXT

2009-06-26 Thread Charlotte Declercq

Hello

I have an annotation layer on which I want to be able to draw labels.

Here is the layer :

LAYER
   CLASSITEM Id_BDCarto
   CONNECTION Limites_administratives/Departement.TAB
   CONNECTIONTYPE OGR
   LABELITEM Nom_Département
   LABELMAXSCALEDENOM 1e+07
   LABELMINSCALEDENOM 1990
   METADATA
 LAYER_TITLEdepartement
 GI_ARBO_ORDRE1
 TYPE_SYMBOPROPORTIONAL
 ECHELLE_LEGENDEON
 CLASS_LEGENDEON
   END
   NAME layer2
   STATUS ON
   SYMBOLSCALEDENOM 312411
   TYPE ANNOTATION
   UNITS METERS
   CLASS
 NAME departement
 LABEL
   ANGLE 0.00
   ANTIALIAS TRUE
   FONT Arial
   MAXSIZE 256
   MINSIZE 4
   SIZE 8
   TYPE TRUETYPE
   BUFFER 0
   COLOR 0 0 0
   FORCE FALSE
   MINDISTANCE -1
   MINFEATURESIZE -1
   OFFSET 1 1
   PARTIALS TRUE
   POSITION CC
   SHADOWCOLOR 0 0 0
   SHADOWSIZE 0 0
 END
 STYLE
   ANGLE 360
   COLOR 232 246 9
   OPACITY 100
   SIZE [Id_BDCarto]
   SYMBOL Carre
 END
 TEXT  
   END
 END


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 ?
- to set the TEXT property with the attribute ?

Thanks,

--
Charlotte DECLERCQ

ALKANTE SAS
Ingénieur RD SIG
1, rue du Chêne Morand
35 510 Cesson-Sévigné
Bur: + 33 (0) 2 99 22 25 70
fax : + 33 (0) 2 99 32 12 76



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] PHP/Mapscript CLASS TEXT

2009-06-26 Thread Daniel Morissette

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/
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users