[mapserver-users] set color doesn't work in class obj

Pushkar Pradhan pushkar at ERC.MsState.Edu
Mon Jun 10 14:36:44 EDT 2002


hi,
I'm trying to set the color for each class in php mapscript.
This is the code:
... unnecessary code removed
   $tmp = $map->getLayerByName($layer[$l]);
   if ($tmp->status ==  0) {
      $tmp->set("status", "1");
   }
   $tmp->getMetaData("Colors");
   for($c = 0; $c < count($tmp->numclasses); $c++) {
      $cl = $tmp->getClass($c);
      $cl->set("color", "30 10 255");
      echo $cl->color;
   }

I got my browser to echo out some other properties of the class obj. but
the color isn't set, looked up the archives same ques. was posted by Vinko
but didn't see any reply.
It just echoes the first no. 30 but in the map nothing is colored.
Anyone knows the ans. please reply.

-Pushkar S. Pradhan




More information about the mapserver-users mailing list