[fusion-users] Mapguide Eventhandling with Fusion.

Tómas Guðmundsson tomas at snertill.is
Thu May 15 05:37:23 EDT 2008


Paul,

I tried this and it works but it gives me an error. 
Inside the function triggerEvent on line 1041 inside
fusion.js it gives me an error with a popup alert :
Fusion Error:
WARNING: Exception occurred in AJAX callback.
TypeError: this.events[eventID][i] has no properties
Location: undefined (1041)
xx)

Where undefined is actually fusion.js and line 1041.
Here is the function I have running in a javascript
widget that is being executed.
this.getMap().registerForEvent(Fusion.Event.MAP_BUSY_CHANGED, alert('MAP_BUSY_CHANGED'));

Regards,
Tómas.

-----Original Message-----
From: Paul Spencer [mailto:pspencer at dmsolutions.ca] 
Sent: 14. maí 2008 17:39
To: Tómas Guðmundsson
Cc: fusion-users at lists.osgeo.org
Subject: Re: [fusion-users] Mapguide Eventhandling with Fusion.

Tómas,

these are not the droids you are looking for!  These events only  
relate to loading the map definition from the server, not drawing the  
map.  You want Fusion.Event.MAP_BUSY_CHANGED.  This gets called when  
the map starts drawing and again when it is finished, but you need to  
check map.isBusy to see if the map is still busy or not because  
several busy states can be queued up.

Cheers

Paul

On 14-May-08, at 12:57 PM, Tómas Guðmundsson wrote:

> Hi all.
>
> I just conducted a little experiment with the Event Handlers in Map.js
>
>        map.registerForEvent(Fusion.Event.MAP_LOADING,  
> alert('MAP_LOADING'));
>         
> map.registerForEvent(Fusion.Event.MAP_LOADED,alert('MAP_LOADED'));
>         
> map.registerForEvent(Fusion.Event.MAP_RELOADED,alert('MAP_RELOADED'));
>
> And what I originally thought what would happen that it would give  
> me an alert
> at first when it was loading, and then when it would load. Then I  
> thought it would
> give me the third alert when i pressed the refresh map button. But,  
> what happened
> was before the map was ready or visible to me, they all loaded  
> consecutively so
> I got three alerts in a row.
>
> If anyone can tell me why this is or what the reasons are behind  
> that I would really
> appreciate that. Also if anyone can tell me how to find out when the  
> map is visible,
> after a refresh or after any (first or last time a user) sees the  
> gray background of
> the map itself.
>
> Regards,
> Tómas.
> _______________________________________________
> fusion-users mailing list
> fusion-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fusion-users


__________________________________________

    Paul Spencer
    Chief Technology Officer
    DM Solutions Group Inc
    http://www.dmsolutions.ca/



More information about the fusion-users mailing list