[Mapserver-users] Does anyone success add point persistent to shape?

No dream more v0463 at n-koei.co.jp
Fri Jun 4 01:05:07 EDT 2004


Dear list,

I am customizing the interface from mapserver workshop to implementing a
function to add point to map. But I got some problem:
- If I create a new layer then I open layer for adding a point. The error
always is "msSHPOpenFile(): No (NULL) filename provided".
    $newLyr = new_msLayerObj($mapObj);
    if($newLyr->open()==MS_SUCCESS){    ////// -> msSHPOpenFile(): No (NULL)
filename provided
    }

- I can add a point to existing layer but I can add only one point. This
point cannot be save to shape file.

     //$newLyr = new_msLayerObj($mapObj);
    $newLyr = $mapObj->getLayerByName("test_point");

    $newPoint = ms_newPointObj();
    $newPoint->setXY($x, $y);

    $newLine = ms_newLineObj();
    $newLine.add($newPoint);

    $newShp = ms_newShapeObj(MS_SHAPE_POINT);
    $newShp->add($newLine);

    $imgObj = $mapObj->draw();                     (If this call, the point
can draw)
    //$imgObj = $mapObj->prepareImage();        (If this call, I got only a
blank screen)

    $newLyr->draw($imgObj);
    $imgObj->saveImage("");

Does anyone success add point persistent to shape?

Thank.

Le Ngoc Lam




More information about the mapserver-users mailing list