[mapserver-users] Using classes to set the color of a shape

Daniel Morissette morissette at dmsolutions.ca
Tue Aug 21 07:15:29 PDT 2001


"Vinko Vrsalovic B." wrote:
> 
> for ($i=0; $i<7 && (user said yes to i); $i++) {
>         $shape[i]->draw($map,$layer_lines,$image,$i,"");
> }
> 
> I was hoping for the $i parameter of the draw shape method to set
> the class on $layer_lines, but they all are drawn on class 0.
> 

OOppps... there's an error in the docs.  In MS 3.5 the shape->draw()
method doesn't take the class index argument any more.  The docs should
say:
   int draw(mapObj map, layerObj layer, imageObj img)

(and same thing with rectObj->draw()), etc.)

I've filed this as a doc bug in bugzilla to make sure it gets fixed:
http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=36

OK, so how does it work then?  In MS3.5 the shapeObj has a new class
member called "classindex" ... so I would think that calling 
$shape->set("classindex", $i); before calling draw() should work,
but I haven't tested that myself...

Oh... wait... shapeObj doesn't have a set() method because all its
member used to be read-only... so I think you're stuck until we fix
this, hopefully in the next week or so.  It's filed in bugzilla as well:
http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=37

BTW, thanks for taking time to write a complete description of the
problem!
-- 
------------------------------------------------------------
 Daniel Morissette               morissette at 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.




More information about the MapServer-users mailing list