[ZS2] Re: [mapguide-users] [ZS2] refresh script - Invoke Script

Kenneth Skovhede, GEOGRAF A/S ks at geograf.dk
Thu Dec 4 13:27:02 EST 2008


As I wrote (and as is explained in the link), the setInterval() function 
returns
a timerId. You can then pass this to the clearInterval() function to 
stop it:

window.refreshTimerId = null;

function StartRefreshTimer()
{
    if (window.refreshTimerId == null)
       window.refreshTimerId = 
window.setInterval('GetMapFrame().Refresh()', 10000);
    else
       alert('Already refreshing!');
}

function StopRefreshTimer()
{
    if (window.refreshTimerId != null)
    {
        window.clearInterval(window.refreshTimerId);
        window.refreshTimerId = null;
    }
    else
       alert('Was not refreshing!');
}

Regards, Kenneth Skovhede, GEOGRAF A/S



ajid1980 skrev:
> What is the criteria for stopping it? 
> My Criteria it depends on my script like this (called=START) <
> window.setInterval('GetMapFrame().Refresh()', 10000); > So i want to make
> other Invoke Script (called=STOP) to Stop it.. I tried many many java
> scripts to stop the refresh function.. so anyone help how??or other method
> ?? 
>
>
>
>
>
> Kenneth Skovhede, GEOGRAF A/S wrote:
>   
>> What is the criteria for stopping it?
>>
>> See the "clearInterval" method:
>> http://www.elated.com/articles/javascript-timers-with-settimeout-and-setinterval/
>>
>> Regards, Kenneth Skovhede, GEOGRAF A/S
>>
>>
>>
>> ajid1980 skrev:
>>     
>>> hai all 
>>> i found the refresh script and put it on Invoke Script <
>>> window.setInterval('GetMapFrame().Refresh()', 10000); >
>>> So how i wanna to stop it??
>>> Thanx
>>>   
>>>       
>> _______________________________________________
>> mapguide-users mailing list
>> mapguide-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>
>>
>>     
>
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20081204/0e292dd8/attachment.html


More information about the mapguide-users mailing list