Hi everybody,

I need some help on refreshing the map area every 60 seconds automatically, 
without pressing the refresh button.
I was using p.mapper 3.0 for a while, but recently I updated it to p.mapper 
3.1 (release) with MS4W 2.2.4 (mapserver 4.10.2, PHP 5.2.3, mapscript 
4.10.2, Apache 2.2.4)

In the previous version of p.mapper I made a small modification, with the 
aid of Armin [1], to automatically refresh the map once every minute.
In the map.phtml I changed:
   <body class="BGCLG" >
to:
   <body class="BGCLG" onload="runPeriodically();">

where runPeriodically() is a tiny javascript:

function runPeriodically() {
    window.setTimeout('runPeriodically()', 60000 );
    reloadMap(false);
}

and is defined in pminit.js

The previous code worked perfectly in version 3, but now, in version 3.1 it 
behaves different (the "auto refresh" is working, but I don't know when it 
comes).
The first thing I have noticed is that the loading splash (animated GIF) is 
never displayed at the "auto refresh" event. It does not appear the GIF 
either when the refresh button is pressed (I do not know if this this 
related), but with the previous version of p.mapper it did.
The thing is that now I don't know when the refreshing is coming up, as I 
knew before due to the "loading GIF". Perhaps i'm missing something, I'm not 
a javascript expert...
I saw that reloadMap() function uses updateMap(), which has been modified 
slightly since version 3.0.

So, the question is: Why at some events (reload/refresh, runPeriodically(), 
etc.) the "loading splash" is not displayed, but in other events (e.g.: zoom 
in or out, pan, etc.) the GIF is displayed?

Other problem I have is that I need to show the count down between every 
auto refresh. I have tried with a little function displayCountDown() that 
shows the counter in the status bar (with window.status="Next update in " + 
seconds + " s.") but I don't know where I must put the function in order to 
obtain the wished behavior.
I have tested this function:

function displayCountDown() {
 if (seconds>=0) {
    seconds-=1;
 }
 if (seconds<=-1) {
    seconds+=1;
 }
 else {
    window.status="Next update in " + seconds + " s.";
    setTimeout("displayCountDown()",1000);
 }
}

in a separate HTML file and it worked fine. But my attempts to integrate it 
to p.mapper have failed. My greatest progress was to show the count down 
until the first auto refresh and then it stops to work.


Any idea or advice on this will be very helpful.
Thanks in advance for your comments.

Regards,
Gaston.

[1] 
http://www.mail-archive.com/pmapper-users@lists.sourceforge.net/msg01080.html




-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
pmapper-users mailing list
pmapper-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pmapper-users

Reply via email to