<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1505" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><SPAN class=001360417-26102005><FONT face=Arial color=#0000ff size=2>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).</FONT></SPAN></DIV>
<DIV><SPAN class=001360417-26102005></SPAN> </DIV>
<DIV><SPAN class=001360417-26102005><FONT face=Arial color=#0000ff size=2>It
makes the layer queryable. </FONT></SPAN></DIV>
<DIV><SPAN class=001360417-26102005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=001360417-26102005>
<DT><A name=template></A><SPAN class=term>TEMPLATE [filename]</SPAN>
<DD>
<P>Template file or URL to use in presenting query results to the
user.</P></DD></SPAN></DIV>
<DIV><SPAN class=001360417-26102005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=001360417-26102005><FONT size=2>
<P>LAYER</P>
<P>NAME "World Boundaries"</P>
<P>METADATA</P>
<P>END</P>
<P>TYPE POLYGON</P>
<P><STRONG>TEMPLATE ttt.html</STRONG></P>
<P>STATUS DEFAULT</P>
<P>CONNECTIONTYPE postgis</P></FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B>
ms4w-users-bounces@lists.maptools.org
[mailto:ms4w-users-bounces@lists.maptools.org] <B>On Behalf Of </B>Giovanni
A.<BR><B>Sent:</B> Wednesday, October 26, 2005 12:18 PM<BR><B>To:</B>
ms4w-users@lists.maptools.org<BR><B>Subject:</B> [ms4w-users] problems
querying shape via mapscript<BR><BR></FONT></DIV>
<DIV><FONT face=Arial size=2>Hello,</FONT></DIV>
<DIV><FONT face=Arial size=2>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).</FONT></DIV>
<DIV><FONT face=Arial size=2>Help, it's urgent...</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> $oClickGeo =
ms_newPointObj();<BR> $oClickGeo->setXY($nClickGeoX,
$nClickGeoY);</FONT></DIV>
<DIV><FONT face=Arial><FONT size=2>
@$gpoMap->queryByPoint($oClickGeo, MS_SINGLE, -1);</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2> for($iLayer=0; $iLayer
< $gpoMap->numlayers; $iLayer++)<BR>
{<BR> $oLayer =
$gpoMap->GetLayer($iLayer);</FONT></DIV>
<DIV><FONT face=Arial
size=2> $oLayer->open();<BR>
$numResults = $oLayer->getNumResults();<BR> echo
$numResults;<BR> $oLayer->close();<BR>
}</FONT></DIV></BLOCKQUOTE></BODY></HTML>