From 47bc5fa1b2a10e4b327a4cc48d844675390304d1 Mon Sep 17 00:00:00 2001 From: Xelio Date: Wed, 1 May 2013 13:14:19 +0800 Subject: [PATCH 1/3] Make use of layer control status function in main script Layers display status now persist between session --- code/boot.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/code/boot.js b/code/boot.js index 29b052cc..79aa6afb 100644 --- a/code/boot.js +++ b/code/boot.js @@ -160,6 +160,7 @@ window.setupMap = function() { )); var addLayers = {}; + var hiddenLayer = []; portalsLayers = []; for(var i = 0; i <= 8; i++) { @@ -167,15 +168,21 @@ window.setupMap = function() { map.addLayer(portalsLayers[i]); var t = (i === 0 ? 'Unclaimed' : 'Level ' + i) + ' Portals'; addLayers[t] = portalsLayers[i]; + // Store it in hiddenLayer to remove later + if(!isLayerGroupDisplayed(t)) hiddenLayer.push(portalsLayers[i]); } fieldsLayer = L.layerGroup([]); map.addLayer(fieldsLayer, true); addLayers['Fields'] = fieldsLayer; + // Store it in hiddenLayer to remove later + if(!isLayerGroupDisplayed('Fields')) hiddenLayer.push(fieldsLayer); linksLayer = L.layerGroup([]); map.addLayer(linksLayer, true); addLayers['Links'] = linksLayer; + // Store it in hiddenLayer to remove later + if(!isLayerGroupDisplayed('Links')) hiddenLayer.push(linksLayer); window.layerChooser = new L.Control.Layers({ 'MapQuest OSM': views[0], @@ -185,6 +192,10 @@ window.setupMap = function() { 'Google Hybrid': views[4], 'Google Terrain': views[5] }, addLayers); + // Remove the hidden layer after layerChooser built, to avoid messing up ordering of layers + $.each(hiddenLayer, function(ind, layer){ + map.removeLayer(layer); + }); map.addControl(window.layerChooser); From 79af80d0c3b7840f22229a8418384cc58847480c Mon Sep 17 00:00:00 2001 From: Kevin Date: Thu, 11 Apr 2013 23:11:50 -0700 Subject: [PATCH 2/3] More updates to url links to be compatible with stock intel map --- code/boot.js | 5 +++++ code/chat.js | 2 +- code/map_data.js | 6 ++++++ code/portal_detail_display.js | 8 ++++---- code/utils_misc.js | 6 +++--- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/code/boot.js b/code/boot.js index 29b052cc..7d195352 100644 --- a/code/boot.js +++ b/code/boot.js @@ -396,6 +396,11 @@ function boot() { window.setupBackButton(); // read here ONCE, so the URL is only evaluated one time after the // necessary data has been loaded. + urlPortalLL = getURLParam('pll'); + if(urlPortalLL) { + urlPortalLL = urlPortalLL.split(","); + urlPortalLL = [parseFloat(urlPortalLL[0]) || 0.0, parseFloat(urlPortalLL[1]) || 0.0]; + } urlPortal = getURLParam('pguid'); // load only once diff --git a/code/chat.js b/code/chat.js index df42dd2a..a2b78797 100644 --- a/code/chat.js +++ b/code/chat.js @@ -301,7 +301,7 @@ window.chat.writeDataToHash = function(newData, storageHash, isPublicChannel) { case 'PORTAL': var latlng = [markup[1].latE6/1E6, markup[1].lngE6/1E6]; - var perma = '/intel?latE6='+markup[1].latE6+'&lngE6='+markup[1].lngE6+'&z=17&pguid='+markup[1].guid; + var perma = '/intel?ll='+latlng[0]+','+latlng[1]+'&z=17&pll='+latlng[0]+','+latlng[1]; var js = 'window.zoomToAndShowPortal(\''+markup[1].guid+'\', ['+latlng[0]+', '+latlng[1]+']);return false'; msg += ' Date: Wed, 1 May 2013 17:07:31 +0100 Subject: [PATCH 3/3] update build.py for fdroid - a 'copyonly' mode that prepares the mobile/assets folder but doesn't run 'ant' --- build.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/build.py b/build.py index a7ace7e2..55ac2f0a 100755 --- a/build.py +++ b/build.py @@ -202,8 +202,8 @@ def copytree(src, dst, symlinks=False, ignore=None): # if we're building mobile too if buildMobile: - if buildMobile not in ['debug','release']: - raise Exception("Error: buildMobile must be 'debug' or 'release'") + if buildMobile not in ['debug','release','copyonly']: + raise Exception("Error: buildMobile must be 'debug' or 'release' or 'copyonly'") # compile the user location script fn = "user-location.user.js" @@ -232,13 +232,14 @@ if buildMobile: copytree(os.path.join(outDir,"plugins"), "mobile/assets/plugins") - # now launch 'ant' to build the mobile project - retcode = os.system("ant -buildfile mobile/build.xml %s" % buildMobile) + if buildMobile != 'copyonly': + # now launch 'ant' to build the mobile project + retcode = os.system("ant -buildfile mobile/build.xml %s" % buildMobile) - if retcode != 0: - print ("Error: mobile app failed to build. ant returned %d" % retcode) - else: - shutil.copy("mobile/bin/IITC_Mobile-%s.apk" % buildMobile, os.path.join(outDir,"IITC_Mobile-%s.apk" % buildMobile) ) + if retcode != 0: + print ("Error: mobile app failed to build. ant returned %d" % retcode) + else: + shutil.copy("mobile/bin/IITC_Mobile-%s.apk" % buildMobile, os.path.join(outDir,"IITC_Mobile-%s.apk" % buildMobile) ) # vim: ai si ts=4 sw=4 sts=4 et