<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 6.00.2900.3395" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=Arial size=2>Dear List,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><PRE><FONT face=Arial size=2>I'm trying to change a symbol for ONE point layer called 'poi' dynamically within 
PHP/Mapscript.  After searching the mail archive and trying a 
few variations of what seemed correct, I'm not succedding. The map only shows one type of symbol.</FONT></PRE><PRE><FONT face=Arial size=2>LAYER<BR>     NAME "poi"<BR>     STATUS on<BR>     TYPE point <BR>     LABELCACHE on<BR>     TOLERANCEUNITS METERS</FONT></PRE><PRE><FONT face=Arial size=2>END</FONT></PRE></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2>php script:</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2>public static function AddPoints ( $map, 
$qresult ) {</FONT></DIV>
<DIV><FONT size=2><BR><FONT face="Courier New">     
$this_layer = 
$map->getLayerByName('poi');  //QueryLayer</FONT></FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New" size=2>     $i = 
0;<BR>     foreach($qresult as $row) 
{<BR>            $poi[$i] = 
ms_newPointObj();<BR>        
    $ln[$i] =  
ms_newLineObj();<BR>        
    $shp[$i] = 
ms_newShapeObj(MS_SHAPE_POINT);<BR>            $poi[$i]->setXY($row[1],$row[2]); </FONT></DIV>
<DIV><FONT face="Courier New" size=2>      
      
$ln[$i]->add($poi[$i]);  <BR>            
$shp[$i]->add($ln[$i]);<BR>            
$shp[$i]->set(index, $row[0]);<BR></FONT></DIV>
<DIV><FONT face="Courier New" size=2>  if ($row[7] == 1)  
// show red symbol</FONT></DIV>
<DIV><FONT face="Courier New" size=2>   
{         </FONT></DIV>
<DIV><FONT face="Courier New" 
size=2>         $class = 
ms_newClassObj($this_layer);<BR>         
$class->set("name",depot_red);<BR>         
$class->setExpression("rot");<BR>         
$class->set("template",dummy.html);<BR>         
$style=ms_newStyleObj($class);<BR>         
$style->set("symbolname",depot_red);    //the gif</FONT><FONT 
face="Courier New" size=2><BR>   
}<BR>  else            
// show green symbol<BR>   {<BR>    
     $class = 
ms_newClassObj($this_layer);<BR>         
$class->set("name",depot_green);<BR>         
$class->setExpression("green");<BR>         
$class->set("template",dummy.html);<BR>         
$style=ms_newStyleObj($class);<BR>         
$style->set("symbolname",depot_green);   //the 
gif<BR>    }<BR></FONT></DIV>
<DIV><FONT face="Courier New" size=2>        
$this_layer->addFeature( $shp[$i] 
);<BR>        $i++;<BR> }</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>