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'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]->set("labeltext", $v);</span><br><br><br><br>foreach ($mycollection as $k=>$v) {<br> $theme_class[$i]=ms_newClassObj($theme_layer);<br>
$theme_class[$i]->setExpression($k);<br> $theme_class[$i]->set("name", $theme_class[$i]->getExpressionString());<br> $theme_style[$i]=ms_newStyleObj($theme_class[$i]);<br> $tc = $theme->getColourValue($v);<br>
$theme_style[$i]->color->setRGB($tc[0],$tc[1],$tc[2]);<br> $theme_style[$i]->outlinecolor->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]->set("font", "sans");</span><br style="background-color: rgb(255, 255, 51);"><span style="background-color: rgb(255, 255, 51);"> //$theme_label[$i]->set("type", "truetype");</span><br style="background-color: rgb(255, 255, 51);">
<span style="background-color: rgb(255, 255, 51);"> //$theme_label[$i]->set("size", 10);</span><br style="background-color: rgb(255, 255, 51);"><span style="background-color: rgb(255, 255, 51);"> //$theme_label[$i]->set("labeltext", $v);</span><br>
$i++;<br> }<br><div style="margin: 0pt;" name="sig_3ae25cf131"></div>