|
||||
[maplab-users] Refresh of the map with query buttonPaul Spencer spencer@dmsolutions.caMon, 08 Sep 2003 12:22:04 -0400
|
Paolo, you should be able to retrieve the input coords from document.forms[0].INPUT_COORD.value. ROSA is configured (by default, anyway) to place the coordinates of mouse clicks in this form variable. So you would do something like: <script language="JavaScript"> fucntion init() { alert( "INPUT_COORD value is " + document.forms[0].INPUT_COORD.value ); } </SCRIPT> Note that this will return you a value that looks like: 112,132;112,132 Cheers, Paul Paolo wrote: >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=BBOX=1113224,4034000,2512776,5241000|SRS=|MAPSIZE=580,500| >LAYERS=0,2,4,5,6,7,9&INPUT_COORD=121,112&ACTIVE_LAYER=Region > >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="JavaScript"> >function init() { >document.onmousedown=getMouseXY; >} >function getMouseXY() { >var tempX = 0; >var tempY = 0; >// grab the x-y pos.s if browser is IE >tempX = event.clientX + document.body.scrollLeft; >tempY = event.clientY + document.body.scrollTop; >if (tempX > 115 && tempX < 695 && tempY > 80 && tempY < 580) >{ >if (tempX < 0){tempX = 0;} >if (tempY < 0){tempY = 0;} >var X = tempX - 115; >var Y = tempY - 80; >alert (X + "," + Y); >} >return true; >} ></script> >************************************************************** >//this is the code in PHP file: >echo "<param name=\"TB_BUT_TEST_JSACTION\" ". >"value=\"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 ----- >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 >> >> >> >> > > > -- -- Paul Spencer Applications and Software Development DM Solutions Group Inc. http://www.dmsolutions.ca
This archive was generated by Pipermail. |
MapTools.org -- Hosted by DM Solutions Group |