[Mapserver-users] mapscript - queryByPoint help, simple Q
Eric Bridger
eric at gomoos.org
Thu Aug 28 10:27:11 PDT 2003
The problem is probably in your map file.
TEMPLATE belongs in the LAYER not the CLASS.
On Thu, 2003-08-28 at 19:15, poff wrote:
> Hello again
>
> I've tried all the list suggestions with the followig code, but am _still_
> getting "No Records Found".
>
> If anyone could suggest or point out what I'm doing wrong I'd be greatly
> indebted to them!
>
> Here it goes:
>
> ...
> $map = ms_newMapObj($mapfile);
>
> $uLayer = $map->getLayerByName("Points");
> $uLayer->set("status",1);
>
> $image=$map->draw();
>
> while () {
>
> $oPoint = ms_newPointObj();
> $oPoint->setXY($geoData['px'], $geoData['py']);
>
> $line = ms_newLineObj();
> $line->add($oPoint);
>
> $shp=ms_newShapeObj(MS_SHAPE_POINT);
> $shp->add($line);
> $shp->{text}=$geoData['place_name'];
> $shp->{index}=$i;
>
> $uLayer->addFeature($shp);
>
> $oPoint->draw($map, $uLayer, $image, 0, $geoData['place_name']);
>
> }
>
> $my_point = ms_newpointObj();
> $my_point->setXY($_REQUEST["mapa_x"],$_REQUEST["mapa_y"]);
>
> $map->queryByPoint($my_point, MS_SINGLE, 20);
>
> $uLayer->queryByPoint($my_point,MS_SINGLE,-10); // for good measure
> ...
>
> And the mapfile:
>
> ...
> LAYER
> NAME "Points"
> STATUS ON
> TYPE POINT
> LABELCACHE FALSE
> CLASS
> NAME "User Marker"
> SYMBOL "marker"
> TEMPLATE "dummy"
> LABEL
> ...
> END
> END
> END
> ...
>
> I'm pretty stumped! I tried by $map-> and $Layer-> queryByPoint to no great
> joy.
>
> Thanks in advance,
>
> P
>
> --
> poff at sixbit.org
> SDF Public Access UNIX System - http://sdf.lonestar.org
>
> Please do not carbon copy replies to me
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
>
More information about the MapServer-users
mailing list