[Mapserver-users] mapscript - queryByPoint help, simple Q

poff poff at sixbit.org
Thu Aug 28 15:15:43 EDT 2003


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



More information about the mapserver-users mailing list