[mapserver-users] [Fwd: Help]

Stephen Woodbridge woodbri at swoodbridge.com
Thu Apr 11 16:05:33 EDT 2002


Jaqueline,

You can simplify the problem because your javascript code is generating
a GET to send the form. So what you need to look at is:

1) What does the URL look like that the javascript is generating?
   It is to hard to figure that out by reading the javascript :)
2) What does you mapfile look like?
3) What version of Mapserver are you using?

If you post this information to the list, I'm sure someone can help
figure out the problem.

-Steve W.

-------- Original Message --------
Subject: Help
Date: Thu, 11 Apr 2002 14:21:05 -0600 (CST)
From: "Jaqueline Diaz Vazquez (Tesista)" <jdv at cenapred.unam.mx>
To: <woodbri at swoodbridge.com>

Hello 

I'm Sorry  by the annoyance, but we have a small problem executing an 
example of "itemquery" that is in the page of MapServer in the following 
direction:

http://maps.dnr.state.mn.us/mapserver_demos/tests/itemquery/

What we are trying to do is to view our layer with some areas
iluminated, 
but this areas depend on a query, and we are having troubles with it. 

We already modified the code with our own data, and 
when we execute this code, it shows the following error:

msQueryByAttributes(): Query error. Requested layer has no filter
defined. 

We have reviewed all the documentation and we have not been able to
solve 
the problem.

The code that we have is the following: (like test.html)

html>
<head>
  <title>MapServer Test Suite - ItemQuery</title>
  <script language="javascript"></script>
  <script language="javascript">
    var counties = new Array('Puebla','Mexico');

    function write_counties() {
      var i;

      for(i=0; i<counties.length; i++)
        document.write("<option> " + counties[i] + "\n");
    }

    function submit_case2() {
      var i, sep='';

      document.case2.map_county_filter.value = '/'; // start of a regex
      for(i=0; i<document.case2.name.length; i++) {
        if(document.case2.name.options[i].selected)
          document.case2.map_county_filter.value =
document.case2.map_county_filter.value + sep +
document.case2.name.options[i].text;
          sep = '|';
      }
      document.case2.map_county_filter.value += '/'; // end of a regex
    }
  </script>
</head>

<body bgcolor="#ffffff">


<script language="javascript">
  document.write("<font size=\"+2\"
face=\"arial,helvetica\"><b>MapServer 
<a href=\"" + htmlroot + "\">Test Suite</a> - ItemQuery</b></font>");
</script>

<p>

<font size="+1" face="arial,helvetica"><b>Case 1: Simple ItemQuery With 
QueryMap</b></font>

<p>
<a href="case1.map"><i>map file</i></a><br>
<a href="case1_template.html"><i>query template file</i></a>
<p>

<script language="javascript">
  var ruta_map="/usr/local/apache/htdocs/gmap/consultas.map";
  var cgi="../../cgi-bin/mapserv";
  document.write("<form name=\"case1\" method=\"get\" action=\"" + cgi +
"\">\n");
  document.write("<input type=\"hidden\" name=\"mapserv\" value=\"" +
cgi + "\">\n");
  document.write("<input type=\"hidden\" name=\"map\" value=\"" +
ruta_map + "\">\n");
  document.write("<input type=\"hidden\" name=\"map_web_imagepath\"
value=\"" + imagepath + "\">\n");
  document.write("<input type=\"hidden\" name=\"map_web_imageurl\"
value=\"" + imageurl + "\">\n");

</script>

<input type="hidden" name="mode" value="itemquery">
<input type="hidden" name="qlayer" value="states">
<input type="hidden" name="map_county_filter" value="">

Pick one:

<select name="name" size="1">
<script language="javascript">write_counties()</script>
</select>

<input type="submit" value="Go!">

</form>


________________________________________________________________________
 
We do not understand where is happening with our filter, what are we 
doing wrong?


We have checked the template (the html file) and the map file, we
believe 
they are correct.

We'd like to know what are we doing wrong and where?

Could you help us?

Where we can find information or other examples about "itemquery" using 
"querybyfeatures"?


Thank you. =)



More information about the mapserver-users mailing list