You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by jo...@apache.org on 2013/06/13 01:17:02 UTC

svn commit: r1492475 - in /incubator/climate/trunk/rcmet/src/main/ui/app: index.html js/directives.js js/directives/ js/directives/LeafletMap.js

Author: joyce
Date: Wed Jun 12 23:17:01 2013
New Revision: 1492475

URL: http://svn.apache.org/r1492475
Log:
CLIMATE-96 progress - Moves LeafletMap directive to separate file

Added:
    incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/
    incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/LeafletMap.js
Modified:
    incubator/climate/trunk/rcmet/src/main/ui/app/index.html
    incubator/climate/trunk/rcmet/src/main/ui/app/js/directives.js

Modified: incubator/climate/trunk/rcmet/src/main/ui/app/index.html
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/index.html?rev=1492475&r1=1492474&r2=1492475&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/index.html (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/index.html Wed Jun 12 23:17:01 2013
@@ -237,5 +237,6 @@
   <script src="js/controllers/SettingsCtrl.js"></script>
   <script src="js/filters.js"></script>
   <script src="js/directives.js"></script>
+  <script src="js/directives/LeafletMap.js"></script>
 </body>
 </html>

Modified: incubator/climate/trunk/rcmet/src/main/ui/app/js/directives.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/js/directives.js?rev=1492475&r1=1492474&r2=1492475&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/js/directives.js (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/js/directives.js Wed Jun 12 23:17:01 2013
@@ -1,26 +1,7 @@
 'use strict';
 
-// Directive for dealing with the Leaflet map
-angular.module('rcmes').
-directive('leafletMap', function($rootScope) {
-	return {
-		restrict: 'E',
-		replace: true,
-		template: '<div></div>',
-		link: function(scope, element, attrs) {
-			$rootScope.map = L.map(attrs.id, {
-				center: [40, 0],
-				zoom: 2,
-				scrollWheelZoom: false,
-			});
-			//create a CloudMade tile layer and add it to the map
-			L.tileLayer('http://{s}.tile.cloudmade.com/57cbb6ca8cac418dbb1a402586df4528/997/256/{z}/{x}/{y}.png', {
-				maxZoom: 4, minZoom: 2,
-			}).addTo($rootScope.map);
-		}
-	};
-}).
 // Directive for inserting bootstrap modals
+angular.module('rcmes').
 directive('bootstrapModal', function($timeout) {
 	var link = function(scope, elem, attrs) {
 		var escapeEvent;

Added: incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/LeafletMap.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/LeafletMap.js?rev=1492475&view=auto
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/LeafletMap.js (added)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/LeafletMap.js Wed Jun 12 23:17:01 2013
@@ -0,0 +1,36 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements.See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License.You may obtain a copy of the License at
+// 
+// http://www.apache.org/licenses/LICENSE-2.0
+// 
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// Directive for dealing with the Leaflet map
+angular.module('rcmes').directive('leafletMap', function($rootScope) {
+	return {
+		restrict: 'E',
+		replace: true,
+		template: '<div></div>',
+		link: function(scope, element, attrs) {
+			$rootScope.map = L.map(attrs.id, {
+				center: [40, 0],
+				zoom: 2,
+				scrollWheelZoom: false,
+			});
+			//create a CloudMade tile layer and add it to the map
+			L.tileLayer('http://{s}.tile.cloudmade.com/57cbb6ca8cac418dbb1a402586df4528/997/256/{z}/{x}/{y}.png', {
+				maxZoom: 4, minZoom: 2,
+			}).addTo($rootScope.map);
+		}
+	};
+});