<!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-&gt;color-&gt;setRGB($color[0], $color[1], $color[2]);&nbsp; 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?&nbsp;&nbsp; </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>&nbsp;</DIV>
  <DIV>&nbsp;&nbsp;$point = 
  ms_newPointObj();<BR>&nbsp;&nbsp;$point-&gt;setXY($x,$y);&nbsp;</DIV>
  <DIV>&nbsp;&nbsp;$line = 
  ms_newLineObj();&nbsp;<BR>&nbsp;&nbsp;$line-&gt;add($point);&nbsp;&nbsp;</DIV>
  <DIV>&nbsp;&nbsp;$feature = 
  ms_newShapeObj(0);&nbsp;<BR>&nbsp;&nbsp;$feature-&gt;set("text"," 
  ");&nbsp;//<BR>&nbsp;&nbsp;$feature-&gt;add($line);&nbsp;&nbsp;<BR>&nbsp;&nbsp;$layer 
  = 
  $map-&gt;getLayerByName($layer_name);&nbsp;<BR>&nbsp;&nbsp;$layer-&gt;addFeature($feature);&nbsp; 
  </DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV>&nbsp;&nbsp;switch($code){<BR>&nbsp;&nbsp;&nbsp;case 
  3:<BR>&nbsp;&nbsp;&nbsp;&nbsp;$color[0] = 
  48;<BR>&nbsp;&nbsp;&nbsp;&nbsp;$color[1] = 
  255;<BR>&nbsp;&nbsp;&nbsp;&nbsp;$color[2] = 
  219;<BR>&nbsp;&nbsp;&nbsp;&nbsp;$class = 
  ms_newClassObj($layer);<BR>&nbsp;&nbsp;&nbsp;&nbsp;$style = 
  ms_newStyleObj($class);&nbsp;</DIV>
  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;$class-&gt;setExpression('code = 
  3');<BR>&nbsp;&nbsp;&nbsp;&nbsp;break;</DIV>
  <DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;case 
  4:<BR>&nbsp;&nbsp;&nbsp;&nbsp;$color[0] = 
  255;<BR>&nbsp;&nbsp;&nbsp;&nbsp;$color[1] = 
  48;<BR>&nbsp;&nbsp;&nbsp;&nbsp;$color[2] = 
  84;<BR>&nbsp;&nbsp;&nbsp;&nbsp;$class = 
  ms_newClassObj($layer);<BR>&nbsp;&nbsp;&nbsp;&nbsp;$style = 
  ms_newStyleObj($class<BR>&nbsp;&nbsp;&nbsp;&nbsp;$class-&gt;setExpression('id 
  = 4');<BR>&nbsp;&nbsp;&nbsp;&nbsp;break;</FONT></DIV>
  <DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; ....</FONT></DIV>
  <DIV><FONT face=Arial size=2>&nbsp;&nbsp;}</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>Alexandre.</FONT></DIV></BLOCKQUOTE></BODY></HTML>