[ka-Map-users] query in ka-map with mapserver

Hajime TANAKA hajime.tanaka at tufts.edu
Wed Dec 23 09:24:31 EST 2009


according to
you need

 "queryable" "true"
 "fields" "A:alias_A, B:alias_B, C:alias_C" # the selected fields
will be displayed on the left panel with alias names

in a layer. and you also need to make template.html for the layer

<!-- MapServer Template -->
 <head><title>Global Template</title></head>
       <li> [A]
       <li> [B]
       <li> [C]
#---------------template.html end---------------#

and, put TEMPLATE in CLASS

# skip #
 TEMPLATE template.html
# skip #

I remember <!-- Mapserver Template--> is necessary.

2. You need to entirely include the polygon with the rectangle

3. My understanding is that when query is successful, MS_SUCCESS will
be returned as the value of 1
map_query_float.php, first getResult($a) should be changed to
getResult(0) for multiple layer queries.

I hope this helps,


2009/12/23 王连波 <happyforev1 at gmail.com>:
> hello all,
>  I want to query something from my map which is displayed through ka-map
> from mapserver. However, the problem is I am not clear about how to use
> query. Should I add QUERYMAP in my mapfile, or what is ITEMQUERY mean? I
> have read the MapServer docs, but it is too little for me to understand. Is
> there some examples or resources for me, thank you in advance.
>  BTW, in ka-map there is a file named map_query_float.php. I read it and got
> something, but I am not clear about that:
> 1、the "fields" I should add into my mapfile mean what?  Is it the queried
> shape's attributes from the table where I store the shapes in my database,
> or something  else?
> 2、If I want to query something (eg. population) of a city in a state, while
> I just draw a box to select part of the city, can I get that city's
> population or that just the cities which are totally selected in the box can
> be queried? I hope someone can understand me and give me some hints.
> 3、this is a simple question: why I can not get the "if" sentences executed
> with "if ($check_query == MS_SUCCESS)" , while it is ok with "if
> ($check_query == 1)"? (I had loaded PHP/MapScript module in my PHP script
> file.)
> Any help is appreciated.
> --
> 天道酬勤
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users

Hajime Tanaka

More information about the ka-Map-users mailing list