dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #07679
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2230: (GIS) Label bug fixed.
Merge authors:
Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 2230 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: trunk
timestamp: Sat 2010-09-25 00:46:21 +0200
message:
(GIS) Label bug fixed.
modified:
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/core/GeoStat.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/Mapping.js
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Symbol.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/core/GeoStat.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/core/GeoStat.js 2010-09-22 03:39:22 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/core/GeoStat.js 2010-09-24 22:44:20 +0000
@@ -248,7 +248,7 @@
maxDec = dec > maxDec ? dec : maxDec;
}
- maxDec = maxDec > 2 ? 2 : maxDec;
+ maxDec = maxDec > 3 ? 3 : maxDec;
for (var i = 0; i < nbBins; i++) {
bins[i] = new mapfish.GeoStat.Bin(binCount[i], bounds[i], bounds[i + 1], i == (nbBins - 1));
=== 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 2010-09-23 19:10:28 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js 2010-09-24 22:44:20 +0000
@@ -1539,12 +1539,7 @@
for (var j = 0; j < FEATURE[thematicMap].length; j++) {
if (mapvalues[i].orgUnitName == FEATURE[thematicMap][j].attributes.name) {
FEATURE[thematicMap][j].attributes.value = parseFloat(mapvalues[i].value);
- if (!FEATURE[thematicMap][j].attributes.labelString) {
- FEATURE[thematicMap][j].attributes.labelString = FEATURE[thematicMap][j].attributes.name;
- if (Ext.isNumber(FEATURE[thematicMap][j].attributes.value)) {
- FEATURE[thematicMap][j].attributes.labelString += ' (' + FEATURE[thematicMap][j].attributes.value.toFixed(1) + ')';
- }
- }
+ FEATURE[thematicMap][j].attributes.labelString = FEATURE[thematicMap][j].attributes.name + ' (' + FEATURE[thematicMap][j].attributes.value + ')';
break;
}
}
@@ -1645,12 +1640,7 @@
FEATURE[thematicMap][j].attributes.value = value ? parseFloat(value) : '';
FEATURE[thematicMap][j].data.id = FEATURE[thematicMap][j].attributes[nameColumn];
FEATURE[thematicMap][j].data.name = FEATURE[thematicMap][j].attributes[nameColumn];
- if (!FEATURE[thematicMap][j].attributes.labelString) {
- FEATURE[thematicMap][j].attributes.labelString = FEATURE[thematicMap][j].attributes[nameColumn];
- if (Ext.isNumber(FEATURE[thematicMap][j].attributes.value)) {
- FEATURE[thematicMap][j].attributes.labelString += ' (' + FEATURE[thematicMap][j].attributes.value.toFixed(1) + ')';
- }
- }
+ FEATURE[thematicMap][j].attributes.labelString = FEATURE[thematicMap][j].attributes[nameColumn] + ' (' + FEATURE[thematicMap][j].attributes.value + ')';
}
this.applyValues();
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Mapping.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Mapping.js 2010-08-05 12:55:57 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Mapping.js 2010-09-24 22:44:20 +0000
@@ -577,16 +577,6 @@
}
MAP.setCenter(new OpenLayers.LonLat(MAPDATA[ACTIVEPANEL].longitude, MAPDATA[ACTIVEPANEL].latitude));
}
-
- if (MAPVIEW) {
- if (MAPVIEW.longitude && MAPVIEW.latitude && MAPVIEW.zoom) {
- MAP.setCenter(new OpenLayers.LonLat(MAPVIEW.longitude, MAPVIEW.latitude), MAPVIEW.zoom);
- }
- else {
- MAP.setCenter(new OpenLayers.LonLat(MAPDATA[ACTIVEPANEL].longitude, MAPDATA[ACTIVEPANEL].latitude), MAPDATA[ACTIVEPANEL].zoom);
- }
- MAPVIEW = false;
- }
var polygonLayer = MAP.getLayersByName('Polygon layer')[0];
FEATURE[thematicMap] = polygonLayer.features;
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Symbol.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Symbol.js 2010-09-23 19:10:28 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Symbol.js 2010-09-24 22:44:20 +0000
@@ -1434,12 +1434,7 @@
for (var j = 0; j < FEATURE[thematicMap2].length; j++) {
if (mapvalues[i].orgUnitName == FEATURE[thematicMap2][j].attributes.name) {
FEATURE[thematicMap2][j].attributes.value = parseFloat(mapvalues[i].value);
- if (!FEATURE[thematicMap2][j].attributes.labelString) {
- FEATURE[thematicMap2][j].attributes.labelString = FEATURE[thematicMap2][j].attributes.name;
- if (Ext.isNumber(FEATURE[thematicMap2][j].attributes.value)) {
- FEATURE[thematicMap2][j].attributes.labelString += ' (' + FEATURE[thematicMap2][j].attributes.value.toFixed(1) + ')';
- }
- }
+ FEATURE[thematicMap2][j].attributes.labelString = FEATURE[thematicMap2][j].attributes.name + ' (' + FEATURE[thematicMap2][j].attributes.value + ')';
break;
}
}
@@ -1527,6 +1522,7 @@
url: path_mapping + 'getAvailableMapOrganisationUnitRelations' + type,
method: 'POST',
params: { mapLayerPath: mapLayerPath },
+ scope: this,
success: function(r) {
var relations = Ext.util.JSON.decode(r.responseText).mapOrganisationUnitRelations;
@@ -1539,12 +1535,7 @@
FEATURE[thematicMap2][j].attributes.value = value ? parseFloat(value) : '';
FEATURE[thematicMap2][j].data.id = FEATURE[thematicMap2][j].attributes[nameColumn];
FEATURE[thematicMap2][j].data.name = FEATURE[thematicMap2][j].attributes[nameColumn];
- if (!FEATURE[thematicMap2][j].attributes.labelString) {
- FEATURE[thematicMap2][j].attributes.labelString = FEATURE[thematicMap2][j].attributes[nameColumn];
- if (Ext.isNumber(FEATURE[thematicMap2][j].attributes.value)) {
- FEATURE[thematicMap2][j].attributes.labelString += ' (' + FEATURE[thematicMap2][j].attributes.value.toFixed(1) + ')';
- }
- }
+ FEATURE[thematicMap2][j].attributes.labelString = FEATURE[thematicMap2][j].attributes[nameColumn] + ' (' + FEATURE[thematicMap2][j].attributes.value + ')';
}
this.applyValues();