<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2657.73">
<TITLE>RE: RE: Dynamic Maptitle</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>List,</FONT>
</P>
<P><FONT SIZE=2>With the help of Martin Meirink (Thank you, Martin) I've got what I needed. The solution is somewhat different then Sefanie's solution:</FONT></P>
<P><FONT SIZE=2>In the mapfile add an empty feature layer:</FONT>
</P>
<P><FONT SIZE=2>----------------Begin part of mapfile ----------------------------</FONT>
<BR><FONT SIZE=2>LAYER</FONT>
<BR><FONT SIZE=2> NAME titel</FONT>
<BR><FONT SIZE=2> STATUS DEFAULT</FONT>
<BR><FONT SIZE=2> TRANSFORM FALSE</FONT>
<BR><FONT SIZE=2> TYPE ANNOTATION</FONT>
<BR><FONT SIZE=2> CLASS</FONT>
<BR><FONT SIZE=2> LABEL</FONT>
<BR><FONT SIZE=2> TYPE TRUETYPE</FONT>
<BR><FONT SIZE=2> FONT "arial"</FONT>
<BR><FONT SIZE=2> SIZE 11</FONT>
<BR><FONT SIZE=2> ANTIALIAS TRUE</FONT>
<BR><FONT SIZE=2> COLOR 0 0 0</FONT>
<BR><FONT SIZE=2> backgroundcolor 255 204 204 </FONT>
<BR><FONT SIZE=2> backgroundshadowcolor 255 153 204 </FONT>
<BR><FONT SIZE=2> backgroundshadowsize 5 3 </FONT>
<BR><FONT SIZE=2> END</FONT>
<BR><FONT SIZE=2> END</FONT>
<BR><FONT SIZE=2>END</FONT>
</P>
<P><FONT SIZE=2>----------------End part of mapfile ----------------------------</FONT>
</P>
<P><FONT SIZE=2>In the url you can add:</FONT>
<BR><FONT SIZE=2> &map_titel_feature=new</FONT>
<BR><FONT SIZE=2>To create a new feature</FONT>
</P>
<P><FONT SIZE=2>Also add:</FONT>
<BR><FONT SIZE=2> &map_titel_feature_points=360+8</FONT>
<BR><FONT SIZE=2>To place a (label) point in the new feature</FONT>
</P>
<P><FONT SIZE=2>Last but not least add:</FONT>
<BR><FONT SIZE=2> &map_titel_feature_text=+your+title+here+++</FONT>
<BR><FONT SIZE=2>To add the title</FONT>
</P>
<P><FONT SIZE=2>In the last part, one can also use parameters which was what we needed</FONT>
<BR><FONT SIZE=2>In the mapfile you can define the label settings like color, etc.</FONT>
</P>
<BR>
<P><FONT SIZE=2>Gerjan</FONT>
</P>
<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Stefanie Weykam [<A HREF="mailto:sweykam@teleline.es">mailto:sweykam@teleline.es</A>]</FONT>
<BR><FONT SIZE=2>Sent: 26 juli 2005 16:34</FONT>
<BR><FONT SIZE=2>To: UMN MapServer Users List</FONT>
<BR><FONT SIZE=2>Cc: Gerjan Walrecht</FONT>
<BR><FONT SIZE=2>Subject: [SPAM: 8.0/6.0] RE: Dynamic Maptitle</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=2>Gerjan, </FONT>
<BR><FONT SIZE=2>Here comes an extract of my function. I took the database query part and some other conditions out, so things get hopefully clearer. </FONT></P>
<P><FONT SIZE=2>I don't remember why I had to create a line object, but it works. Don't forget to draw the map after you modified the layer.</FONT></P>
<P><FONT SIZE=2>You can see how it works here:</FONT>
<BR><FONT SIZE=2><A HREF="http://www.vertebradosibericos.org/aves/atlas/presentacion.html" TARGET="_blank">http://www.vertebradosibericos.org/aves/atlas/presentacion.html</A></FONT>
<BR><FONT SIZE=2>(click on 'mapas de distribuciĆ³n...') </FONT>
<BR><FONT SIZE=2>good luck!</FONT>
<BR><FONT SIZE=2>Stefanie</FONT>
</P>
<P><FONT SIZE=2>###### change the map title #######</FONT>
</P>
<P><FONT SIZE=2># not shown here:</FONT>
<BR><FONT SIZE=2># establish conection to the database to get the new parameter for the title </FONT>
<BR><FONT SIZE=2># query result returns an array; $arrayVal[0] is the scientific name of the </FONT>
<BR><FONT SIZE=2># species I am looking for (is 'year' for you)</FONT>
<BR><FONT SIZE=2># $specname=$arrayVal[0]</FONT>
</P>
<BR>
<P><FONT SIZE=2># get layer parameters from map file</FONT>
<BR><FONT SIZE=2> $subtitESP=$map->getLayerByName('subtitESP');</FONT>
</P>
<P><FONT SIZE=2># create class object using the existing class parameters </FONT>
<BR><FONT SIZE=2> $oClass=$subtitESP->getClass(0); </FONT>
<BR><FONT SIZE=2># ..and set label font and size (only if you wish to change them) </FONT>
<BR><FONT SIZE=2> $oClass->label->set('font', 'verdana-italic'); </FONT>
</P>
<P><FONT SIZE=2># create a point and a line object (line object will have only one point here)</FONT>
<BR><FONT SIZE=2> $oP=ms_newPointObj(); </FONT>
<BR><FONT SIZE=2> $oL=ms_newLineObj();</FONT>
<BR><FONT SIZE=2># create shape object</FONT>
<BR><FONT SIZE=2> $shape=ms_newShapeObj(MS_SHAPE_POINT); </FONT>
</P>
<P><FONT SIZE=2># set coords of the point and add it to the line, then add line to the shape-object</FONT>
<BR><FONT SIZE=2> $oP->setXY(352,5); </FONT>
<BR><FONT SIZE=2> $oL->add($oP);</FONT>
<BR><FONT SIZE=2> $shape->add($oL);</FONT>
</P>
<P><FONT SIZE=2># asign the new name (year in your case)</FONT>
<BR><FONT SIZE=2> $shape->set('text', $specname);</FONT>
</P>
<P><FONT SIZE=2># add the layer feature to the shape, switch layer on and draw it</FONT>
<BR><FONT SIZE=2> $subtitESP->addFeature($shape);</FONT>
<BR><FONT SIZE=2> $subtitESP->set('status', 1);</FONT>
<BR><FONT SIZE=2> $img=$map->draw(); </FONT>
<BR><FONT SIZE=2> $subtitESP->draw($img);</FONT>
</P>
</BODY>
</HTML>