MapTools.org

[maplab-users] Refresh of the map with query button

Paolo noti@ciaoweb.it
Tue, 9 Sep 2003 15:31:58 +0200
Paul,
problem solved.
Using input_coords from document.forms[0].INPUT_COORD.value
and bbox from document.forms[0].PrevStateKey.value I built the string to
pass to query.html.
Here is javascript function (not so optimized..)

<script language="Javascript">
function init()
{
//layer to query
var layer = document.cf.layer.value;
if (layer = "")
{
alert ("Select one layer to query.....");
return false;
}
var bbox = document.forms[0].PrevStateKey.value;
var strCoord = document.forms[0].INPUT_COORD.value;
var length = strCoord.length;
var virg = strCoord.lastIndexOf(",", length);
strCoordX = strCoord.substr(0, virg);
strCoordY = strCoord.substring(virg+1, length);
var url = "http://192.168.1.1/path/query.phtml?PrevStateKey=" + bbox +
"&INPUT_COORD=" + strCoordX + "," + strCoordY + "&STRATO=" +
document.cf.layer.value;
if (document.all)
var xMax = screen.width, yMax = screen.height;
else if (document.layers)
var xMax = window.outerWidth, yMax = window.outerHeight;
else
var xMax = 640, yMax=480;
var xOffset = (xMax - 510)/2, yOffset = (yMax - 390)/2;
mapquery =
window.open(url,'mapquery','scrollbars=yes,resizable=yes,width=650,height=30
0,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'')
;
mapquery.focus();
}
</script>

It's ok for me but it queries only one layer and, at the moment, doesn't
check visible layers or layers with template.

Thank You very much

Paolo


----- Original Message ----- 
From: "Paul Spencer" <pagameba@magma.ca>
To: "Paolo" <noti@ciaoweb.it>
Cc: <maplab-users@dmsolutions.ca>
Sent: Sunday, September 07, 2003 9:55 PM
Subject: Re: [maplab-users] Refresh of the map with query button


> Paolo,
>
> it is probably possible but not something we have actually tried to do
> with GMapFactory applications.  You should check the ROSA documentation
> on http://www.maptools.org/.  I would try adding:
>
> TB_BUT_QUERY_JSACTION
>
> and writing a javascript function that would popup a query page directly
> rather than submit the page.
>
> It is likely possible to have it popup the existing query page but the
> trick would be to pass the query location and session id in the correct
> way.  You will have to jump into the code and see what it does if you
> use the existing query page.
>
> If you ge tthis to work, please let me know and I will incorporate the
> change into an upcoming release of MapLab.
>
> Cheers,
>
> Paul
>
> Paolo wrote:
>
> >Hi,
> >a question about a GMap application with rosa applet:
> >is it possible to avoid refresh of the map (or refresh of the entire
page) when I use the query button in order to display data in a separate
windows. In other words I'd like the query button open the new database
windows without reloading the map in the applet area.
> >I tried changing TB_BUT_QUERY_INPUT  parameter (submit) but I don't know
how to operate and if I have to change php code in other files.
> >Thanks in advance.
> >
> >Paolo
> >
> >
>
> -- 
> --
> Paul Spencer
> Applications and Software Development
> DM Solutions Group Inc.
> http://www.dmsolutions.ca
>
>
>



This archive was generated by Pipermail.