dynamic annotation

Oliver Lichte lichte at ICBM.DE
Fri Feb 3 06:29:52 EST 2006


Hi,

try something like this:

where, $map:mapObj

  ...
$lay = $map->getLayerByName( "NICHEAD2" );

$cls = $lay->getClass(0); // works only if the class is the first defined
$cls->setText( "Your new text" );
...

You may get problems with the alignment of the text in the image but other 
attributes of the classObj can be changed similar.


Cheers,
Oliver


Am Freitag, 3. Februar 2006 09:08 schrieb N Dhanasekar:
> hi to all
>
>   i am trying to generate online map as per user requirement, so i want put
> a dynamic annotation layer on map. i am using php_mapscript4.2, any one can
> help me how to add a dynamic annotation layer or change the text string in
> my annotation layer dynamically
>
>   my .map contain a annotation layer like this
>   LAYER
>   NAME "NICHEAD2"
>   STATUS ON
>   TRANSFORM FALSE
>   TYPE ANNOTATION
>       FEATURE
>      # POINTS 0.045164250 0.030654
>      POINTS 300 50
>           END
>   END
>   CLASS
>    TEXT "Severe Mal-Nourished Children"
>     LABEL
>       TYPE TRUETYPE
>       FONT arial-bold
>       SIZE 15
>       ANTIALIAS TRUE
>             COLOR 255 204 0
>      POSITION UR
>       FORCE TRUE
>     END
>   END
> END
>
>   i want to chage the text dynamically
>   thanks
>
>   nds
>
>
>
> ---------------------------------
> Brings words and photos together (easily) with
>  PhotoMail  - it's free and works with Yahoo! Mail.

-- 
Junior Research Group IMPULSE 
ICBM * Carl-v.-Ossietzky University of Oldenburg
PO-Box 2503 * 26111 Oldenburg - Germany - http://www.icbm.de/impulse
room: W15-2-239 * fon:+49-441-798-3622 * fax:+49-441-798-3404 



More information about the mapserver-users mailing list