← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3218: (GIS) Fixed bug: App would not load when offline.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 3218 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-03-30 14:15:04 +0200
message:
  (GIS) Fixed bug: App would not load when offline.
modified:
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/css/style.css
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/index.html
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/index.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/mapping/css/style.css'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/css/style.css	2011-03-29 09:15:25 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/css/style.css	2011-03-30 12:12:38 +0000
@@ -425,6 +425,9 @@
 #east {
     width:200px;
 }
+#north {
+    padding:2px;
+}
 #overviewmap {
     height:97px;
     padding-top:0px;

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/index.html'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/index.html	2011-03-25 13:46:01 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/index.html	2011-03-30 12:12:38 +0000
@@ -26,7 +26,7 @@
 <body>
     <div id="loading"></div> 
     
-    <div id="north" style="padding:3px;"></div>
+    <div id="north"></div>
     
     <div id="olmap"></div>
     
@@ -92,6 +92,7 @@
 
 		<!-- DHIS -->    
         <script type="text/javascript" src="i18n.action"></script>
+        <script type="text/javascript">var G_NORMAL_MAP = null, G_HYBRID_MAP = null;</script>
         <script type="text/javascript" src="getMapSystemSettings.action"></script>
         <script type="text/javascript" src="javascript/global.js"></script>
         <script type="text/javascript" src="javascript/index.js"></script>    

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/index.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/index.js	2011-03-30 10:29:53 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/index.js	2011-03-30 12:12:38 +0000
@@ -1,4 +1,4 @@
-Ext.onReady( function() {
+Ext.onReady( function() {    
     Ext.BLANK_IMAGE_URL = '../resources/ext-ux/theme/gray-extend/gray-extend/s.gif';
 	Ext.override(Ext.form.Field,{showField:function(){this.show();this.container.up('div.x-form-item').setDisplayed(true);},hideField:function(){this.hide();this.container.up('div.x-form-item').setDisplayed(false);}});
 	Ext.QuickTips.init();
@@ -332,25 +332,27 @@
     G.vars.map.addLayer(pointLayer);
     
     /* Init base layers */
-	var gm_normal = new OpenLayers.Layer.Google("Google Normal", {
-		type: G_NORMAL_MAP,
-		sphericalMercator: true,
-		maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
-		numZoomLevels: 21
-	});
-    
-	gm_normal.layerType = G.conf.map_layer_type_baselayer;
-	G.vars.map.addLayer(gm_normal);
-	
-	var gm_hybrid = new OpenLayers.Layer.Google("Google Hybrid", {
-		type: G_HYBRID_MAP,
-		sphericalMercator: true,
-		maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
-		numZoomLevels: 21
-	});
-    
-	gm_hybrid.layerType = G.conf.map_layer_type_baselayer;
-	G.vars.map.addLayer(gm_hybrid);
+    if (G_NORMAL_MAP && G_HYBRID_MAP) {
+        var gm_normal = new OpenLayers.Layer.Google("Google Normal", {
+            type: G_NORMAL_MAP,
+            sphericalMercator: true,
+            maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
+            numZoomLevels: 21
+        });
+        
+        gm_normal.layerType = G.conf.map_layer_type_baselayer;
+        G.vars.map.addLayer(gm_normal);
+        
+        var gm_hybrid = new OpenLayers.Layer.Google("Google Hybrid", {
+            type: G_HYBRID_MAP,
+            sphericalMercator: true,
+            maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
+            numZoomLevels: 21
+        });
+        
+        gm_hybrid.layerType = G.conf.map_layer_type_baselayer;
+        G.vars.map.addLayer(gm_hybrid);
+    }
 	
     var osm = new OpenLayers.Layer.OSM.Osmarender("OpenStreetMap");
     osm.layerType = G.conf.map_layer_type_baselayer;