Hello people,<br><br>I have created a piece of mapscript that takes a key/value pair and creates class-coloring according to this. This works perfectly well except for one tiny little thing:<br><br>I want to add $v as a label to my classes.<br>

<br>My question is: Is it possible to assign static text to a label? Because if it is not; I would have to query the underlying layer for it&#39;s centroid and create a text label on top of that layer.<br><br>For instance something like:<br>

<span style="background-color: rgb(255, 255, 51);">$theme_label[$i]-&gt;set(&quot;labeltext&quot;, $v);</span><br><br><br><br>foreach ($mycollection as $k=&gt;$v) {<br>        $theme_class[$i]=ms_newClassObj($theme_layer);<br>

        $theme_class[$i]-&gt;setExpression($k);<br>        $theme_class[$i]-&gt;set(&quot;name&quot;, $theme_class[$i]-&gt;getExpressionString());<br>        $theme_style[$i]=ms_newStyleObj($theme_class[$i]);<br>        $tc = $theme-&gt;getColourValue($v);<br>

        $theme_style[$i]-&gt;color-&gt;setRGB($tc[0],$tc[1],$tc[2]);<br>        $theme_style[$i]-&gt;outlinecolor-&gt;setRGB(255,255,255);<br><span style="background-color: rgb(255, 255, 51);">        //$theme_label[$i]=ms_newLabelObj($theme_class[$i]);</span><br style="background-color: rgb(255, 255, 51);">

<span style="background-color: rgb(255, 255, 51);">        //$theme_label[$i]-&gt;set(&quot;font&quot;, &quot;sans&quot;);</span><br style="background-color: rgb(255, 255, 51);"><span style="background-color: rgb(255, 255, 51);">        //$theme_label[$i]-&gt;set(&quot;type&quot;, &quot;truetype&quot;);</span><br style="background-color: rgb(255, 255, 51);">

<span style="background-color: rgb(255, 255, 51);">        //$theme_label[$i]-&gt;set(&quot;size&quot;, 10);</span><br style="background-color: rgb(255, 255, 51);"><span style="background-color: rgb(255, 255, 51);">        //$theme_label[$i]-&gt;set(&quot;labeltext&quot;, $v);</span><br>

        $i++;<br>    }<br><div style="margin: 0pt;" name="sig_3ae25cf131"></div>