[fusion-commits] r1233 - in trunk: MapGuide lib

svn_fusion at osgeo.org svn_fusion at osgeo.org
Mon Mar 10 13:46:45 EDT 2008


Author: pagameba
Date: 2008-03-10 13:46:45 -0400 (Mon, 10 Mar 2008)
New Revision: 1233

Modified:
   trunk/MapGuide/MapGuide.js
   trunk/lib/ApplicationDefinition.js
Log:
Closes #20.  Finish up support for layer and group events.

Modified: trunk/MapGuide/MapGuide.js
===================================================================
--- trunk/MapGuide/MapGuide.js	2008-03-10 17:07:46 UTC (rev 1232)
+++ trunk/MapGuide/MapGuide.js	2008-03-10 17:46:45 UTC (rev 1233)
@@ -808,7 +808,7 @@
                 if (o.type == 'layer') {
                     var l = this.layerRoot.findLayer(o.name);
                     if (l) {
-                        if (events[i].enable) {
+                        if (o.enable) {
                             l.show(true);
                         } else {
                             l.hide(true);
@@ -816,9 +816,9 @@
                     }
                     
                 } else if (o.type == 'group') {
-                    var g = this.layerRoot.findGroupByAtribute('groupName', o.name);
+                    var g = this.layerRoot.findGroupByAttribute('groupName', o.name);
                     if (g) {
-                        if (events.enable) {
+                        if (o.enable) {
                             g.show(true);
                         } else {
                             g.hide(true);
@@ -838,7 +838,7 @@
                 if (o.type == 'layer') {
                     var l = this.layerRoot.findLayer(o.name);
                     if (l) {
-                        if (events[i].enable) {
+                        if (o.enable) {
                             l.show(true);
                         } else {
                             l.hide(true);
@@ -846,9 +846,9 @@
                     }
                     
                 } else if (o.type == 'group') {
-                    var g = this.layerRoot.findGroupByAtribute('groupName', o.name);
+                    var g = this.layerRoot.findGroupByAttribute('groupName', o.name);
                     if (g) {
-                        if (events.enable) {
+                        if (o.enable) {
                             g.show(true);
                         } else {
                             g.hide(true);
@@ -979,7 +979,7 @@
         }
     },
     
-    hide: function(nodraw) {
+    hide: function(noDraw) {
         if (!this.visible) {
             return;
         }

Modified: trunk/lib/ApplicationDefinition.js
===================================================================
--- trunk/lib/ApplicationDefinition.js	2008-03-10 17:07:46 UTC (rev 1232)
+++ trunk/lib/ApplicationDefinition.js	2008-03-10 17:46:45 UTC (rev 1233)
@@ -419,7 +419,7 @@
             for (var i=0; i<jsonNode.Map.length; i++) {
                 var map = new Fusion.Lib.ApplicationDefinition.Map(jsonNode.Map[i]);
                 var links = {groups:[], layers:[]};
-                var mapevents = {layerEvents:{},groupEvents:{}};
+                var mapEvents = {layerEvents:{},groupEvents:{}};
                 if (jsonNode.Map[i].Extension) {
                     var extension = jsonNode.Map[i].Extension[0];
                     if (extension.Links) {
@@ -447,11 +447,11 @@
                                 layerObj.name = layer.Name[0];
                                 layerObj.onEnable = [];
                                 if (layer.OnEnable instanceof Array) {
-                                    layerObj.onEnable = this.parseMapEventSubBlock(layer.onEnable[0]);
+                                    layerObj.onEnable = this.parseMapEventSubBlock(layer.OnEnable[0]);
                                 }
                                 layerObj.onDisable = [];
                                 if (layer.OnDisable instanceof Array) {
-                                    layerObj.onDisable = this.parseMapEventSubBlock(layer.onDisable[0]);
+                                    layerObj.onDisable = this.parseMapEventSubBlock(layer.OnDisable[0]);
                                 }
                                 mapEvents.layerEvents[layerObj.name] = layerObj;
                             }
@@ -463,11 +463,11 @@
                                 groupObj.name = group.Name[0];
                                 groupObj.onEnable = [];
                                 if (layer.OnEnable instanceof Array) {
-                                    groupObj.onEnable = this.parseMapEventSubBlock(group.onEnable[0]);
+                                    groupObj.onEnable = this.parseMapEventSubBlock(group.OnEnable[0]);
                                 }
                                 groupObj.onDisable = [];
                                 if (layer.OnDisable instanceof Array) {
-                                    groupObj.onDisable = this.parseMapEventSubBlock(group.onDisable[0]);
+                                    groupObj.onDisable = this.parseMapEventSubBlock(group.OnDisable[0]);
                                 }
                                 mapEvents.groupEvents[groupObj.name] = groupObj;
                             }
@@ -484,7 +484,7 @@
     
     parseMapEventSubBlock: function(block) {
         var a = [];
-        if (block.Layer) {
+        if (block.Layer && block.Layer instanceof Array) {
             for (var i=0; i<block.Layer.length; i++) {
                 var layer = block.Layer[i];
                 a.push({type: 'layer', name:layer.Name[0], enable: layer.Enable[0] == 'true' ? true : false});
@@ -492,7 +492,7 @@
         }
         if (block.Group && block.Group instanceof Array) {
             for (var i=0; i<block.Group.length; i++) {
-                var layer = block.Group[i];
+                var group = block.Group[i];
                 a.push({type: 'group', name:group.Name[0], enable: group.Enable[0] == 'true' ? true : false});
             }            
         }



More information about the fusion-commits mailing list