climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r1502050 - /incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/WorldMapCtrl.js
Date Wed, 10 Jul 2013 23:09:31 GMT
Author: joyce
Date: Wed Jul 10 23:09:31 2013
New Revision: 1502050

URL: http://svn.apache.org/r1502050
Log:
CLIMATE-188 - Update map overlays

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

Modified: incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/WorldMapCtrl.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/WorldMapCtrl.js?rev=1502050&r1=1502049&r2=1502050&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/WorldMapCtrl.js (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/WorldMapCtrl.js Wed Jul 10
23:09:31 2013
@@ -60,21 +60,6 @@ function($rootScope, $scope, selectedDat
 			$rootScope.rectangleGroup.addLayer(polygon);
 		});
 
-		// Draw user selected region
-		if ($scope.regionParams.areValid) {
-
-			var bounds = [[$scope.regionParams.latMax, $scope.regionParams.lonMin],
-						  [$scope.regionParams.latMin, $scope.regionParams.lonMax]];
-
-			var polygon = L.rectangle(bounds, {
-				color: '#000000',
-				opacity: 1.0,
-				fill: false,
-			});
-
-			$rootScope.rectangleGroup.addLayer(polygon);
-		}
-
 		// Add rectangle Group to map
 		$rootScope.rectangleGroup.addTo($rootScope.map);
 
@@ -95,7 +80,32 @@ function($rootScope, $scope, selectedDat
 		}
 
 		var overlapBounds = [[latMax, lonMin], [latMin, lonMax]];
-		$rootScope.map.fitBounds(overlapBounds, {padding: [5, 5]});
+		$rootScope.map.fitBounds(overlapBounds, {padding: [0, 0]});
+
+		// Draw border around overlap region
+		var overlapBorder = L.rectangle(overlapBounds, {
+			color: '#000000',
+			opacity: 1.0,
+			fill: false,
+		});
+
+		$rootScope.rectangleGroup.addLayer(overlapBorder);
+
+		// Draw user selected region
+		if ($scope.regionParams.areValid) {
+
+			var bounds = [[$scope.regionParams.latMax, $scope.regionParams.lonMin],
+						  [$scope.regionParams.latMin, $scope.regionParams.lonMax]];
+
+			var polygon = L.rectangle(bounds, {
+				color: '#000000',
+				opacity: .3,
+				stroke: false,
+				fill: true,
+			});
+
+			$rootScope.rectangleGroup.addLayer(polygon);
+		}
 	};
 
 	$scope.$on('redrawOverlays', function(event, parameters) {



Mime
View raw message