Merge master
This commit is contained in:
commit
55be1dd2af
17
build.py
17
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
|
||||
|
16
code/boot.js
16
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);
|
||||
|
||||
@ -396,6 +407,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
|
||||
|
@ -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 += '<a onclick="'+js+'"'
|
||||
|
@ -99,6 +99,7 @@ window.handleDataResponse = function(data, textStatus, jqXHR) {
|
||||
if(!window.getPaddedBounds().contains(latlng)
|
||||
&& selectedPortal !== ent[0]
|
||||
&& urlPortal !== ent[0]
|
||||
&& !(urlPortalLL && urlPortalLL[0] === latlng[0] && urlPortalLL[1] === latlng[1])
|
||||
) return;
|
||||
|
||||
if('imageByUrl' in ent[2] && 'imageUrl' in ent[2].imageByUrl) {
|
||||
@ -175,7 +176,11 @@ window.handlePortalsRender = function(portals) {
|
||||
runHooks('portalDataLoaded', {portals : portals});
|
||||
$.each(portals, function(ind, portal) {
|
||||
//~ if(selectedPortal === portal[0]) portalUpdateAvailable = true;
|
||||
if(urlPortal && portal[0] === urlPortal) portalInUrlAvailable = true;
|
||||
if(urlPortalLL && urlPortalLL[0] === portal[2].locationE6.latE6/1E6 && urlPortalLL[1] === portal[2].locationE6.lngE6/1E6) {
|
||||
urlPortal = portal[0];
|
||||
portalInUrlAvailable = true;
|
||||
urlPortalLL = null;
|
||||
}
|
||||
if(window.portals[portal[0]]) {
|
||||
highlightPortal(window.portals[portal[0]]);
|
||||
}
|
||||
|
@ -45,11 +45,11 @@ window.renderPortalDetails = function(guid) {
|
||||
|
||||
setPortalIndicators(d);
|
||||
var img = d.imageByUrl.imageUrl;
|
||||
var lat = d.locationE6.latE6;
|
||||
var lng = d.locationE6.lngE6;
|
||||
var perma = '/intel?latE6='+lat+'&lngE6='+lng+'&z=17&pguid='+guid;
|
||||
var lat = d.locationE6.latE6/1E6;
|
||||
var lng = d.locationE6.lngE6/1E6;
|
||||
var perma = '/intel?ll='+lat+','+lng+'&z=17&pll='+lat+','+lng;
|
||||
var imgTitle = 'title="'+getPortalDescriptionFromDetails(d)+'\n\nClick to show full image."';
|
||||
var poslinks = 'window.showPortalPosLinks('+lat/1E6+','+lng/1E6+',\'' + d.portalV2.descriptiveText.TITLE + '\')';
|
||||
var poslinks = 'window.showPortalPosLinks('+lat+','+lng+',\'' + d.portalV2.descriptiveText.TITLE + '\')';
|
||||
var postcard = 'Send in a postcard. Will put it online after receiving. Address:\\n\\nStefan Breunig\\nINF 305 – R045\\n69120 Heidelberg\\nGermany';
|
||||
|
||||
$('#portaldetails')
|
||||
|
@ -288,9 +288,9 @@ window.prettyEnergy = function(nrg) {
|
||||
|
||||
window.setPermaLink = function(elm) {
|
||||
var c = map.getCenter();
|
||||
var lat = Math.round(c.lat*1E6);
|
||||
var lng = Math.round(c.lng*1E6);
|
||||
var qry = 'latE6='+lat+'&lngE6='+lng+'&z=' + map.getZoom();
|
||||
var lat = Math.round(c.lat*1E6)/1E6;
|
||||
var lng = Math.round(c.lng*1E6)/1E6;
|
||||
var qry = 'll='+lat+','+lng+'&z=' + map.getZoom();
|
||||
$(elm).attr('href', '/intel?' + qry);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user