query result map
Stephen Lime
steve.lime at dnr.state.mn.us
Fri Feb 2 08:29:48 PST 2001
Remember that all layers are turned OFF by default as soon as the mapserv cgi
fires. Layers with status DEFAULT are untouched. You must explicitly turn layers
ON using either the LAYER/LAYERS or QLAYER CGI parameters. These can
be hidden vars or controlled via form elements. If no layers have been turned on
then there is nothing to query and there can be no query map, rather an error
message. QLAYER is used to isolate a query to a single layer.
In short, the behavior you notice is intentional. What were you expecting?
Steve
Stephen Lime
Internet Applications Analyst
Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937
>>> "Yeewen Sat" <yeewen at petromap.com> 01/25/01 03:18PM >>>
Hi,
I've implemented something similar to Case #3 in
http://maps.dnr.state.mn.us/mapserver_demos/tests/itemquery/test.html
but the user query by dragging a box with the mouse over a map to query
objects. I display a query result and result map in a popup window.
Anyway, I noticed this behaviour:
If I set the STATUS of the layer I'm querying on to be OFF, the result map
doesn't show up. If STATUS is set to DEFAULT, the result map shows up.
My problem is that I have to set the LAYER STATUS to OFF in order to be able
to turn layer on and off.
Does anyone has any idea on how to resolve this problem? ie to get both
(query result map and layer on/off) to work?
Here's my mapfile, ywseis.map, showing only the layer that I query on.
...
#
# Start of layer definitions
#
LAYER
NAME ss1l
TYPE LINE
STATUS OFF
DATA ss1l
CLASSITEM 'ID'
MAXSCALE 3000000
CLASS
EXPRESSION /.*/
COLOR 230 0 0
SYMBOL 0
END
CLASS
EXPRESSION /xxx/
COLOR 0 0 255
END
QUERY
TEMPLATE "../www/lineinfo.html"
END
TOLERANCE 10
END
...
lineinfo.html
<font size+1><b>Layer: Seismic Lines</b></font><p>
<table cellpadding=5 cellspacing=2 border=0>
<tr
bgcolor=#CCCCCC><th>ID</th><th>SIZE</th><th>STYLE</th><th>COLOR</th><th>FILL
</th><th>PATTERN</th><th>ANGLE</th><th>TEXT</th><th>ATTR</th></tr>
<tr><td>[ID]</td><td>[SIZE]</td><td>[STYLE]</td><td>[COLOR]</td><td>[FILL]</
td><td>[PATTERN]</td><td>[ANGLE]</td><td>[TEXT]</td><td>[ATTR]</td></tr>
<td><img
src="/cgi-bin/mapserv?map=../map/ywseis.map&item=ID&value=[ID]&mode=itemquer
ymap&mapext=shapes" height="200" width="200"></td>
</table>
<p>
--
Yeewen
More information about the MapServer-users
mailing list