<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1555" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>And before anyone say, I do color with
$style->color->setRGB($color[0], $color[1], $color[2]); after the
"switch", forgot to paste it before :p</FONT></DIV>
<DIV><FONT face=Arial size=2>Anyone?</FONT></DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=alexandre@ACQUASOFTWARE.COM.BR
href="mailto:alexandre@ACQUASOFTWARE.COM.BR">Alexandre Abramides</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=MAPSERVER-USERS@LISTS.UMN.EDU
href="mailto:MAPSERVER-USERS@LISTS.UMN.EDU">MAPSERVER-USERS@LISTS.UMN.EDU</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, August 01, 2006 12:03
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [UMN_MAPSERVER-USERS] Mapscript
error: Fatal error: Invalid style index - Help?</DIV>
<DIV><BR></DIV>
<DIV><FONT face=Arial size=2>Can anyone help me? </FONT></DIV>
<DIV><FONT face=Arial size=2>It should color diferent points according to the
different codes but itīs always black points in the map..</FONT></DIV>
<DIV><FONT face=Arial size=2>Thanks in advance.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV> $point =
ms_newPointObj();<BR> $point->setXY($x,$y); </DIV>
<DIV> $line =
ms_newLineObj(); <BR> $line->add($point); </DIV>
<DIV> $feature =
ms_newShapeObj(0); <BR> $feature->set("text","
"); //<BR> $feature->add($line); <BR> $layer
=
$map->getLayerByName($layer_name); <BR> $layer->addFeature($feature);
</DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV> switch($code){<BR> case
3:<BR> $color[0] =
48;<BR> $color[1] =
255;<BR> $color[2] =
219;<BR> $class =
ms_newClassObj($layer);<BR> $style =
ms_newStyleObj($class); </DIV>
<DIV> $class->setExpression('code =
3');<BR> break;</DIV>
<DIV><FONT face=Arial size=2> case
4:<BR> $color[0] =
255;<BR> $color[1] =
48;<BR> $color[2] =
84;<BR> $class =
ms_newClassObj($layer);<BR> $style =
ms_newStyleObj($class<BR> $class->setExpression('id
= 4');<BR> break;</FONT></DIV>
<DIV><FONT face=Arial size=2> ....</FONT></DIV>
<DIV><FONT face=Arial size=2> }</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Alexandre.</FONT></DIV></BLOCKQUOTE></BODY></HTML>