[ms4w-users] problems querying shape via mapscript

Taylor, Adam ataylor at ilpcs.com
Wed Oct 26 13:08:16 EDT 2005


Do you have a template line in your mapfile?  Something like below?  You
don't need to actually reference a real template, but just put in the
name of a null html file, (from what I understand).
 
It makes the layer queryable. 
 
TEMPLATE [filename] 
Template file or URL to use in presenting query results to the user.

 
LAYER

NAME "World Boundaries"

METADATA

END

TYPE POLYGON

TEMPLATE ttt.html

STATUS DEFAULT

CONNECTIONTYPE postgis

	-----Original Message-----
	From: ms4w-users-bounces at lists.maptools.org
[mailto:ms4w-users-bounces at lists.maptools.org] On Behalf Of Giovanni A.
	Sent: Wednesday, October 26, 2005 12:18 PM
	To: ms4w-users at lists.maptools.org
	Subject: [ms4w-users] problems querying shape via mapscript
	
	
	Hello,
	I'm having a problem with querying a shapefile layer, using
"queryByPoint", basing my prototype on gmap demo application. Everything
works fine, it shows me all the layer present in the map, the coordinate
points "$nClickGeoX,$nClickGeoY" are correctly transformed from screen
coords to projected coords, but "$numResults " is always equal to 0...
I'm going mad! What's wrong with my script? Do I have to set some
particular tags in teh mapfile to allow querying? (In the map demo there
isn't any particular tag).
	Help, it's urgent...
	 
	 
	    $oClickGeo = ms_newPointObj();
	    $oClickGeo->setXY($nClickGeoX, $nClickGeoY);
	    @$gpoMap->queryByPoint($oClickGeo, MS_SINGLE, -1);
	    for($iLayer=0; $iLayer < $gpoMap->numlayers; $iLayer++)
	    {
	    $oLayer = $gpoMap->GetLayer($iLayer);
	    $oLayer->open();
	    $numResults = $oLayer->getNumResults();
	    echo $numResults;
	    $oLayer->close();
	   }

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ms4w-users/attachments/20051026/7a3137cd/attachment.html


More information about the ms4w-users mailing list