climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r1487013 - /incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers.js
Date Tue, 28 May 2013 17:37:05 GMT
Author: joyce
Date: Tue May 28 17:37:05 2013
New Revision: 1487013

URL: http://svn.apache.org/r1487013
Log:
Resolves CLIMATE 37 - Skip disabled overlays in map drawing routine

Modified:
    incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers.js

Modified: incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers.js?rev=1487013&r1=1487012&r2=1487013&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers.js (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers.js Tue May 28 17:37:05 2013
@@ -21,8 +21,15 @@ function WorldMapCtrl($rootScope, $scope
  			$rootScope.rectangleGroup = L.layerGroup();
  			
  			// Loop through datasets and add rectangles to Group 
-			var i = 0;
+			var i = -1;
  			angular.forEach($scope.datasets, function(dataset) {
+				// Keep track of dataset count for displaying colors
+				i++;
+
+				// If the user disabled the overlay then get out of here!
+				if (!dataset.shouldDisplay)
+					return;
+
  				// Get bounds from dataset 
  				var maplatlon = dataset.latlonVals;
  				var bounds = [[maplatlon.latMax, maplatlon.lonMin], 
@@ -36,7 +43,6 @@ function WorldMapCtrl($rootScope, $scope
 
  				// Add layer to Group
  				$rootScope.rectangleGroup.addLayer(polygon);
-				i++;
  			});
 
 			// Draw user selected region



Mime
View raw message