dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #25539
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12697: (GIS) Orgunit bug fixed.
Merge authors:
Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 12697 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-10-15 21:58:11 +0200
message:
(GIS) Orgunit bug fixed.
modified:
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/mapfish/core/GeoStat/all.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/app/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js 2013-10-11 11:44:58 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js 2013-10-15 19:57:13 +0000
@@ -913,6 +913,8 @@
return;
}
+ layer.core.featureStore.loadFeatures(features.slice(0));
+
loadData(view, features);
},
failure: function(r) {
@@ -924,7 +926,7 @@
loadData = function(view, features) {
view = view || layer.core.view;
- features = features || layer.features.slice(0);
+ features = features || layer.core.featureStore.features;
for (var i = 0; i < features.length; i++) {
features[i].attributes.label = features[i].attributes.name;
@@ -934,8 +936,6 @@
layer.removeFeatures(layer.features);
layer.addFeatures(features);
- layer.core.featureStore.loadFeatures(layer.features.slice(0));
-
loadLegend(view);
};
@@ -1190,6 +1190,8 @@
return;
}
+ layer.core.featureStore.loadFeatures(features.slice(0));
+
loadData(view, features);
},
failure: function(r) {
@@ -1201,7 +1203,7 @@
loadData = function(view, features) {
view = view || layer.core.view;
- features = features || layer.features.slice(0);
+ features = features || layer.core.featureStore.features;
var dimConf = gis.conf.finals.dimension,
paramString = '?',
@@ -1296,8 +1298,6 @@
layer.removeFeatures(layer.features);
layer.addFeatures(newFeatures);
- layer.core.featureStore.loadFeatures(layer.features.slice(0));
-
gis.response = response;
loadLegend(view);
@@ -1581,6 +1581,8 @@
return;
}
+ layer.core.featureStore.loadFeatures(features.slice(0));
+
loadData(view, features);
},
failure: function(r) {
@@ -1592,7 +1594,7 @@
loadData = function(view, features) {
view = view || layer.core.view;
- features = features || layer.features.slice(0);
+ features = features || layer.core.featureStore.features;
for (var i = 0; i < features.length; i++) {
features[i].attributes.label = features[i].attributes.name;
@@ -1601,8 +1603,6 @@
layer.removeFeatures(layer.features);
layer.addFeatures(features);
- layer.core.featureStore.loadFeatures(layer.features.slice(0));
-
loadLegend(view);
};
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/mapfish/core/GeoStat/all.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/mapfish/core/GeoStat/all.js 2013-09-25 13:17:00 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/mapfish/core/GeoStat/all.js 2013-10-15 19:57:13 +0000
@@ -331,7 +331,7 @@
CLASS_NAME: "mapfish.GeoStat.Facility"
});
-mapfish.GeoStat.createThematic = function(name) {
+mapfish.GeoStat.createThematic = function(name) {
mapfish.GeoStat[name] = OpenLayers.Class(mapfish.GeoStat, {
colors: [new mapfish.ColorRgb(120, 120, 0), new mapfish.ColorRgb(255, 0, 0)],
@@ -354,13 +354,15 @@
loadFeatures: function(features) {
if (features && features.length) {
var data = [];
+
+ this.features = features;
+
for (var i = 0; i < features.length; i++) {
data.push([features[i].attributes.id, features[i].attributes.name]);
}
this.loadData(data);
this.sortStore();
- this.features = features;
}
else {
this.removeAll();
@@ -445,7 +447,7 @@
createColorInterpolation: function() {
var numColors = this.classification.bins.length;
-
+
if (!this.view.legendSet) {
this.colorInterpolation = mapfish.ColorRgb.getColorsArrayByRgbInterpolation(this.colors[0], this.colors[1], numColors);
}
@@ -526,7 +528,7 @@
var element = document.createElement("div"),
child,
legendNames;
-
+
// data
child = document.createElement("div");
child.style.height = "14px";
@@ -538,7 +540,7 @@
child = document.createElement("div");
child.style.clear = "left";
element.appendChild(child);
-
+
// period
child = document.createElement("div");
child.style.height = "14px";
@@ -550,13 +552,13 @@
child = document.createElement("div");
child.style.clear = "left";
element.appendChild(child);
-
+
// separator
child = document.createElement("div");
child.style.width = "1px";
child.style.height = "5px";
element.appendChild(child);
-
+
// legends
if (this.view.legendSet) {
for (var i = 0; i < this.classification.bins.length; i++) {
@@ -597,7 +599,7 @@
element.appendChild(child);
}
}
-
+
this.layer.legendPanel.update(element.outerHTML);
},