unable to change the layer font

krishna S kris_rock82 at YAHOO.COM
Tue Jan 24 12:47:41 PST 2006


Hello all, i am using php mapscript to label the layer on a map, i am able
to set it from the mapfile but when i do it from the php mapscript file it
doesnt change the font and the font size, heres how the php mapscript looks
like

$map = ms_newMapObj($map_path."states.map");

$layername = $map->getLayerByName("states");
$layername->set("labelitem","cty_county");
$class = $layername->getClass(0);
$style = ms_newStyleObj($class);
$style->backgroundcolor->setRGB(255,255,255);
$style->color->setRGB(100,220,220);
$style->outlinecolor->setRGB(100,0,0);

$class1 = ms_newClassObj($layername);
$class1->label->set("font","verdana");
$class1->label->set("size","tiny");

Even though i comment the font and size attributes in the mapfile, it shows
me the default output but not the changes that i want with the font and the
font size.

Any suggestions please ...

--kris



More information about the MapServer-users mailing list