← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12375: Minor fixes.

 

------------------------------------------------------------
revno: 12375
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-10-02 11:11:47 +0200
message:
  Minor fixes.
modified:
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/plugin.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/plugin.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/plugin.js	2013-10-02 08:00:55 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/plugin.js	2013-10-02 09:11:47 +0000
@@ -53,7 +53,6 @@
 		var validateConfig,
 			onRender,
 			afterRender,
-			getViews,
 			createViewport,
 			//gis,
 			initialize;
@@ -73,6 +72,8 @@
 				return;
 			}
 			
+			config.id = config.id || config.uid;
+			
 			if (config.id && !Ext.isString(config.id)) {
 				alert('Invalid map id (' + config.el + ')');
 				return;
@@ -91,55 +92,7 @@
 				Ext.query('.measureButton')[i].innerHTML = '<img src="images/measure_24.png" />';
 			}
 		};
-
-		getViews = function() {
-			var view,
-				views = [],
-				indicator = gis.conf.finals.dimension.indicator.id,
-				dataElement = gis.conf.finals.dimension.dataElement.id,
-				automatic = gis.conf.finals.widget.legendtype_automatic,
-				predefined = gis.conf.finals.widget.legendtype_predefined;
-
-			config.mapViews = config.mapViews || [];
-
-			for (var i = 0; i < config.mapViews.length; i++) {
-				view = config.mapViews[i];
-
-				view = {
-					layer: view.layer || 'thematic1',
-					valueType: view.indicator ? indicator : dataElement,
-					indicator: {
-						id: view.indicator
-					},
-					dataElement: {
-						id: view.dataelement
-					},
-					period: {
-						id: view.period
-					},
-					legendType: view.legendSet ? predefined : automatic,
-					legendSet: view.legendSet,
-					classes: parseInt(view.classes) || 5,
-					method: parseInt(view.method) || 2,
-					colorLow: view.colorLow || 'ff0000',
-					colorHigh: view.colorHigh || '00ff00',
-					radiusLow: parseInt(view.radiusLow) || 5,
-					radiusHigh: parseInt(view.radiusHigh) || 15,
-					organisationUnitLevel: {
-						level: parseInt(view.level) || 2
-					},
-					parentOrganisationUnit: {
-						id: view.parent
-					},
-					opacity: parseFloat(view.opacity) || 0.8
-				};
-
-				views.push(view);
-			}
-
-			return views;
-		};
-
+		
 		createViewport = function() {
 			var viewport,
 				eastRegion,