Merge git://github.com/jonatkins/ingress-intel-total-conversion into alignment-virus

This commit is contained in:
Morgan Jones
2013-05-25 00:15:41 -06:00
41 changed files with 677 additions and 113 deletions

View File

@ -125,13 +125,9 @@ window.setupMap = function() {
//OpenStreetMap attribution - required by several of the layers
osmAttribution = 'Map data © OpenStreetMap contributors';
//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);
//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 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);

View File

@ -6,24 +6,29 @@ window.setupGeosearch = function() {
if((e.keyCode ? e.keyCode : e.which) != 13) return;
var search = $(this).val();
if ( window.search(search) ) return;
e.preventDefault();
});
$('#geosearchwrapper img').click(function(){
map.locate({setView : true, maxZoom: 13});
});
}
window.search = function(search) {
if (!runHooks('geoSearch', search)) {
return;
return true;
}
$.getJSON(NOMINATIM + encodeURIComponent(search), function(data) {
if(!data || !data[0]) return;
if(!data || !data[0]) return true;
var b = data[0].boundingbox;
if(!b) return;
if(!b) return true;
var southWest = new L.LatLng(b[0], b[2]),
northEast = new L.LatLng(b[1], b[3]),
bounds = new L.LatLngBounds(southWest, northEast);
window.map.fitBounds(bounds);
if(window.isSmartphone()) window.smartphone.mapButton.click();
});
e.preventDefault();
});
$('#geosearchwrapper img').click(function(){
map.locate({setView : true, maxZoom: 13});;
});
}

View File

@ -29,7 +29,7 @@ window.requestData = function() {
for (var x = x1; x <= x2; x++) {
for (var y = y1; y <= y2; y++) {
var tile_id = pointToTileId(z, x, y);
var bucket = Math.floor(x / 2) + "" + Math.floor(y / 2);
var bucket = (x % 2) + ":" + (y % 2);
if (!tiles[bucket])
tiles[bucket] = [];
tiles[bucket].push(generateBoundsParams(
@ -44,6 +44,7 @@ window.requestData = function() {
// Reset previous result of Portal Render Limit handler
portalRenderLimit.init();
// finally send ajax requests
$.each(tiles, function(ind, tls) {
data = { zoom: z };

View File

@ -111,7 +111,7 @@ window.getResonatorDetails = function(d) {
// rotates clockwise. So, last one is 7 (southeast).
window.renderResonatorDetails = function(slot, level, nrg, dist, nick) {
if(level === 0) {
var meter = '<span class="meter" title="octant:\t' + OCTANTS[slot] + '"></span>';
var meter = '<span class="meter" title="octant:\t' + OCTANTS[slot] + ' ' + OCTANTS_ARROW[slot] + '"></span>';
} else {
var max = RESO_NRG[level];
var fillGrade = nrg/max*100;
@ -120,7 +120,7 @@ window.renderResonatorDetails = function(slot, level, nrg, dist, nick) {
+ 'level:\t' + level + '\n'
+ 'distance:\t' + dist + 'm\n'
+ 'owner:\t' + nick + '\n'
+ 'octant:\t' + OCTANTS[slot];
+ 'octant:\t' + OCTANTS[slot] + ' ' + OCTANTS_ARROW[slot];
var style = 'width:'+fillGrade+'%; background:'+COLORS_LVL[level]+';';