Merge branch 'master' into highlighter
This commit is contained in:
55
code/boot.js
55
code/boot.js
@ -1,4 +1,3 @@
|
||||
|
||||
// SETUP /////////////////////////////////////////////////////////////
|
||||
// these functions set up specific areas after the boot function
|
||||
// created a basic framework. All of these functions should only ever
|
||||
@ -103,15 +102,35 @@ window.setupStyles = function() {
|
||||
window.setupMap = function() {
|
||||
$('#map').text('');
|
||||
|
||||
var osmOpt = {attribution: 'Map data © OpenStreetMap contributors', maxZoom: 18, detectRetina: true};
|
||||
var osm = new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', osmOpt);
|
||||
//OpenStreetMap attribution - required by several of the layers
|
||||
osmAttribution = 'Map data © OpenStreetMap contributors';
|
||||
|
||||
var cmOpt = {attribution: 'Map data © OpenStreetMap contributors, Imagery © CloudMade', maxZoom: 18, detectRetina: true};
|
||||
var cmMin = new L.TileLayer('http://{s}.tile.cloudmade.com/654cef5fd49a432ab81267e200ecc502/22677/256/{z}/{x}/{y}.png', cmOpt);
|
||||
var cmMid = new L.TileLayer('http://{s}.tile.cloudmade.com/654cef5fd49a432ab81267e200ecc502/999/256/{z}/{x}/{y}.png', cmOpt);
|
||||
//OpenStreetMap tiles - we shouldn't use these by default, or even an option - https://wiki.openstreetmap.org/wiki/Tile_usage_policy
|
||||
// "Heavy use (e.g. distributing an app that uses tiles from openstreetmap.org) is forbidden without prior permission from the System Administrators"
|
||||
//var osmOpt = {attribution: osmAttribution, maxZoom: 18, detectRetina: true};
|
||||
//var osm = new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', osmOpt);
|
||||
|
||||
var views = [cmMid, cmMin, osm, new L.Google('INGRESS'), new L.Google('ROADMAP'),
|
||||
new L.Google('SATELLITE'), new L.Google('HYBRID')];
|
||||
//CloudMade layers - only 500,000 tiles/month in their free plan. nowhere near enough for IITC
|
||||
var cmOpt = {attribution: osmAttribution+', Imagery © CloudMade', maxZoom: 18, detectRetina: true};
|
||||
//var cmMin = new L.TileLayer('http://{s}.tile.cloudmade.com/{your api key here}/22677/256/{z}/{x}/{y}.png', cmOpt);
|
||||
//var cmMid = new L.TileLayer('http://{s}.tile.cloudmade.com/{your api key here}/999/256/{z}/{x}/{y}.png', cmOpt);
|
||||
|
||||
//MapQuest offer tiles - http://developer.mapquest.com/web/products/open/map
|
||||
//their usage policy has no limits (except required notification above 4000 tiles/sec - we're perhaps at 50 tiles/sec based on CloudMade stats)
|
||||
var mqSubdomains = [ 'otile1','otile2', 'otile3', 'otile4' ];
|
||||
var mqMapOpt = {attribution: osmAttribution+', Tiles Courtesy of MapQuest', mazZoom: 18, detectRetena: true, subdomains: mqSubdomains};
|
||||
var mqMap = new L.TileLayer('http://{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg',mqMapOpt);
|
||||
//MapQuest satellite coverage outside of the US is rather limited - so not really worth having as we have google as an option
|
||||
//var mqSatOpt = {attribution: 'Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency', mazZoom: 18, detectRetena: true, subdomains: mqSubdomains};
|
||||
//var mqSat = new L.TileLayer('http://{s}.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg',mqSatOpt);
|
||||
|
||||
var views = [
|
||||
/*0*/ mqMap,
|
||||
/*1*/ new L.Google('INGRESS'),
|
||||
/*2*/ new L.Google('ROADMAP'),
|
||||
/*3*/ new L.Google('SATELLITE'),
|
||||
/*4*/ new L.Google('HYBRID')
|
||||
];
|
||||
|
||||
|
||||
window.map = new L.Map('map', $.extend(getPosition(),
|
||||
@ -137,13 +156,11 @@ window.setupMap = function() {
|
||||
addLayers['Links'] = linksLayer;
|
||||
|
||||
window.layerChooser = new L.Control.Layers({
|
||||
'OSM Midnight': views[0],
|
||||
'OSM Minimal': views[1],
|
||||
'OSM Mapnik': views[2],
|
||||
'Default Ingress Map': views[3],
|
||||
'Google Roads': views[4],
|
||||
'Google Satellite': views[5],
|
||||
'Google Hybrid': views[6]
|
||||
'MapQuest OSM': views[0],
|
||||
'Default Ingress Map': views[1],
|
||||
'Google Roads': views[2],
|
||||
'Google Satellite': views[3],
|
||||
'Google Hybrid': views[4]
|
||||
}, addLayers);
|
||||
|
||||
map.addControl(window.layerChooser);
|
||||
@ -231,7 +248,7 @@ window.setupPlayerStat = function() {
|
||||
+ '<h2 title="'+t+'">'+level+' '
|
||||
+ '<div id="name">'
|
||||
+ '<span class="'+cls+'">'+PLAYER.nickname+'</span>'
|
||||
+ '<a href="https://www.ingress.com/_ah/logout?continue=https://www.google.com/accounts/Logout%3Fcontinue%3Dhttps://appengine.google.com/_ah/logout%253Fcontinue%253Dhttps://www.ingress.com/intel%26service%3Dah" id="signout">sign out</a>'
|
||||
+ '<a href="/_ah/logout?continue=https://www.google.com/accounts/Logout%3Fcontinue%3Dhttps://appengine.google.com/_ah/logout%253Fcontinue%253Dhttps://www.ingress.com/intel%26service%3Dah" id="signout">sign out</a>'
|
||||
+ '</div>'
|
||||
+ '<div id="stats">'
|
||||
+ '<sup>XM: '+xmRatio+'%</sup>'
|
||||
@ -291,12 +308,13 @@ window.setupDialogs = function() {
|
||||
autoOpen: false,
|
||||
modal: true,
|
||||
buttons: [
|
||||
{ text: 'OK', click: function() { $(this).dialog('close'); } }
|
||||
{ text: 'OK', click: function() { if($(this).data("closeCallback")) {$(this).data("closeCallback")();} $(this).dialog('close'); } }
|
||||
]
|
||||
});
|
||||
|
||||
window.alert = function(text, isHTML) {
|
||||
window.alert = function(text, isHTML, closeCallback) {
|
||||
var h = isHTML ? text : window.convertTextToTableMagic(text);
|
||||
$('#dialog').data("closeCallback", closeCallback);
|
||||
$('#dialog').html(h).dialog('open');
|
||||
}
|
||||
}
|
||||
@ -386,6 +404,7 @@ try { console.log('Loading included JS now'); } catch(e) {}
|
||||
|
||||
try { console.log('done loading included JS'); } catch(e) {}
|
||||
|
||||
//note: no protocol - so uses http or https as used on the current page
|
||||
var JQUERY = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js';
|
||||
var JQUERYUI = 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js';
|
||||
|
||||
|
45
code/chat.js
45
code/chat.js
@ -241,6 +241,14 @@ window.chat.renderFull = function(oldMsgsWereAdded) {
|
||||
// common
|
||||
//
|
||||
|
||||
window.chat.nicknameClicked = function(event, nickname) {
|
||||
var hookData = { event: event, nickname: nickname };
|
||||
|
||||
if (window.runHooks('nicknameClicked', hookData)) {
|
||||
window.chat.addNickname('@' + nickname);
|
||||
}
|
||||
}
|
||||
|
||||
window.chat.writeDataToHash = function(newData, storageHash, isPublicChannel) {
|
||||
$.each(newData.result, function(ind, json) {
|
||||
// avoid duplicates
|
||||
@ -283,16 +291,17 @@ window.chat.writeDataToHash = function(newData, storageHash, isPublicChannel) {
|
||||
case 'AT_PLAYER':
|
||||
var thisToPlayer = (markup[1].plain == ('@'+window.PLAYER.nickname));
|
||||
var spanClass = thisToPlayer ? "pl_nudge_me" : (markup[1].team + " pl_nudge_player");
|
||||
var atPlayerName = markup[1].plain.replace(/^@/, "");
|
||||
msg += $('<div/>').html($('<span/>')
|
||||
.attr('class', spanClass)
|
||||
.attr('onclick',"window.chat.addNickname('"+markup[1].plain+"')")
|
||||
.attr('onclick',"window.chat.nicknameClicked(event, '"+atPlayerName+"')")
|
||||
.text(markup[1].plain)).html();
|
||||
msgToPlayer = msgToPlayer || thisToPlayer;
|
||||
break;
|
||||
|
||||
case 'PORTAL':
|
||||
var latlng = [markup[1].latE6/1E6, markup[1].lngE6/1E6];
|
||||
var perma = 'https://ingress.com/intel?latE6='+markup[1].latE6+'&lngE6='+markup[1].lngE6+'&z=17&pguid='+markup[1].guid;
|
||||
var perma = '/intel?latE6='+markup[1].latE6+'&lngE6='+markup[1].lngE6+'&z=17&pguid='+markup[1].guid;
|
||||
var js = 'window.zoomToAndShowPortal(\''+markup[1].guid+'\', ['+latlng[0]+', '+latlng[1]+']);return false';
|
||||
|
||||
msg += '<a onclick="'+js+'"'
|
||||
@ -401,7 +410,7 @@ window.chat.renderMsg = function(msg, nick, time, team, msgToPlayer, systemNarro
|
||||
var s = 'style="cursor:pointer; color:'+color+'"';
|
||||
var title = nick.length >= 8 ? 'title="'+nick+'" class="help"' : '';
|
||||
var i = ['<span class="invisep"><</span>', '<span class="invisep">></span>'];
|
||||
return '<tr><td>'+t+'</td><td>'+i[0]+'<mark class="nickname" onclick="window.chat.addNickname(\'@' + nick + '\')" ' + s + '>'+ nick+'</mark>'+i[1]+'</td><td>'+msg+'</td></tr>';
|
||||
return '<tr><td>'+t+'</td><td>'+i[0]+'<mark class="nickname" onclick="window.chat.nicknameClicked(event, \'' + nick + '\')" ' + s + '>'+ nick+'</mark>'+i[1]+'</td><td>'+msg+'</td></tr>';
|
||||
}
|
||||
|
||||
window.chat.addNickname= function(nick){
|
||||
@ -606,21 +615,23 @@ window.chat.setupTime = function() {
|
||||
|
||||
|
||||
window.chat.setupPosting = function() {
|
||||
$('#chatinput input').keydown(function(event) {
|
||||
try {
|
||||
var kc = (event.keyCode ? event.keyCode : event.which);
|
||||
if(kc === 13) { // enter
|
||||
chat.postMsg();
|
||||
event.preventDefault();
|
||||
} else if (kc === 9) { // tab
|
||||
event.preventDefault();
|
||||
window.chat.handleTabCompletion();
|
||||
if (!isSmartphone()) {
|
||||
$('#chatinput input').keydown(function(event) {
|
||||
try {
|
||||
var kc = (event.keyCode ? event.keyCode : event.which);
|
||||
if(kc === 13) { // enter
|
||||
chat.postMsg();
|
||||
event.preventDefault();
|
||||
} else if (kc === 9) { // tab
|
||||
event.preventDefault();
|
||||
window.chat.handleTabCompletion();
|
||||
}
|
||||
} catch(error) {
|
||||
console.log(error);
|
||||
debug.printStackTrace();
|
||||
}
|
||||
} catch(error) {
|
||||
console.log(error);
|
||||
debug.printStackTrace();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$('#chatinput').submit(function(event) {
|
||||
event.preventDefault();
|
||||
|
@ -4,7 +4,14 @@
|
||||
window.setupGeosearch = function() {
|
||||
$('#geosearch').keypress(function(e) {
|
||||
if((e.keyCode ? e.keyCode : e.which) != 13) return;
|
||||
$.getJSON(NOMINATIM + encodeURIComponent($(this).val()), function(data) {
|
||||
|
||||
var search = $(this).val();
|
||||
|
||||
if (!runHooks('geoSearch', search)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$.getJSON(NOMINATIM + encodeURIComponent(search), function(data) {
|
||||
if(!data || !data[0]) return;
|
||||
var b = data[0].boundingbox;
|
||||
if(!b) return;
|
||||
@ -16,4 +23,7 @@ window.setupGeosearch = function() {
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
$('#geosearchwrapper img').click(function(){
|
||||
map.locate({setView : true});;
|
||||
});
|
||||
}
|
||||
|
@ -42,7 +42,7 @@
|
||||
// array to change order or add additional values to the
|
||||
// details of a portal.
|
||||
// beforePortalReRender: the callback argument is
|
||||
// {portal: ent[2], oldPortal : d, reRender : false}.
|
||||
// {portal: ent[2], oldPortal : d, portalGuid: ent[0], reRender : false}.
|
||||
// The callback needs to update the value of reRender to
|
||||
// true if the plugin has a reason to have the portal
|
||||
// redrawn. It is called early on in the
|
||||
@ -59,15 +59,21 @@
|
||||
window._hooks = {}
|
||||
window.VALID_HOOKS = ['portalAdded', 'portalDetailsUpdated',
|
||||
'publicChatDataAvailable', 'factionChatDataAvailable', 'portalDataLoaded',
|
||||
'beforePortalReRender', 'checkRenderLimit', 'requestFinished'];
|
||||
'beforePortalReRender', 'checkRenderLimit', 'requestFinished', 'nicknameClicked',
|
||||
'geoSearch'];
|
||||
|
||||
window.runHooks = function(event, data) {
|
||||
if(VALID_HOOKS.indexOf(event) === -1) throw('Unknown event type: ' + event);
|
||||
|
||||
if(!_hooks[event]) return;
|
||||
if(!_hooks[event]) return true;
|
||||
var interupted = false;
|
||||
$.each(_hooks[event], function(ind, callback) {
|
||||
callback(data);
|
||||
if (callback(data) === false) {
|
||||
interupted = true;
|
||||
return false; //break from $.each
|
||||
}
|
||||
});
|
||||
return !interupted;
|
||||
}
|
||||
|
||||
|
||||
|
@ -21,11 +21,18 @@ window.storeMapPosition = function() {
|
||||
// returns a map that shows the whole world.
|
||||
window.getPosition = function() {
|
||||
if(getURLParam('latE6') && getURLParam('lngE6')) {
|
||||
console.log("mappos: reading URL params");
|
||||
console.log("mappos: reading email URL params");
|
||||
var lat = parseInt(getURLParam('latE6'))/1E6 || 0.0;
|
||||
var lng = parseInt(getURLParam('lngE6'))/1E6 || 0.0;
|
||||
// google seems to zoom in far more than leaflet
|
||||
var z = parseInt(getURLParam('z'))+1 || 17;
|
||||
var z = parseInt(getURLParam('z')) || 17;
|
||||
return {center: new L.LatLng(lat, lng), zoom: z > 18 ? 18 : z};
|
||||
}
|
||||
|
||||
if(getURLParam('ll')) {
|
||||
console.log("mappos: reading stock Intel URL params");
|
||||
var lat = parseFloat(getURLParam('ll').split(",")[0]) || 0.0;
|
||||
var lng = parseFloat(getURLParam('ll').split(",")[1]) || 0.0;
|
||||
var z = parseInt(getURLParam('z')) || 17;
|
||||
return {center: new L.LatLng(lat, lng), zoom: z > 18 ? 18 : z};
|
||||
}
|
||||
|
||||
|
@ -266,7 +266,7 @@ window.renderPortal = function(ent) {
|
||||
u = u || oo.level !== portalLevel;
|
||||
|
||||
// Allow plugins to add additional conditions as to when a portal gets re-rendered
|
||||
var hookData = {portal: ent[2], oldPortal: oo.details, reRender: false};
|
||||
var hookData = {portal: ent[2], oldPortal: oo.details, portalGuid: ent[0], reRender: false};
|
||||
runHooks('beforePortalReRender', hookData);
|
||||
u = u || hookData.reRender;
|
||||
|
||||
|
@ -50,7 +50,7 @@ window.renderPortalDetails = function(guid) {
|
||||
|
||||
var lat = d.locationE6.latE6;
|
||||
var lng = d.locationE6.lngE6;
|
||||
var perma = 'https://ingress.com/intel?latE6='+lat+'&lngE6='+lng+'&z=17&pguid='+guid;
|
||||
var perma = '/intel?latE6='+lat+'&lngE6='+lng+'&z=17&pguid='+guid;
|
||||
var imgTitle = 'title="'+getPortalDescriptionFromDetails(d)+'\n\nClick to show full image."';
|
||||
var poslinks = 'window.showPortalPosLinks('+lat/1E6+','+lng/1E6+',\'' + 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';
|
||||
@ -58,7 +58,8 @@ window.renderPortalDetails = function(guid) {
|
||||
$('#portaldetails')
|
||||
.attr('class', TEAM_TO_CSS[getTeam(d)])
|
||||
.html(''
|
||||
+ '<h3 ondblclick="renderPortalDetails(null);">'+d.portalV2.descriptiveText.TITLE+'</h3>'
|
||||
+ '<h3 class="title">'+d.portalV2.descriptiveText.TITLE+'</h3>'
|
||||
+ '<span class="close" onclick="unselectOldPortal();" title="Close">X</span>'
|
||||
// help cursor via “.imgpreview img”
|
||||
+ '<div class="imgpreview" '+imgTitle+' style="background-image: url('+img+')">'
|
||||
+ '<img class="hide" src="'+img+'"/>'
|
||||
@ -67,10 +68,10 @@ window.renderPortalDetails = function(guid) {
|
||||
+ '<div class="mods">'+getModDetails(d)+'</div>'
|
||||
+ randDetails
|
||||
+ resoDetails
|
||||
+ '<div class="linkdetails"><aside><a href="'+perma+'" onclick="return androidCopy(this.href)" >portal link</a></aside>'
|
||||
+ '<aside><a onclick="'+poslinks+'">poslinks</a></aside>'
|
||||
+ '<aside><a onclick="alert(\''+postcard+'\');">donate</a></aside>'
|
||||
+ '<aside><a onclick="window.reportPortalIssue()">report issue</a></aside>'
|
||||
+ '<div class="linkdetails">'
|
||||
+ '<aside><a href="'+perma+'" onclick="return androidCopy(this.href)" title="Create a URL link to this portal" >Portal link</a></aside>'
|
||||
+ '<aside><a onclick="'+poslinks+'" title="Link to alternative maps (Google, etc)">Map links</a></aside>'
|
||||
+ '<aside><a onclick="window.reportPortalIssue()" title="Report issues with this portal to Niantic/Google">Report issue</a></aside>'
|
||||
+ '</div>'
|
||||
);
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
|
||||
|
||||
// REDEEMING /////////////////////////////////////////////////////////
|
||||
|
||||
window.handleRedeemResponse = function(data, textStatus, jqXHR) {
|
||||
@ -27,6 +26,7 @@ window.handleRedeemResponse = function(data, textStatus, jqXHR) {
|
||||
var resonators = {};
|
||||
var bursts = {};
|
||||
var shields = {};
|
||||
var cubes = {};
|
||||
|
||||
for(var i in data.result.inventoryAward) {
|
||||
var acquired = data.result.inventoryAward[i][2];
|
||||
@ -45,6 +45,10 @@ window.handleRedeemResponse = function(data, textStatus, jqXHR) {
|
||||
var level = acquired.resourceWithLevels.level
|
||||
if(!bursts[level]) bursts[level] = 0;
|
||||
bursts[level] += 1;
|
||||
} else if(acquired.resourceWithLevels.resourceType === 'POWER_CUBE') {
|
||||
var level = acquired.resourceWithLevels.level
|
||||
if(!cubes[level]) cubes[level] = 0;
|
||||
cubes[level] += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -59,12 +63,16 @@ window.handleRedeemResponse = function(data, textStatus, jqXHR) {
|
||||
if(count >= 2) text += ' ('+count+')';
|
||||
tblResult.append($('<tr ><td style="color: ' +window.COLORS_LVL[lvl]+ ';">L' +lvl+ '</td><td>' + text + '</td></tr>'));
|
||||
});
|
||||
$.each(cubes, function(lvl, count) {
|
||||
var text = 'Power Cube';
|
||||
if(count >= 2) text += ' ('+count+')';
|
||||
tblResult.append($('<tr ><td style="color: ' +window.COLORS_LVL[lvl]+ ';">L' +lvl+ '</td><td>' + text + '</td></tr>'));
|
||||
});
|
||||
$.each(shields, function(lvl, count) {
|
||||
var text = 'Portal Shield';
|
||||
if(count >= 2) text += ' ('+count+')';
|
||||
tblResult.append($('<tr><td>'+lvl+'</td><td>'+text+'</td></tr>'));
|
||||
});
|
||||
|
||||
alert(tblResult, true);
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,30 @@
|
||||
|
||||
|
||||
// UTILS + MISC ///////////////////////////////////////////////////////
|
||||
|
||||
window.aboutIITC = function(){
|
||||
var v = '@@BUILDNAME@@-@@BUILDDATE@@'
|
||||
var a = ''
|
||||
+ ' <div><b>About IITC</b></div> '
|
||||
+ ' <div>Ingress Intel Total Conversion</div> '
|
||||
+ ' <hr>'
|
||||
+ ' <div>'
|
||||
+ ' <a href="http://iitc.jonatkins.com/" target="_blank">IITC Homepage</a><br />'
|
||||
+ ' On the script’s homepage you can:'
|
||||
+ ' <ul>'
|
||||
+ ' <li>Find Updates</li>'
|
||||
+ ' <li>Get Plugins</li>'
|
||||
+ ' <li>Report Bugs</li>'
|
||||
+ ' <li>Contribute!</li>'
|
||||
+ ' </ul>'
|
||||
+ ' </div>'
|
||||
+ ' <div>'
|
||||
+ ' MapQuest OSM tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="http://developer.mapquest.com/content/osm/mq_logo.png">'
|
||||
+ ' </div>'
|
||||
+ ' <hr>'
|
||||
+ ' <div>Version: ' + v + '</div>';
|
||||
alert(a);
|
||||
}
|
||||
|
||||
|
||||
window.layerGroupLength = function(layerGroup) {
|
||||
var layersCount = 0;
|
||||
var layers = layerGroup._layers;
|
||||
@ -59,10 +82,7 @@ window.postAjax = function(action, data, success, error) {
|
||||
var remove = function(data, textStatus, jqXHR) { window.requests.remove(jqXHR); };
|
||||
var errCnt = function(jqXHR) { window.failedRequestCount++; window.requests.remove(jqXHR); };
|
||||
var result = $.ajax({
|
||||
// use full URL to avoid issues depending on how people set their
|
||||
// slash. See:
|
||||
// https://github.com/breunigs/ingress-intel-total-conversion/issues/56
|
||||
url: window.location.protocol + '//www.ingress.com/rpc/dashboard.'+action,
|
||||
url: '/rpc/dashboard.'+action,
|
||||
type: 'POST',
|
||||
data: data,
|
||||
dataType: 'json',
|
||||
@ -116,8 +136,8 @@ window.showPortalPosLinks = function(lat, lng, name) {
|
||||
} else {
|
||||
var qrcode = '<div id="qrcode"></div>';
|
||||
var script = '<script>$(\'#qrcode\').qrcode({text:\'GEO:'+lat+','+lng+'\'});</script>';
|
||||
var gmaps = '<a href="https://maps.google.com/?q='+lat+','+lng+portal_name+'">gmaps</a>';
|
||||
var osm = '<a href="http://www.openstreetmap.org/?mlat='+lat+'&mlon='+lng+'&zoom=16">OSM</a>';
|
||||
var gmaps = '<a href="https://maps.google.com/?q='+lat+','+lng+portal_name+'">Google maps</a>';
|
||||
var osm = '<a href="http://www.openstreetmap.org/?mlat='+lat+'&mlon='+lng+'&zoom=16">OpenStreetMap</a>';
|
||||
var latLng = '<span>'+lat+','+lng +'</span>';
|
||||
alert('<div style="text-align: center;">' + qrcode + script + gmaps + ' ' + osm + '<br />' + latLng + '</div>');
|
||||
}
|
||||
@ -260,8 +280,8 @@ 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()-1);
|
||||
$(elm).attr('href', 'https://www.ingress.com/intel?' + qry);
|
||||
var qry = 'latE6='+lat+'&lngE6='+lng+'&z=' + map.getZoom();
|
||||
$(elm).attr('href', '/intel?' + qry);
|
||||
}
|
||||
|
||||
window.uniqueArray = function(arr) {
|
||||
|
Reference in New Issue
Block a user