[Chameleon] Re: LayerLabel

Bart van den Eijnden BEN at Syncera-ITSolutions.NL
Tue May 17 05:01:28 EDT 2005


Hi Stephan,

first of all the widget was written by an ex-colleague of me at Geodan (a Dutch GIS company).

I think the way the widget operates is, it defines an SLD document and then applies it to the layer. So you need to adapt the SLD in order for your changes to work.

I do see font-color in there, but I don't know by head how you can change the label position using SLD.

$szLabelSLD = "<StyledLayerDescriptor version='1.0.0'><NamedLayer><Name>$szLayerName</Name><UserStyle><FeatureTypeStyle><Rule><TextSymbolizer><Label>$this->mszAttribute</Label><Font><CssParameter name='font-color'>#000000</CssParameter><CssParameter name='font-family'>$this->mszFont</CssParameter><CssParameter name='font-size'>$this->mszFontSize</CssParameter></Font></TextSymbolizer></Rule></FeatureTypeStyle></UserStyle></NamedLayer></StyledLayerDescriptor>"; 

Maybe another possibility would be to override the values after the SLD has been set on the layer:

$oAnnoLayer->applysld( $szLabelSLD , $szLayerName ); 

so perform your Mapscript code after this statement.

Hope this helps.

Best regards,
Bart

Bart van den Eijnden
Syncera-ITSolutions
Postbus 270
2600 AG  DELFT

tel.nr.: 015-7512436
email: BEN at Syncera-ITSolutions.nl




More information about the Chameleon mailing list