← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10516: (GIS) OpenStreetMap reintroduced.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 10516 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-04-10 17:21:42 +0200
message:
  (GIS) OpenStreetMap reintroduced.
modified:
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/index.html
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.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/index.html'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/index.html	2013-03-07 08:59:38 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/index.html	2013-04-10 15:15:53 +0000
@@ -33,6 +33,7 @@
     <script type="text/javascript" src="scripts/ext-ux/ext-ux-custom.js"></script>
 
     <script type="text/javascript" src="scripts/openlayers/OpenLayers.js"></script>
+    <script type="text/javascript" src="scripts/openlayers/script/OpenStreetMap.js"></script>
     <script type="text/javascript" src="scripts/openlayers-ux/newSelectFeature.js"></script>
     <script type="text/javascript" src="scripts/openlayers-ux/Circle.js"></script>
 

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js	2013-04-02 10:38:21 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js	2013-04-10 15:15:53 +0000
@@ -4966,10 +4966,6 @@
 				gis.olmap.mask = Ext.create('Ext.LoadMask', vp.getEl(), {
 					msg: 'Loading'
 				});
-
-				if (!window.google) {
-					gis.layer.openStreetMap.item.setValue(true);
-				}
 			};
 
 			afterRender = function() {
@@ -5004,7 +5000,6 @@
 				});
 
 				// Favorite
-
 				var id = gis.util.url.getUrlParam('id');
 
 				if (id) {
@@ -5013,6 +5008,11 @@
 					};
 					GIS.core.MapLoader(gis).load();
 				}
+
+                // Background
+				if (!window.google) {
+					gis.layer.openStreetMap.item.setValue(false);
+				}
 			};
 
 			viewport = Ext.create('Ext.container.Viewport', {

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js	2013-04-02 10:38:21 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js	2013-04-10 15:15:53 +0000
@@ -305,19 +305,18 @@
 		});
 		layers.googleHybrid.id = 'googleHybrid';
 	}
-	else {
-		layers.openStreetMap = new OpenLayers.Layer.OSM('OpenStreetMap', {
-			layerType: gis.conf.finals.layer.type_base,
-			layerOpacity: 1,
-			setLayerOpacity: function(number) {
-				if (number) {
-					this.layerOpacity = parseFloat(number);
-				}
-				this.setOpacity(this.layerOpacity);
-			}
-		});
-		layers.openStreetMap.id = 'openStreetMap';
-	}
+
+    layers.openStreetMap = new OpenLayers.Layer.OSM.Mapnik('OpenStreetMap', {
+        layerType: gis.conf.finals.layer.type_base,
+        layerOpacity: 1,
+        setLayerOpacity: function(number) {
+            if (number) {
+                this.layerOpacity = parseFloat(number);
+            }
+            this.setOpacity(this.layerOpacity);
+        }
+    });
+    layers.openStreetMap.id = 'openStreetMap';
 
 	layers.boundary = GIS.core.VectorLayer(gis, 'boundary', 'Boundary layer', {opacity: 0.8});
 	layers.boundary.core = new mapfish.GeoStat.Boundary(gis.olmap, {