Multiple Symbols and Breadcrumbs

Antonio Agostini mapserver at INTERAMERICAN.US
Wed Aug 25 15:29:11 PDT 2004


I'd like to share the solution I found for this. It doesn't sound like the
best one bust it works and there was no obvious performance hit at least
under a light load.

I created 16 layers in my map file, each one with a style and the
corresponding symbol in it. All have STATUS OFF in case there are no points
in some of them.

Programatically I then add the points to the appropriate layer and that's
it.

 $pos=0;
 $heading=-1;
 for ($i=0; $i < $size/3; $i++) {
  //
  $oShp=ms_newShapeObj(MS_SHAPE_LINE);
  $oLine=ms_newLineObj();


  if ($pos>0) {
   if ($arr[$pos+2] <> $heading) {
    $heading = $arr[$pos+2];
    $headinglayer=$gpoMap->getLayerByName
("HEADING".$heading);
    $headinglayer->set("status",MS_ON);
   }
   $oLine->addXY($arr[$pos+1],$arr[$pos]);

   $oShp->add($oLine);
   $headinglayer->addfeature($oShp);

  }
  else
  {
   $oLine->addXY($arr[$pos+1],$arr[$pos]);

   $oShp->add($oLine);

   //Set the first point label
   $oShp->set("text",$Label);

   $dummylayer->addfeature($oShp);
  }
  $pos=$pos+3;
  $oShp->free;
  $oLine->free;
 }



More information about the MapServer-users mailing list