Change Text of Feature Object/Inline Feature

ClackJim jimlug at CO.CLACKAMAS.OR.US
Thu Aug 16 11:16:28 EDT 2007


Aloha folks,

I am trying to change the text of a so-called Feature Object using
MapScript.  When I have the code within the MapFile, everything works just
fine.  However, when I try to use MapScript I am unable to change the text. 
I've tried several different techniques and searched all over for the
answer.  Attached is a sample of my code within my MapFile:

#---Copyright---#
LAYER
  NAME copyright
  STATUS ON
  TYPE annotation
  TRANSFORM false
  FEATURE
    POINTS
      70 535
    END
    TEXT "© Clackamas County 2006"
  END
  CLASS
    LABEL
      FONT arial
      TYPE TRUETYPE
      SIZE 8
      BUFFER 1
      COLOR 0 0 0
      BACKGROUNDCOLOR 255 255 255
      FORCE TRUE
    END
  END
END

$coLyr = $map->getLayerByName('copyright');
$coShp =$coLyr->getShape(-1,0);
$coText = $coShp->text;
echo $coText . "</br>";
$coNewText = "&copy;" . "Clackamas County 2006 - Aerial 2005" ;
$coShp->set('text',$coNewText); $coText = $coShp->text; echo "New text is "
. $coText;

I thought this should work since I am verifying the new text with the second
echo.  Does anyone have any suggestion?

-- 
View this message in context: http://www.nabble.com/Change-Text-of-Feature-Object-Inline-Feature-tf4280302.html#a12183304
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the mapserver-users mailing list