<!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>&nbsp; NAME titel</FONT>
<BR><FONT SIZE=2>&nbsp; STATUS DEFAULT</FONT>
<BR><FONT SIZE=2>&nbsp; TRANSFORM FALSE</FONT>
<BR><FONT SIZE=2>&nbsp; TYPE ANNOTATION</FONT>
<BR><FONT SIZE=2>&nbsp; CLASS</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; LABEL</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; TYPE TRUETYPE</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; FONT &quot;arial&quot;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; SIZE 11</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; ANTIALIAS TRUE</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; COLOR 0 0 0</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; backgroundcolor 255 204 204 </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; backgroundshadowcolor 255 153 204 </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; backgroundshadowsize 5 3&nbsp; </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; END</FONT>
<BR><FONT SIZE=2>&nbsp; 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>&nbsp; &amp;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>&nbsp; &amp;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>&nbsp; &amp;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>&nbsp;&nbsp; $subtitESP=$map-&gt;getLayerByName('subtitESP');</FONT>
</P>

<P><FONT SIZE=2># create class object using the existing class parameters </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; $oClass=$subtitESP-&gt;getClass(0);&nbsp; </FONT>
<BR><FONT SIZE=2># ..and set label font and size (only if you wish to change them)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; $oClass-&gt;label-&gt;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>&nbsp;&nbsp; $oP=ms_newPointObj();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; $oL=ms_newLineObj();</FONT>
<BR><FONT SIZE=2># create shape object</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; $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>&nbsp;&nbsp; $oP-&gt;setXY(352,5);&nbsp; </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; $oL-&gt;add($oP);</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; $shape-&gt;add($oL);</FONT>
</P>

<P><FONT SIZE=2># asign the new name (year in your case)</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; $shape-&gt;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>&nbsp;&nbsp; $subtitESP-&gt;addFeature($shape);</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; $subtitESP-&gt;set('status', 1);</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; $img=$map-&gt;draw();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; $subtitESP-&gt;draw($img);</FONT>
</P>

</BODY>
</HTML>