[mapserver-users] How to give angle to labels with mapserver mapscript 5.0 and OGR:LabelAngle

Daniel Morissette dmorissette at mapgears.com
Wed Mar 12 13:54:26 PDT 2008


Yvan Calcagni wrote:
> Hi everybody,
> 
> I have upgraded mapserver mapscript from 4.8 to 5.0 and I'm trying to render an annotation layer (with OGR connection) with angles. With the 4.8, I was using class->set("anglelabelitem","OGR:LabelAngle"), because angles are embedded in the layer. So now, as anglelabelitem doesn't exist anymore, I'm trying to use class->label->set("angle","OGR:LabelAngle") but it gives me no result. It doesn't produce errors but label aren't oriented.
> 
> If anyone have an idea...
> 

In 5.0 we added the concept of attribute binding for some label and 
style properties, and that includes the label angle. See:
http://trac.osgeo.org/mapserver/browser/branches/branch-5-0/mapserver/MIGRATION_GUIDE.TXT

In PHP MapScript you should be able to use:

   $label->setBinding(MS_LABEL_BINDING_ANGLE, "OGR:LabelAngle");

Daniel
-- 
Daniel Morissette
http://www.mapgears.com/



More information about the MapServer-users mailing list