← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5747: (GIS) Bug fixed: 'Uncaught RangeError: Invalid array length'.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 5747 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-01-18 14:06:37 +0100
message:
  (GIS) Bug fixed: 'Uncaught RangeError: Invalid array length'.
modified:
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Centroid.js
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Point.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Centroid.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Centroid.js	2012-01-15 13:33:35 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Centroid.js	2012-01-18 13:04:44 +0000
@@ -1101,6 +1101,7 @@
     },
 
     applyValues: function() {
+        this.layer.features = this.featureStorage.slice(0);
         for (var i = 0; i < this.layer.features.length; i++) {
             var f = this.layer.features[i];
             if (!f.attributes.value) {
@@ -1112,6 +1113,11 @@
                 f.attributes.fixedName = G.util.cutString(f.attributes.name, 30);
             }
         }
+        if (!this.layer.features.length) {
+            Ext.message.msg(false, G.i18n.current_selection_no_data);
+            G.vars.mask.hide();
+            return;
+        }
         
 		var options = {
             indicator: 'value',

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js	2012-01-15 13:33:35 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js	2012-01-18 13:04:44 +0000
@@ -1731,6 +1731,7 @@
     },
     
     applyValues: function() {
+        this.layer.features = this.featureStorage.slice(0);
         for (var i = 0; i < this.layer.features.length; i++) {
             var f = this.layer.features[i];            
             if (!f.attributes.value) {
@@ -1742,6 +1743,11 @@
                 f.attributes.fixedName = G.util.cutString(f.attributes.name, 30);
             }
         }
+        if (!this.layer.features.length) {
+            Ext.message.msg(false, G.i18n.current_selection_no_data);
+            G.vars.mask.hide();
+            return;
+        }
         
         this.button.menu.find('name','history')[0].addItem(this);
         

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Point.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Point.js	2012-01-15 13:33:35 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Point.js	2012-01-18 13:04:44 +0000
@@ -1731,6 +1731,7 @@
     },
     
     applyValues: function() {
+        this.layer.features = this.featureStorage.slice(0);
         for (var i = 0; i < this.layer.features.length; i++) {
             var f = this.layer.features[i];
             if (!f.attributes.value) {
@@ -1742,6 +1743,11 @@
                 f.attributes.fixedName = G.util.cutString(f.attributes.name, 30);
             }
         }
+        if (!this.layer.features.length) {
+            Ext.message.msg(false, G.i18n.current_selection_no_data);
+            G.vars.mask.hide();
+            return;
+        }
 
         this.button.menu.find('name','history')[0].addItem(this);