Personal tools
You are here: Home Documentation References PHP/Mapscript Class Reference Classes LabelObj Class

4.7. LabelObj Class

Document Actions
Up one level
Constructor, members, and methods.
  • Constant names and class member variable names are case-sensitive in PHP.
  • Several MapScript functions (all those that access files in the back end such as ms_newMapObj(), drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP environment. This will be fixed eventually but in the meantime you should be careful about these side-effects.
Constructor:

  LabelObj are always embedded inside other classes.

Members:

  string font
  int    type
  colorObj    color
  colorObj    outlinecolor
  colorObj    shadowcolor
  int    shadowsizex
  int    shadowsizey
  colorObj    backgroundcolor
  colorObj    backgroundshadowcolor
  int    backgroundshadowsizex
  int    backgroundshadowsizey
  int    size
  int    minsize
  int    maxsize
  int    position
  int    offsetx
  int    offsety
  double angle
  int    autoangle
  int    buffer
  int    antialias
  int    wrap
  int    minfeaturesize
  int    autominfeaturesize
  int    mindistance
  int    partials
  int    force
  string encoding

Methods:

  int set(string property_name, new_value)
       Set object property to a new value. Returns -1 on error.

  int setBinding(const labelbinding, string value)
      Set the attribute binding for a specfiled label property. Returns true on success.

       Example:
          $oLabel->setbinding(MS_LABEL_BINDING_COLOR, "FIELD_NAME_COLOR");
          This would bind the color parameter with the data (ie will extract
          the value of the color from the field called "FIELD_NAME_COLOR"
  
  int removeBinding(const labelbinding)
       Remove the attribute binding for a specfiled style property. Returns true on success.  
       Example:
          $oStyle->removebinding(MS_LABEL_BINDING_COLOR);    
by Jeff McKenna last modified 2008-07-15 10:06

Powered by Plone