[ka-Map-users] Re: mapserver query system in kamap

Alessio Di Lorenzo alessio.dilorenzo at gmail.com
Sat Sep 29 15:30:30 EDT 2007


I hope this can help you to understand:

if I use the query tool, the resultant window shows the message I posted 
in the previous email, but if copy the generated query (for example 
http://www.openmaps.it/cgi-bin/mapserv?map=/usr/local/apache2/webdomains/gisst/home/mapfiles/majella.map&mode=query&mapxy=419523.1067908557)
and paste it in a new browser window I obtain the following error:

loadForm(): Web application error. Not enough arguments for mapxy

I suppose (but not sure) this means that the code in the wiki

function myQuery( eventID, queryType, coords ) {
  
window.open("/cgi-bin/mapserv?map=/absolute/path/to/my/mapfile.map&mode=query&mapxy=" 
+ coords[0] + "+" + coords[1]);
}

is not enough to generete a full working query...
I hope you can help me!



Alessio Di Lorenzo ha scritto:
> Hi list,
> I have a problem with the query system.
> I followed the wiki page at 
> http://ka-map.ominiverdi.org/wiki/index.php/Query (Using MapServer's 
> Templating System for Queries).
>
> Firstly I created the html template as specified in the wiki
>
> <html>
>  <head><title>Sample Template</title></head>
>  <body>
>    <li> item 1 is [MY_ITEM_1]
>    <li> and item 2 is [MY_ITEM_2]
>    <li> but item 3 is [MY_ITEM_3]
>  </body>
> </html>
>
> (using only a few items... for now it is a demo...)
>
>
> Then I worked on my mapfile adding the required keywords
>
> MAP
> ...
> ...
>  LAYER
>  ...
>  ...
>   METADATA
>   ...
>   'queryable' 'true'
>   ...
>   END #metadata
>  CLASS
>  ...
>  ...
>   TEMPLATE '/absolute/path/to/mytemplate.html'
>  ...
>  END #class
> END #layer
> END #map
>
>
> Finally I customized the startUp.js file changing the  myQuery 
> function like the following
>
> function myQuery( eventID, queryType, coords ) {
>   
> window.open("/cgi-bin/mapserv?map=/absolute/path/to/my/mapfile.map&mode=query&mapxy=" 
> + coords[0] + "+" + coords[1]);
> }
>
>
> The problem, now, is that I ALWAYS get the Error
>
> msQueryByPoint(): Search returned no results. No matching record(s) 
> found.
> but I'm quite sure that I center the queriable element with the mouse 
> (I inserted also the TOLERANCE and TOLERANCEUNIT keywords in my 
> mapfile, but nothing changed)...
>
> Can you help me guys?
> It's very important for me! Please...
>
>



More information about the ka-Map-users mailing list