merge patch from #491, that updates things to getThinnedEntitiesV4

also a couple of plugins that were missed
This commit is contained in:
Jon Atkins 2013-08-16 17:36:17 +01:00
parent 7d8e583273
commit 92433c5d4b
5 changed files with 12 additions and 12 deletions

View File

@ -216,12 +216,12 @@ window.requestData = function() {
return 0;
});
data = { zoom: z };
data = { };
data.boundsParamsList = tls;
// keep a list of tile_ids with each request. in the case of a server error, we can try and use cached tiles if available
var tile_ids = []
$.each(tls,function(i,req) { tile_ids.push(req.qk); });
window.requests.add(window.postAjax('getThinnedEntitiesV3', data, function(data, textStatus, jqXHR) { window.handleDataResponse(data,false,tile_ids); }, function() { window.handleFailedRequest(tile_ids); }));
window.requests.add(window.postAjax('getThinnedEntitiesV4', data, function(data, textStatus, jqXHR) { window.handleDataResponse(data,false,tile_ids); }, function() { window.handleFailedRequest(tile_ids); }));
});
// process the requests from the cache
@ -255,7 +255,7 @@ window.handleFailedRequest = function(tile_ids) {
handleDataResponse(cachedData, true);
}
if(requests.isLastRequest('getThinnedEntitiesV3')) {
if(requests.isLastRequest('getThinnedEntitiesV4')) {
var leftOverPortals = portalRenderLimit.mergeLowLevelPortals(null);
handlePortalsRender(leftOverPortals);
}

View File

@ -10,20 +10,20 @@
// http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames
window.lngToTile = function(lng, zoom) {
return Math.floor((lng + 180) / 360 * Math.pow(2, zoom));
return Math.floor((lng + 180) / 360 * Math.pow(2, (zoom>12)?zoom:(zoom+2)));
}
window.latToTile = function(lat, zoom) {
return Math.floor((1 - Math.log(Math.tan(lat * Math.PI / 180) +
1 / Math.cos(lat * Math.PI / 180)) / Math.PI) / 2 * Math.pow(2, zoom));
1 / Math.cos(lat * Math.PI / 180)) / Math.PI) / 2 * Math.pow(2, (zoom>12)?zoom:(zoom+2)));
}
window.tileToLng = function(x, zoom) {
return x / Math.pow(2, zoom) * 360 - 180;
return x / Math.pow(2, (zoom>12)?zoom:(zoom+2)) * 360 - 180;
}
window.tileToLat = function(y, zoom) {
var n = Math.PI - 2 * Math.PI * y / Math.pow(2, zoom);
var n = Math.PI - 2 * Math.PI * y / Math.pow(2, (zoom>12)?zoom:(zoom+2));
return 180 / Math.PI * Math.atan(0.5 * (Math.exp(n) - Math.exp(-n)));
}

View File

@ -98,7 +98,7 @@ window.portalRenderLimit.splitOrMergeLowLevelPortals = function(originPortals) {
portalRenderLimit.resetCounting();
portalRenderLimit.countingPortals(originPortals);
var resultPortals = requests.isLastRequest('getThinnedEntitiesV3')
var resultPortals = requests.isLastRequest('getThinnedEntitiesV4')
? portalRenderLimit.mergeLowLevelPortals(originPortals)
: portalRenderLimit.splitLowLevelPortals(originPortals);

View File

@ -2,7 +2,7 @@
// @id iitc-plugin-ap-list@xelio
// @name IITC plugin: AP List
// @category Info
// @version 0.5.4.@@DATETIMEVERSION@@
// @version 0.5.5.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
@ -54,7 +54,7 @@ window.plugin.apList.animTimeout;
// ENTRY POINT ///////////////////////////////////////////////////////////////////
window.plugin.apList.handleUpdate = function() {
if(!requests.isLastRequest('getThinnedEntitiesV3')) return;
if(!requests.isLastRequest('getThinnedEntitiesV4')) return;
plugin.apList.updateSortedPortals();
plugin.apList.updatePortalTable(plugin.apList.displaySide);
}

View File

@ -2,7 +2,7 @@
// @id iitc-plugin-show-linked-portals@fstopienski
// @name IITC plugin: Show linked portals
// @category Portal Info
// @version 0.0.6.@@DATETIMEVERSION@@
// @version 0.0.7.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
@ -29,7 +29,7 @@ window.plugin.showLinkedPortal = function () {
};
window.plugin.showLinkedPortal.handleUpdate = function () {
if (!requests.isLastRequest('getThinnedEntitiesV3')) {
if (!requests.isLastRequest('getThinnedEntitiesV4')) {
return;
}
}