Think you for your quick reply, Hajime. However, I still have two quetions:<br>1、what do "fields" mean? Are they the attributes or shapes from my database or anything else?<br>2、what is the template.html used for ? Does it give the query rules or displaying styles?<br>
thank you again, and I will read the resources you give me here.<br><br><div class="gmail_quote">2009/12/23 Hajime TANAKA <span dir="ltr"><<a href="mailto:hajime.tanaka@tufts.edu">hajime.tanaka@tufts.edu</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">Hi,<br>
<br>
according to<br>
<a href="http://ka-map.ominiverdi.org/wiki/index.php/Query" target="_blank">http://ka-map.ominiverdi.org/wiki/index.php/Query</a><br>
<a href="http://ka-map.ominiverdi.org/wiki/index.php/Mapfile_Metadata_Configuration" target="_blank">http://ka-map.ominiverdi.org/wiki/index.php/Mapfile_Metadata_Configuration</a><br>
you need<br>
<br>
METADATA<br>
"queryable" "true"<br>
"fields" "A:alias_A, B:alias_B, C:alias_C" # the selected fields<br>
will be displayed on the left panel with alias names<br>
END<br>
<br>
in a layer. and you also need to make template.html for the layer<br>
<br>
#---------------template.html-----------------#<br>
<!-- MapServer Template --><br>
<html><br>
<head><title>Global Template</title></head><br>
<body><br>
<li> [A]<br>
<li> [B]<br>
<li> [C]<br>
</body><br>
</html><br>
#---------------template.html end---------------#<br>
<br>
and, put TEMPLATE in CLASS<br>
<br>
CLASS<br>
# skip #<br>
TEMPLATE template.html<br>
# skip #<br>
END<br>
<br>
I remember <!-- Mapserver Template--> is necessary.<br>
<br>
2. You need to entirely include the polygon with the rectangle<br>
<br>
3. My understanding is that when query is successful, MS_SUCCESS will<br>
be returned as the value of 1<br>
<a href="http://mapserver.org/mapscript/php/index.html" target="_blank">http://mapserver.org/mapscript/php/index.html</a><br>
map_query_float.php, first getResult($a) should be changed to<br>
getResult(0) for multiple layer queries.<br>
<a href="http://lists.maptools.org/pipermail/ka-map-users/2007-June/003026.html" target="_blank">http://lists.maptools.org/pipermail/ka-map-users/2007-June/003026.html</a><br>
<br>
I hope this helps,<br>
<br>
Hajime<br>
<br>
2009/12/23 王连波 <<a href="mailto:happyforev1@gmail.com">happyforev1@gmail.com</a>>:<br>
</div></div><div><div></div><div class="h5">> hello all,<br>
><br>
> I want to query something from my map which is displayed through ka-map<br>
> from mapserver. However, the problem is I am not clear about how to use<br>
> query. Should I add QUERYMAP in my mapfile, or what is ITEMQUERY mean? I<br>
> have read the MapServer docs, but it is too little for me to understand. Is<br>
> there some examples or resources for me, thank you in advance.<br>
> BTW, in ka-map there is a file named map_query_float.php. I read it and got<br>
> something, but I am not clear about that:<br>
> 1、the "fields" I should add into my mapfile mean what? Is it the queried<br>
> shape's attributes from the table where I store the shapes in my database,<br>
> or something else?<br>
> 2、If I want to query something (eg. population) of a city in a state, while<br>
> I just draw a box to select part of the city, can I get that city's<br>
> population or that just the cities which are totally selected in the box can<br>
> be queried? I hope someone can understand me and give me some hints.<br>
> 3、this is a simple question: why I can not get the "if" sentences executed<br>
> with "if ($check_query == MS_SUCCESS)" , while it is ok with "if<br>
> ($check_query == 1)"? (I had loaded PHP/MapScript module in my PHP script<br>
> file.)<br>
><br>
> Any help is appreciated.<br>
><br>
> --<br>
> 天道酬勤<br>
><br>
</div></div><div><div></div><div class="h5">> _______________________________________________<br>
> ka-Map-users mailing list<br>
> <a href="mailto:ka-Map-users@lists.maptools.org">ka-Map-users@lists.maptools.org</a><br>
> <a href="http://lists.maptools.org/mailman/listinfo/ka-map-users" target="_blank">http://lists.maptools.org/mailman/listinfo/ka-map-users</a><br>
><br>
><br>
<br>
<br>
<br>
--<br>
Hajime Tanaka<br>
_______________________________________________<br>
ka-Map-users mailing list<br>
<a href="mailto:ka-Map-users@lists.maptools.org">ka-Map-users@lists.maptools.org</a><br>
<a href="http://lists.maptools.org/mailman/listinfo/ka-map-users" target="_blank">http://lists.maptools.org/mailman/listinfo/ka-map-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>天道酬勤<br>