← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19755: GIS legend names issue fixed.

 

------------------------------------------------------------
revno: 19755
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2015-08-09 18:29:59 +0200
message:
  GIS legend names issue fixed.
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/map.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/mapfish/core/GeoStat/all.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/map.js
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/map.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-apps/src/main/webapp/dhis-web-mapping/scripts/map.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/map.js	2015-08-09 16:17:04 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/map.js	2015-08-09 16:29:59 +0000
@@ -6575,6 +6575,7 @@
                         response = this.gis.response,
                         isPlugin = this.gis.plugin,
                         element = document.createElement("div"),
+                        legendNames = view.legendSet ? view.legendSet.names || {} : {},
                         style = {},
                         child,
                         id,
@@ -6613,16 +6614,16 @@
                             child.style.fontSize = style.fontSize;
                             child.style.backgroundColor = this.colorInterpolation[i].toHexString();
                             child.style.width = style.colorWidth;
-                            child.style.height = view.legendSet.names[i] ? '22px' : style.colorHeight;
+                            child.style.height = legendNames[i] ? '22px' : style.colorHeight;
                             child.style.cssFloat = 'left';
                             child.style.marginRight = style.colorMarginRight;
                             element.appendChild(child);
 
                             child = document.createElement("div");
-                            child.style.height = view.legendSet.names[i] ? '22px' : style.colorHeight;
+                            child.style.height = legendNames[i] ? '22px' : style.colorHeight;
                             child.style.fontSize = style.fontSize;
-                            child.style.lineHeight = view.legendSet.names[i] ? "12px" : "7px";
-                            child.innerHTML = '<div style="color:#222; font-size:10px !important; height:11px; line-height:12px; font-weight:bold;">' + (view.legendSet.names[i] || '') + '</div>';
+                            child.style.lineHeight = legendNames[i] ? "12px" : "7px";
+                            child.innerHTML = '<div style="color:#222; font-size:10px !important; height:11px; line-height:12px; font-weight:bold;">' + (legendNames[i] || '') + '</div>';
                             child.innerHTML += '<div style="color:#222; font-size:10px !important; height:11px; line-height:12px">' + this.classification.bins[i].label + '</div>';
                             element.appendChild(child);
 

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/mapfish/core/GeoStat/all.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/mapfish/core/GeoStat/all.js	2015-04-28 10:32:12 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/mapfish/core/GeoStat/all.js	2015-08-09 16:29:59 +0000
@@ -728,6 +728,7 @@
                 isPlugin = this.gis.plugin,
                 element = document.createElement("div"),
                 style = {},
+                legendNames = view.legendSet ? view.legendSet.names || {} : {},
 				child,
                 id,
                 name;
@@ -764,14 +765,14 @@
 					child = document.createElement("div");
 					child.style.backgroundColor = this.colorInterpolation[i].toHexString();
 					child.style.width = style.colorWidth;
-					child.style.height = view.legendSet.names[i] ? '25px' : style.colorHeight;
+					child.style.height = legendNames[i] ? '25px' : style.colorHeight;
 					child.style.cssFloat = 'left';
 					child.style.marginRight = style.colorMarginRight;
 					element.appendChild(child);
 
 					child = document.createElement("div");
-					child.style.lineHeight = view.legendSet.names[i] ? "12px" : "7px";
-					child.innerHTML = '<b style="color:#222; font-size:10px !important">' + (view.legendSet.names[i] || '') + '</b><br/>' + this.classification.bins[i].label;
+					child.style.lineHeight = legendNames[i] ? "12px" : "7px";
+					child.innerHTML = '<b style="color:#222; font-size:10px !important">' + (legendNames[i] || '') + '</b><br/>' + this.classification.bins[i].label;
 					element.appendChild(child);
 
 					child = document.createElement("div");

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/map.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/map.js	2015-08-09 16:17:04 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/map.js	2015-08-09 16:29:59 +0000
@@ -6575,6 +6575,7 @@
                         response = this.gis.response,
                         isPlugin = this.gis.plugin,
                         element = document.createElement("div"),
+                        legendNames = view.legendSet ? view.legendSet.names || {} : {},
                         style = {},
                         child,
                         id,
@@ -6613,16 +6614,16 @@
                             child.style.fontSize = style.fontSize;
                             child.style.backgroundColor = this.colorInterpolation[i].toHexString();
                             child.style.width = style.colorWidth;
-                            child.style.height = view.legendSet.names[i] ? '22px' : style.colorHeight;
+                            child.style.height = legendNames[i] ? '22px' : style.colorHeight;
                             child.style.cssFloat = 'left';
                             child.style.marginRight = style.colorMarginRight;
                             element.appendChild(child);
 
                             child = document.createElement("div");
-                            child.style.height = view.legendSet.names[i] ? '22px' : style.colorHeight;
+                            child.style.height = legendNames[i] ? '22px' : style.colorHeight;
                             child.style.fontSize = style.fontSize;
-                            child.style.lineHeight = view.legendSet.names[i] ? "12px" : "7px";
-                            child.innerHTML = '<div style="color:#222; font-size:10px !important; height:11px; line-height:12px; font-weight:bold;">' + (view.legendSet.names[i] || '') + '</div>';
+                            child.style.lineHeight = legendNames[i] ? "12px" : "7px";
+                            child.innerHTML = '<div style="color:#222; font-size:10px !important; height:11px; line-height:12px; font-weight:bold;">' + (legendNames[i] || '') + '</div>';
                             child.innerHTML += '<div style="color:#222; font-size:10px !important; height:11px; line-height:12px">' + this.classification.bins[i].label + '</div>';
                             element.appendChild(child);
 

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/map.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/map.js	2015-08-09 16:17:04 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/map.js	2015-08-09 16:29:59 +0000
@@ -6575,6 +6575,7 @@
                         response = this.gis.response,
                         isPlugin = this.gis.plugin,
                         element = document.createElement("div"),
+                        legendNames = view.legendSet ? view.legendSet.names || {} : {},
                         style = {},
                         child,
                         id,
@@ -6613,16 +6614,16 @@
                             child.style.fontSize = style.fontSize;
                             child.style.backgroundColor = this.colorInterpolation[i].toHexString();
                             child.style.width = style.colorWidth;
-                            child.style.height = view.legendSet.names[i] ? '22px' : style.colorHeight;
+                            child.style.height = legendNames[i] ? '22px' : style.colorHeight;
                             child.style.cssFloat = 'left';
                             child.style.marginRight = style.colorMarginRight;
                             element.appendChild(child);
 
                             child = document.createElement("div");
-                            child.style.height = view.legendSet.names[i] ? '22px' : style.colorHeight;
+                            child.style.height = legendNames[i] ? '22px' : style.colorHeight;
                             child.style.fontSize = style.fontSize;
-                            child.style.lineHeight = view.legendSet.names[i] ? "12px" : "7px";
-                            child.innerHTML = '<div style="color:#222; font-size:10px !important; height:11px; line-height:12px; font-weight:bold;">' + (view.legendSet.names[i] || '') + '</div>';
+                            child.style.lineHeight = legendNames[i] ? "12px" : "7px";
+                            child.innerHTML = '<div style="color:#222; font-size:10px !important; height:11px; line-height:12px; font-weight:bold;">' + (legendNames[i] || '') + '</div>';
                             child.innerHTML += '<div style="color:#222; font-size:10px !important; height:11px; line-height:12px">' + this.classification.bins[i].label + '</div>';
                             element.appendChild(child);