[mapguide-users] AJAX viewer busy state
Kenneth, GEOGRAF A/S
ks at geograf.dk
Thu Jul 19 03:50:33 EDT 2007
I have not tried to implement a "Stop" feature.
It might be difficult, since the requests are not stored in a list, and
thus cannot be easily canceled.
You should look into the "ajaxmappane.templ" file for
"RequestMap"/"OnMapRequested".
The busystate is easy in 1.2, since the loading marker is present.
You can hook into the code that updates the "loading" marker like this:
var isBusy = true;
var loading = null;
var loaded = null;
function myLoading()
{
isBusy = true;
loading();
}
function myLoaded()
{
isBusy = false;
loaded();
}
loading = iframe.GetMapFrame().OnMapLoading;
loaded = iframe.GetMapFrame().OnMapLoaded;
iframe.GetMapFrame().OnMapLoaded = myLoaded;
iframe.GetMapFrame().OnMapLoading = myLoading;
If you must support 1.1 or older, you can look at the code that calls
OnMapLoaded/OnMapLoading in 1.2, and retrofit that into an older
version. If you do it by hooking into the functionality, you don't have
to modify the viewer files.
Regards, Kenneth, GEOGRAF A/S
Jackie Ng skrev:
> Hello all,
>
> The old MapGuide viewer had the ability to stop pending requests, and also
> maintained a busy state that can be queried from javascript.
>
> Does the AJAX viewer have such a "busy state" variable? Is there a way for
> us to cancel all current mapagent requests from the viewer?
>
> - Jackie
>
More information about the mapguide-users
mailing list