Hello people,
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:
I want to add $v as a label to my classes.
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.
For instance something like:
$theme_label[$i]->set("labeltext", $v);
foreach ($mycollection as $k=>$v) {
$theme_class[$i]=ms_newClassObj($theme_layer);
$theme_class[$i]->setExpression($k);
$theme_class[$i]->set("name",
$theme_class[$i]->getExpressionString());
$theme_style[$i]=ms_newStyleObj($theme_class[$i]);
$tc = $theme->getColourValue($v);
$theme_style[$i]->color->setRGB($tc[0],$tc[1],$tc[2]);
$theme_style[$i]->outlinecolor->setRGB(255,255,255);
//$theme_label[$i]=ms_newLabelObj($theme_class[$i]);
//$theme_label[$i]->set("font", "sans");
//$theme_label[$i]->set("type", "truetype");
//$theme_label[$i]->set("size", 10);
//$theme_label[$i]->set("labeltext", $v);
$i++;
}
_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users