[mapserver-users] query in ka-map with mapserver
王连波
happyforev1 at gmail.com
Thu Dec 24 21:50:33 PST 2009
Hi all,
I know that this question is more about ka-map rather than MapServer,
however I have not got what I want from that mailing-list yet. So I want to
get some suggestion here.
I am really anxious about ka-map query and search now. In my mapfile I
configured a layer as follows and it displayed a city's boundary constituted
of 68 lines. Then I think it is valid to select some of the lines and get
their id from the table where the_geo DATA is stored in my database.
However, when I finished the query just get "no matching results". I have
read the script file "map_query_float.php" and found nothing special. Maybe
it is because of the ka-map scripts? Thank you for any clues.
1、a querable layer of my mapfile
LAYER
METADATA
'queryable' 'true'
“fields” "bound_id:BID"
"searchfield" "gid"
END
TEMPLATE noexit.html
NAME xzqj_x
group "xzqj"
STATUS ON
TYPE line
CONNECTIONTYPE POSTGIS
CONNECTION "dbname=*** host=*** user=*** password=*** port=***"
DATA "the_geom from xzqj_x"
# labelitem cname
CLASS
NAME xzqj_x
STYLE
symbol dashed1
size 3
color 100 100 100
END
END
END
2、part of the script file map_query_float.php in ka-map:
if ($q_type == 0) $check_query = $oLayer->queryByPoint($point,
MS_MULTIPLE, -1);
else $check_query = $oLayer->queryByRect($rect);
// if ($check_query == MS_SUCCESS) {
if ($check_query == 1) {
echo "<p>Layer Name:</p> <h6>" . $oLayer->name .
"</h6>";
$totR = $oLayer->getNumResults();
if($max_results_per_layer < $totR) echo "<p>results:
$max_results_per_layer of $totR (limited output)</
else echo "<p>results: $totR</p>"; //output is
"results:0"
--
天道酬勤
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20091225/c54f3de5/attachment.htm>
More information about the MapServer-users
mailing list