[mapserver-users] addfeature - point appearing at center of map?

Debbie Pagurek pagurekd at agr.gc.ca
Tue Jul 9 14:36:14 EDT 2002


Hi,
I have created an application that adds points to the map "on-the-fly".  It makes use of a layer outlined as follows in the map file:

LAYER
  NAME COLLECTIONS
  TYPE POINT
  FEATURE
  END
  STATUS ON
  TEMPLATE VOID
  CLASS
    SYMBOL "circle"
    SIZE 5
    COLOR 255 0 0
  END
  PROJECTION
    "init=epsg:4326"
  END
END

For some reason, in addition to the points I am adding dynamically using php/mapscript, there is a point showing at the very centre of the map (the map is 600 by 300, so the point is appearing at 300, 150) or a point is appearing at 0 lat, 0 long even though I have NOT coded this at all.  I can't figure out how to get rid of this point on my maps!

here's a bit of code:
// loop through records and display (addfeature) each point
$dummylayer=ms_newLayerObj($map); //a new layerobject

$numrows = count($long);
for ($i = 0 ; $i <= $numrows; ++$i) 
{
   $oShp=ms_newShapeObj(MS_SHP_POINT);
   $oLine=ms_newLineObj();
   $oLine->addXY($long[$i],$lat[$i]);
   $oShp->add($oLine);
   $dummylayer=$map->getLayerByName("COLLECTIONS");
   $dummylayer->addfeature($oShp);
}

Anyone have any ideas why this point is appearing in the centre?

Thanks,
D. Pagurek





More information about the mapserver-users mailing list