[mapserver-users] can't set class obj's color in php
Pushkar Pradhan
pushkar at ERC.MsState.Edu
Mon Jun 10 20:17:45 PDT 2002
I am stuck, not able to set a class obj's color in mapscript,
code:
for($c = 0; $c < count($tmp->numclasses); $c++) {
echo "class index $c";
$cl1 = $tmp->getClass($c);
$cl1->set("color", "255 0 0");
}
relevant portion of .map file:
LAYER ....
....
CLASSITEM 'Total'
CLASS
EXPRESSION ([Total] GT 40000)
NAME "Biloxi"
OUTLINECOLOR 128 128 128
COLOR 255 0 15
END
CLASS
EXPRESSION ([Total] LE 40000)
NAME "Picayune"
OUTLINECOLOR 128 128 128
COLOR 25 0 250
END
END #layer ends
I've 2 classes defin. for this layer, when I do echo statements I see
the code is executed only for the 1st class, that too unsuccessful, i.e.
neither the class appears in 255 0 15 nor in 255 0 0
while the second class Picayune displays correctly in 25 0 250 shade.
If anyone knows please reply. Thanks,
-Pushkar S. Pradhan
More information about the MapServer-users
mailing list