[ka-Map-users] Re: Kamap Query System
Peter Giencke
pgiencke at glc.org
Wed Aug 31 09:32:38 EDT 2005
Paul,
There is, just added a bit of code to kaTool.js for this to work.
////code starts here
function kaNavigator_onmousedown(e)
{
e = (e)?e:((event)?event:null);
//added code
if(queryThis == 1) //button in application toggle between query mode
and browse mode, queryThis = 1 is in query mode
{
var aPixPos = this.adjustPixPosition( e.clientX, e.clientY );
var geoCoo= this.kaMap.pixToGeo(aPixPos[0],aPixPos[1]);
this.gX = geoCoo[0];
this.gY = geoCoo[1];
this.gX= (parseInt(this.gX*100))/100;
this.gY= (parseInt(this.gY*100))/100;
var vLayers = getVisibleLayer();
var extent = this.kaMap.getGeoExtents();
this.cursor = 'help';
var
params='x='+this.gX+'&y='+this.gY+'&layer='+vLayers+'&extent='+extent[0]+'|'
+extent[1]+'|'+extent[2]+'|'+extent[3];
toSendLink = "showResults.php?" + params;
return this.cancelEvent(e); //as to not pan when querying
}
//end
if (e.button==2)
{
return this.cancelEvent(e);
}
else
{
if (isIE4) document.onkeydown = kaTool_redirect_onkeypress;
document.onkeypress = kaTool_redirect_onkeypress;
this.bMouseDown=true;
this.lastx=e.clientX;
this.lasty=e.clientY;
e.cancelBubble = true;
e.returnValue = false;
if (e.stopPropogation) e.stopPropogation();
if (e.preventDefault) e.preventDefault();
return false;
}
}
function getVisibleLayer(){
//function courtesy of Lorenzo/rischio
var inputList = document.getElementsByTagName('input');
var a=new Array();
var layerList="";
var n=0;
for(i=0;i<inputList.length;i++){
if(inputList.item(i).name=='layerVisCB' && inputList.item(i).checked)
{
a[n] = inputList.item(i).value;
n++;
}
}
for(i=0;i<a.length;i++){
if(i==0)
layerList=a[i];
else
layerList = layerList+","+a[i];
}
return layerList;
}
/////end
-----Original Message-----
From: Paul Spencer [mailto:pspencer at dmsolutions.ca]
Sent: Wednesday, August 31, 2005 9:07 AM
To: pgiencke at glc.org
Cc: 'Lorenzo Becchi'; ka-map-users at lists.maptools.org
Subject: Re: [ka-Map-users] Re: Kamap Query System
Pete,
is there some javascript that goes with this?
Paul
Peter Giencke wrote:
> Paul,
>
> Here at the GLC, we've implemented a similar solution for point and
> click queries using ka-Map. It works much like Lorenzo's version
> (difference is it uses single-click queries writing to an iframe below
> the layer control). The beauty of this solution is that it preserves
> the style of the 'layer control' such that you can have seamless mapping
controls/etc throughout.
> Comments/etc welcome.
>
> -pete
>
> Attachments: showResults.php
>
> -----Original Message-----
> From: ka-map-users-bounces at lists.maptools.org
> [mailto:ka-map-users-bounces at lists.maptools.org] On Behalf Of Paul
> Spencer
> Sent: Wednesday, August 31, 2005 8:43 AM
> To: Lorenzo Becchi
> Cc: ka-map-users at lists.maptools.org
> Subject: [ka-Map-users] Re: Kamap Query System
>
> Lorenzo,
>
> can you send me the files involved and I will look at integrating them
> into the cvs version of ka-Map. I will take care of any clean-up and
> redesign needed.
>
> Cheers
>
> Paul
>
> Lorenzo Becchi wrote:
>
>>Hi Paul,
>>I've seen somebody is interested in a query system in Ka-map.
>>We developed our own at
>>http://149.139.8.29/~rischio/ka-map-cvs/ka-map/htdocs/
>>maybe you've already seen it.
>>
>>It's a simple class implemented using your API.
>>We did it as fast as possible to try it so it has not a great code and
>>can be better .
>>I've seen the answers you've posted ([ka-Map-users] Point & Query a DB
>>), if you have suggestions how to proceed we will be pleased to write
>>it in a proper way.
>>
>>I remember you that to query our system you have to click on the
>>viewport and press "q" key.
>>then the cursor change in "help" style and you can double click on the
>>map to open the popup with the generic query result.
>>The result is just a page that shows all active Layers (group) and all
>>value selected.
>>
>>any suggestion?
>>
>>regards
>>Lorenzo
>>
>>
>
>
--
+-----------------------------------------------------------------+
|Paul Spencer pspencer at dmsolutions.ca |
+-----------------------------------------------------------------+
|Applications & Software Development |
|DM Solutions Group Inc http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+
-----Original Message-----
From: Paul Spencer [mailto:pspencer at dmsolutions.ca]
Sent: Wednesday, August 31, 2005 9:07 AM
To: pgiencke at glc.org
Cc: 'Lorenzo Becchi'; ka-map-users at lists.maptools.org
Subject: Re: [ka-Map-users] Re: Kamap Query System
Pete,
is there some javascript that goes with this?
Paul
Peter Giencke wrote:
> Paul,
>
> Here at the GLC, we've implemented a similar solution for point and
> click queries using ka-Map. It works much like Lorenzo's version
> (difference is it uses single-click queries writing to an iframe below
> the layer control). The beauty of this solution is that it preserves
> the style of the 'layer control' such that you can have seamless mapping
controls/etc throughout.
> Comments/etc welcome.
>
> -pete
>
> Attachments: showResults.php
>
> -----Original Message-----
> From: ka-map-users-bounces at lists.maptools.org
> [mailto:ka-map-users-bounces at lists.maptools.org] On Behalf Of Paul
> Spencer
> Sent: Wednesday, August 31, 2005 8:43 AM
> To: Lorenzo Becchi
> Cc: ka-map-users at lists.maptools.org
> Subject: [ka-Map-users] Re: Kamap Query System
>
> Lorenzo,
>
> can you send me the files involved and I will look at integrating them
> into the cvs version of ka-Map. I will take care of any clean-up and
> redesign needed.
>
> Cheers
>
> Paul
>
> Lorenzo Becchi wrote:
>
>>Hi Paul,
>>I've seen somebody is interested in a query system in Ka-map.
>>We developed our own at
>>http://149.139.8.29/~rischio/ka-map-cvs/ka-map/htdocs/
>>maybe you've already seen it.
>>
>>It's a simple class implemented using your API.
>>We did it as fast as possible to try it so it has not a great code and
>>can be better .
>>I've seen the answers you've posted ([ka-Map-users] Point & Query a DB
>>), if you have suggestions how to proceed we will be pleased to write
>>it in a proper way.
>>
>>I remember you that to query our system you have to click on the
>>viewport and press "q" key.
>>then the cursor change in "help" style and you can double click on the
>>map to open the popup with the generic query result.
>>The result is just a page that shows all active Layers (group) and all
>>value selected.
>>
>>any suggestion?
>>
>>regards
>>Lorenzo
>>
>>
>
>
--
+-----------------------------------------------------------------+
|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