Mapscript error: Fatal error: Invalid style index - Help?

Alexandre Abramides alexandre at ACQUASOFTWARE.COM.BR
Tue Aug 1 11:03:24 EDT 2006


Can anyone help me?   
It should color diferent points according to the different codes but it´s always black points in the map..
Thanks in advance.

  $point = ms_newPointObj();
  $point->setXY($x,$y); 
  $line = ms_newLineObj(); 
  $line->add($point);  
  $feature = ms_newShapeObj(0); 
  $feature->set("text"," "); //
  $feature->add($line);  
  $layer = $map->getLayerByName($layer_name); 
  $layer->addFeature($feature);  

  switch($code){
   case 3:
    $color[0] = 48;
    $color[1] = 255;
    $color[2] = 219;
    $class = ms_newClassObj($layer);
    $style = ms_newStyleObj($class); 
    $class->setExpression('code = 3');
    break;
   case 4:
    $color[0] = 255;
    $color[1] = 48;
    $color[2] = 84;
    $class = ms_newClassObj($layer);
    $style = ms_newStyleObj($class
    $class->setExpression('id = 4');
    break;
    ....
  }


Alexandre.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060801/552c680c/attachment.html


More information about the mapserver-users mailing list