MapTools.org

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

Paolo noti@ciaoweb.it
Mon, 8 Sep 2003 18:12:15 +0200
This is a multi-part message in MIME format.

------=_NextPart_000_0014_01C37634.BBC67BB0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Paul,
I''m trying...
At the moment I allowed the query only for a single layer choosen by the =
user in combo box and saved in a cookie file on the client PC.
The string to pass to query.phtml is something like this:

http://192.168.1.1/path/query.phtml?PrevStateKey=3DBBOX=3D1113224,4034000=
,2512776,5241000|SRS=3D|MAPSIZE=3D580,500|
LAYERS=3D0,2,4,5,6,7,9&INPUT_COORD=3D121,112&ACTIVE_LAYER=3DRegion

I added the ACTIVE_LAYER parameter in order to pass the layer to a =
slightly modified query.phtml file
In this case, I have to retrieve two parameters: BBOX and INPUT_COORD.

For INPUT_COORD, I tried with the following code but something doesn't =
work...:
*************************************************************************=
*
//this is the code that retrieve coordinates inside the applet area.
//I placed applet with absolute position css so numbers in the code
//referred only to my applet position
<SCRIPT language=3D"JavaScript">
function init() {
document.onmousedown=3DgetMouseXY;
}
function getMouseXY() {
var tempX =3D 0;
var tempY =3D 0;
// grab the x-y pos.s if browser is IE
tempX =3D event.clientX + document.body.scrollLeft;
tempY =3D event.clientY + document.body.scrollTop;
if (tempX > 115 && tempX < 695 && tempY > 80 && tempY < 580)
{
if (tempX < 0){tempX =3D 0;}
if (tempY < 0){tempY =3D 0;}
var X =3D tempX - 115;
var Y =3D tempY - 80;
alert (X + "," + Y);
}
return true;
}
</script>
**************************************************************
//this is the code in PHP file:
echo "<param name=3D\"TB_BUT_TEST_JSACTION\" ".
"value=3D\"init();\">\n";
**************************************************************

These javascript functions work very well in a normal html page but when =
I try
to get mouse position inside the rosa applet area nothing happens...
tried also to comment different rows in getMouse function but
no alert with coordinates appears.


Thank you very much

Paolo

----- Original Message -----=20
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,
>=20
:> it is probably possible but not something we have actually tried to =
do=20
> with GMapFactory applications.  You should check the ROSA =
documentation=20
> on http://www.maptools.org/.  I would try adding
>=20
> TB_BUT_QUERY_JSACTION
>=20
> and writing a javascript function that would popup a query page =
directly=20
> rather than submit the page.
>=20
> 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=20
> way.  You will have to jump into the code and see what it does if you=20
> use the existing query page.
>=20
> If you ge tthis to work, please let me know and I will incorporate the =

> change into an upcoming release of MapLab.
>=20
> Cheers,
>=20
> Paul
>=20
> Paolo wrote:
>=20
> >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
> > =20
> >
>=20
> --=20
> --
> Paul Spencer
> Applications and Software Development
> DM Solutions Group Inc.
> http://www.dmsolutions.ca
>=20
>=20
> 
------=_NextPart_000_0014_01C37634.BBC67BB0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff background=3D"">
<DIV><FONT face=3DArial size=3D2>Paul,<BR>I''m trying...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>At the moment&nbsp;I allowed the query =
only for a=20
single layer choosen by the user in combo box and saved in a cookie file =
on the=20
client PC.<BR>The string to pass to query.phtml is something like=20
this:<BR><BR>http://192.168.1.1/path/query.phtml?PrevStateKey=3DBBOX=3D11=
13224,4034000,2512776,5241000|SRS=3D|MAPSIZE=3D580,500|<BR>LAYERS=3D0,2,4=
,5,6,7,9&amp;INPUT_COORD=3D121,112&amp;ACTIVE_LAYER=3DRegion<BR><BR>I=20
added the ACTIVE_LAYER parameter in order to pass the layer to a =
slightly=20
modified query.phtml file<BR>In this case, I have to retrieve two =
parameters:=20
BBOX and INPUT_COORD.<BR><BR>For INPUT_COORD, I tried with the following =
code=20
but something doesn't work...:</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>****************************************************************=
**********</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>//this is the code that retrieve =
coordinates inside=20
the applet area.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>//I placed applet with absolute =
position css so=20
numbers in the code</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>//referred only to my applet =
position</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&lt;SCRIPT =
language=3D"JavaScript"&gt;<BR>function=20
init() {<BR>document.onmousedown=3DgetMouseXY;<BR>}<BR>function =
getMouseXY()=20
{<BR>var tempX =3D 0;<BR>var tempY =3D 0;<BR>// grab the x-y pos.s if =
browser is=20
IE<BR>tempX =3D event.clientX + document.body.scrollLeft;<BR>tempY =3D =
event.clientY=20
+ document.body.scrollTop;<BR>if (tempX &gt; 115 &amp;&amp; tempX &lt; =
695=20
&amp;&amp; tempY &gt; 80 &amp;&amp; tempY &lt; 580)<BR>{<BR>if (tempX =
&lt;=20
0){tempX =3D 0;}<BR>if (tempY &lt; 0){tempY =3D 0;}<BR>var X =3D tempX - =
115;<BR>var Y=20
=3D tempY - 80;<BR>alert (X + "," + Y);<BR>}<BR>return=20
true;<BR>}<BR>&lt;/script&gt;<BR>****************************************=
**********************<BR>//this=20
is the code in PHP file:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>echo "&lt;param =
name=3D\"TB_BUT_TEST_JSACTION\"=20
".<BR>"value=3D\"init();\"&gt;\n";</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>**************************************************************</=
FONT><BR></DIV>
<DIV><FONT face=3DArial size=3D2>These javascript functions&nbsp;work =
very well in a=20
normal html page but when I try</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>to get mouse position inside the rosa =
applet area=20
nothing happens...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>tried also to comment different rows in =
getMouse=20
function but</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>no alert with coordinates =
appears.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thank you very much</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Paolo</FONT></DIV>
<DIV><BR><FONT face=3DArial size=3D2>----- Original Message ----- =
<BR>From: "Paul=20
Spencer" &lt;pagameba@magma.ca&gt;<BR>To: "Paolo" =
&lt;noti@ciaoweb.it&gt;<BR>Cc:=20
&lt;maplab-users@dmsolutions.ca&gt;<BR>Sent: Sunday, September 07, 2003 =
9:55=20
PM<BR>Subject: Re: [maplab-users] Refresh of the map with query=20
button<BR><BR><BR>&gt; Paolo,<BR>&gt; <BR>:&gt; it is probably possible =
but not=20
something we have actually tried to do <BR>&gt; with GMapFactory=20
applications.&nbsp; You should check the ROSA documentation <BR>&gt; on=20
http://www.maptools.org/.&nbsp; I would try adding<BR>&gt; <BR>&gt;=20
TB_BUT_QUERY_JSACTION<BR>&gt; <BR>&gt; and writing a javascript function =
that=20
would popup a query page directly <BR>&gt; rather than submit the =
page.<BR>&gt;=20
<BR>&gt; It is likely possible to have it popup the existing query page =
but the=20
<BR>&gt; trick would be to pass the query location and session id in the =
correct=20
<BR>&gt; way.&nbsp; You will have to jump into the code and see what it =
does if=20
you <BR>&gt; use the existing query page.<BR>&gt; <BR>&gt; If you ge =
tthis to=20
work, please let me know and I will incorporate the <BR>&gt; change into =
an=20
upcoming release of MapLab.<BR>&gt; <BR>&gt; Cheers,<BR>&gt; <BR>&gt;=20
Paul<BR>&gt; <BR>&gt; Paolo wrote:<BR>&gt; <BR>&gt; &gt;Hi,<BR>&gt; =
&gt;a=20
question about a GMap application with rosa applet:<BR>&gt; &gt;is it =
possible=20
to avoid refresh of the map (or refresh of the entire page) when I use =
the query=20
button in order to display data in a separate windows. In other words =
I'd like=20
the query button open the new database windows without reloading the map =
in the=20
applet area.<BR>&gt; &gt;I tried changing TB_BUT_QUERY_INPUT&nbsp; =
parameter=20
(submit) but I don't know how to operate and if I have to change php =
code in=20
other files.<BR>&gt; &gt;Thanks in advance.<BR>&gt; &gt;<BR>&gt;=20
&gt;Paolo<BR>&gt; &gt;&nbsp; <BR>&gt; &gt;<BR>&gt; <BR>&gt; -- <BR>&gt;=20
--<BR>&gt; Paul Spencer<BR>&gt; Applications and Software =
Development<BR>&gt; DM=20
Solutions Group Inc.<BR>&gt; http://www.dmsolutions.ca<BR>&gt; <BR>&gt; =
<BR>&gt;=20
</FONT></DIV></BODY></HTML>

------=_NextPart_000_0014_01C37634.BBC67BB0--



This archive was generated by Pipermail.