Adding Events In Fusion

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding Events In Fusion

Rodolfo Moreno
Hi All,
I want to add an event to fusion, exactly in the moment when the user turns on or off a layer.
I saw the code sample in the COOKBOOK: http://trac.osgeo.org/fusion/wiki/Cookbook/Fusion/Events
I followed all steps of the COOKBOOK however I get an error on the following line:

stateChanged: function(obj, event) {
        if (obj.legend && obj.legend.treeItem.checkBox) {
            if (obj.legend.treeItem.checkBox.checked) {
                this.triggerEvent(Fusion.Event.LEGEND_LAYER_VIS_ON, obj);
                obj.show();
            } else {
                this.triggerEvent(Fusion.Event.LEGEND_LAYER_VIS_OFF, obj);
                obj.hide();
            }
        }
        OpenLayers.Event.stop(event, true);
    },

The message that I got is: "The object does not support this property or method"
In the debug mode I saw that effectively this object does not have the triggerEvent method.
I suppose that this error is due to the code sample from the cookbook is related with older fusion versions.

I am using the fusion version that come with MapGuide OS 2.2
I would appreciate so much for any suggestions. Thanks in advance.
Rodolfo



Reply | Threaded
Open this post in threaded view
|

Re: Adding Events In Fusion

zspitzer
that version of mapguide and fusion is ancient, can you upgrade?

the amount of bug fixes, performance improvement and improvements
since 2.2 are huge




On Wed, Nov 27, 2013 at 5:49 PM, Rodolfo Moreno <[hidden email]> wrote:
Hi All,
I want to add an event to fusion, exactly in the moment when the user turns
on or off a layer.
I saw the code sample in the COOKBOOK:
http://trac.osgeo.org/fusion/wiki/Cookbook/Fusion/Events
I followed all steps of the COOKBOOK however I get an error on the following
line:

stateChanged: function(obj, event) {
        if (obj.legend && obj.legend.treeItem.checkBox) {
            if (obj.legend.treeItem.checkBox.checked) {
                *this.triggerEvent(Fusion.Event.LEGEND_LAYER_VIS_ON, obj);*
                obj.show();
            } else {
                this.triggerEvent(Fusion.Event.LEGEND_LAYER_VIS_OFF, obj);
                obj.hide();
            }
        }
        OpenLayers.Event.stop(event, true);
    },

The message that I got is: "The object does not support this property or
method"
In the debug mode I saw that effectively *this* object does not have the
triggerEvent method.
I suppose that this error is due to the code sample from the cookbook is
related with older fusion versions.

I am using the fusion version that come with MapGuide OS 2.2
I would appreciate so much for any suggestions. Thanks in advance.
Rodolfo







--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Adding-Events-In-Fusion-tp5091395.html
Sent from the Fusion Users mailing list archive at Nabble.com.
_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users



--
Zac Spitzer
+61 405 847 168


_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
Reply | Threaded
Open this post in threaded view
|

Re: Adding Events In Fusion

Rodolfo Moreno
Hi Zac,
This web mapping application is in production enviroment and what they need is to add new functionality as soon as posible.
I have already talked about it to migrate to the last mapguide version but this is planned for the early months of the next year.
Regards,
Reply | Threaded
Open this post in threaded view
|

Re: Adding Events In Fusion

Rodolfo Moreno
Hi Zac,
Is this problem solved in the mapguide os 2.5 version? or I still have to do some code modifications to capture the turn on/off layer event.
Thanks in advance.