[ka-Map-users] Map Query

Steve Lime Steve.Lime at dnr.state.mn.us
Thu Jun 22 13:22:22 EDT 2006


Have you installed the stock mapserver demo? It shows you how to do
a simple query pretty easily. Here's another example from a site here:

  http://maps/cgi-bin/mapserv46?map=/usr/local/www/docs_maps/mapserver_demos/tests46/query/test.map&program=/cgi-bin/mapserv46&htmlroot=/mapserver_demos/tests46&map_web_imagepath=/usr/local/www/docs_maps/tmp/&map_web_imageurl=/tmp/

The mapfile and template file are available.

The idea is pretty straight forward, there are 2 steps:

1) author a template file

Although typically HTML files you can return XML or whatever. For example, 
if you have a DBF file with 3 attributes ITEM1, ITEM2 and ITEM3 then a template 
might look like:

<html>
  <head><title>Sample Template</title></head>
  <body>
    <li> item 1 is [ITEM1]
    <li> and item 2 is [ITEM2]
    <li> but item 3 is [ITEM3]
  </body>
</html>

2) reference the template in the LAYER

Typically that means adding the line:

  TEMPLATE 'mytemplate.html'

to the mapfile.

In my ka-map example all I am doing is using ka-map properties to make standard query calls to MapServer...

Steve

>>> "Mike D'Ambrogia" <miked at jamagination.com> 6/21/2006 7:20:27 PM >>>
Steve,

I'm fully lost in the query side of things (after being fully lost
virtually everywhere else...) is there a snippet of the mapfile that you
could send back that would show how you setup the mapfile to pass the
query event.  The code below makes total sense, I just can't connect the
dots between clicking the "i" icon in ka-map and firing the jscript
snippet below, my thought is that it's a mapfile setup thing that I'm
not understanding

Any help appreciated

Mike

-----Original Message-----
From: ka-map-users-bounces at lists.maptools.org 
[mailto:ka-map-users-bounces at lists.maptools.org] On Behalf Of Steve Lime
Sent: Wednesday, June 21, 2006 12:16 PM
To: pspencer at dmsolutions.ca; absarz at hotmail.com 
Cc: ka-map-users at lists.maptools.org 
Subject: Re: [ka-Map-users] Map Query


I have a simple query capability working in this example:

  http://maps.dnr.state.mn.us/ka-map/compass.html 

It's pretty straight-forward. I just take the output from the query
event and pass that along to your mapping application. In my case I'm
handing the query off to a standard MapServer CGI application in a new
window. The relevant code looks like:

function myQuery( eventID, queryType, coords ) {
 
window.open("/cgi-bin/mapserv410?maps=COMPASS_MAPFILE&mode=query&mapxy="
+ coords[0] + "+" + coords[1]); }

Steve

>>> Paul Spencer <pspencer at dmsolutions.ca> 6/20/2006 12:45:36 PM >>>
sorry, I don't have anything like that.  Perhaps someone on the  
mailing list does ...

On 20-Jun-06, at 1:09 AM, Absar Ali wrote:

>
> Dear Paul Spencer,
>
> Thnkx for ur prompt response, if you have the code for query then
> please email me, i will be very thnk ful to u.
>
> Regards,
>
> Absar
>
>> From: Paul Spencer <pspencer at dmsolutions.ca>
>> To: absar ali <absarzaidi at yahoo.com>
>> CC: ka-map-users at lists.maptools.org 
>> Subject: Re: [ka-Map-users] Map Query Date: Mon, 19 Jun 2006  
>> 17:09:48 -0400
>>
>> Absar,
>>
>> the info tool is an example of how you can integrate a query   
>> capability into your application.  It ensures that you have the   
>> coordinates requested by the user.  You need to implement the   
>> capability to search your data.
>>
>> Cheers
>>
>> Paul
>>
>> On 19-Jun-06, at 1:36 AM, absar ali wrote:
>>
>>> I have sucessfully installed ka map n its worknig but when i
>>> select  the info tool and click on the polygon a java script  
>>> message window  appear with some extent values and x y values of  
>>> the map,
>>> what i want is when i click on the polygon a new window will  
>>> appear  with values from the dbf files.
>>>
>>> Waiting for a v good n working response.
>>>
>>>
>>> Regards,
>>>
>>> Absar Ali
>>>
>>> Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously
>>> low  rates.
>>> _______________________________________________
>>> ka-Map-users mailing list
>>> ka-Map-users at lists.maptools.org 
>>> http://lists.maptools.org/mailman/listinfo/ka-map-users 
>>
>> +-----------------------------------------------------------------+
>> |Paul Spencer                           pspencer at dmsolutions.ca   |
>> +-----------------------------------------------------------------+
>> |Applications & Software Development                              |
>> |DM Solutions Group Inc                 http://www.dmsolutions.ca/| 
>> +-----------------------------------------------------------------+
>>
>>
>>
>>
>> _______________________________________________
>> ka-Map-users mailing list
>> ka-Map-users at lists.maptools.org 
>> http://lists.maptools.org/mailman/listinfo/ka-map-users 
>
>

+-----------------------------------------------------------------+
|Paul Spencer                           pspencer at dmsolutions.ca   |
+-----------------------------------------------------------------+
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/| 
+-----------------------------------------------------------------+




_______________________________________________
ka-Map-users mailing list
ka-Map-users at lists.maptools.org 
http://lists.maptools.org/mailman/listinfo/ka-map-users 


_______________________________________________
ka-Map-users mailing list
ka-Map-users at lists.maptools.org 
http://lists.maptools.org/mailman/listinfo/ka-map-users 




More information about the ka-Map-users mailing list