[mapserver-users] can't set class obj's color in php

Daniel Morissette morissette@dmsolutions.ca
Mon, 10 Jun 2002 23:30:00 -0400


Pushkar Pradhan wrote:
> 
> 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");
>    }
> 

The 'color' class member in MapScript is a color index... so try this:
   
  $cl1->set("color", $map->addColor(255, 0, 0));

-- 
------------------------------------------------------------
 Daniel Morissette               morissette@dmsolutions.ca
 DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------
  Don't put for tomorrow what you can do today, because if 
      you enjoy it today you can do it again tomorrow.