[Mapserver-users] query on dynamic point data
Eric Bridger
eric at gomoos.org
Fri Apr 16 06:29:44 PDT 2004
On Fri, 2004-04-16 at 09:17, Gijs Epping wrote:
> >
> > $layer = ms_newlayerObj($gpoMap);
> > $layer->set("name", "pnts");
> > $layer->set("type", MS_LAYER_POINT);
> > $layer->group='standaard';
> > $layer->set("status", MS_ON);
> >
> > $class = ms_newClassObj($layer);
> > $class->set("template", "blabla.html");
> > $style = ms_newStyleObj($class);
> > $style->color->setRGB(0,0,0);
> > $style->set("symbolname", "star");
> > $style->set("size", 10);
> >
> >
> >
> > $point_lookup1 = array(146626, 511696);
> > $layerObj = $gpoMap->getLayerByName(pnts);
> > $line = ms_newLineObj();
> > $shp =ms_newShapeObj(MS_SHAPE_POINT);
> >
> >
> > $point = ms_newPointObj();
> > $point->setXY($point_lookup1[0], $point_lookup1[1]);
> > $line->add($point);
> > $shp->add($line);
> >
> >
> > $layerObj->addFeature($shp);
> >
> > $gpoMap->draw();
>
> In mapserver3.6 I use very similiar code but with the addition of:
> $shp->{index} = $id
>
> $id must be numeric. This $id is returned by the query.
>
>
>
> Do you use this with perl or with php because we are using php and we
> don't get anything back.
>
> This is what I get back from $oRes = $oLayer->getResult($iRes);:
>
> stdClass Object ( [shapeindex] => -1 [tileindex] => -1 [classindex] => 0
> )
>
This was in perl mapscript 3.6. There is a detailed example, with
comments here:
http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?PerlMapScriptExamples35ex19
The other difference I notice is that I used $point->draw() to draw the
points, not $map->draw().
More information about the MapServer-users
mailing list