[ka-Map-users] new query tool in cvs

Paul Spencer pspencer at dmsolutions.ca
Mon Sep 12 11:50:17 EDT 2005

Hello ka-Mappers ...

based on some contributions, comments and recent project requirements, 
I've implemented a generic query capability in ka-Map which is now 
available in cvs (Note the recent email about cvs structure changes)

This new capability is implemented as a 'tool'.  This means that it is a 
'mode' that you can put the ka-Map interface into, normally by clicking 
a button.  In query mode, normal navigation is suspended (only keyboard 
navigation still works) and the user can click or click and drag to 
define the query location/region.  The tool generates a KEYMAP_QUERY 
event that you can then use to implement your own query capability.

The query tool can operate in either rectangle mode (which supports both 
  point and rectangle) or point mode (which only allows point queries.

To include the query capability, you need to do the following:

1) add a script tag to your page

<script type="text/javascript" src="kaQuery.js"></script>

2) create a new instance of kaQuery

myKaQuery = new kaQuery( myKaMap, KAMAP_RECT_QUERY );

3) provide some way of activating it.  This example would allow 
switching between querying and navigating.

<input type="button" name="navigate" value="Navigate" 
<input type="button" name="query" value="Query" 

4) listen for the query event

     myKaMap.registerForEvent( KAMAP_QUERY, null, myQuery );

5) and do something when the user requests a query

function myQuery( eventID, queryType, coords )
     alert( "QUERY: " + queryType + " " + coords );


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

More information about the ka-Map-users mailing list