From f3190731d6de6f9e76f0d211d1cf7729d55a7697 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sat, 27 Jun 2015 01:29:06 +0100 Subject: [PATCH] remove the 'hack' that ignored portals below the selected level limit - not needed now Niantic have fixed the mission portal issue increase the number of items rendered in the render queue batches - should make IITC render a bit faster, especially now that the portals have gone and instead there's a fair amount of duplicate data from links/fields across multiple data tiles --- code/map_data_render.js | 18 ++---------------- code/map_data_request.js | 4 ++-- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/code/map_data_render.js b/code/map_data_render.js index a113620b..2cb04b06 100644 --- a/code/map_data_render.js +++ b/code/map_data_render.js @@ -110,7 +110,7 @@ window.Render.prototype.processDeletedGameEntityGuids = function(deleted) { } -window.Render.prototype.processGameEntities = function(entities,ignoreLevel) { +window.Render.prototype.processGameEntities = function(entities) { // we loop through the entities three times - for fields, links and portals separately // this is a reasonably efficient work-around for leafletjs limitations on svg render order @@ -131,27 +131,13 @@ window.Render.prototype.processGameEntities = function(entities,ignoreLevel) { } } - // 2015-03-12 - Niantic have been returning all mission portals to the client, ignoring portal level - // and density filtering usually in use. this makes things unusable when viewing the global view, so we - // filter these out - var minLevel = ignoreLevel ? 0 : this.level; - var ignoredCount = 0; - for (var i in entities) { var ent = entities[i]; if (ent[2][0] == 'p' && !(ent[0] in this.deletedGuid)) { - var portalLevel = ent[2][1] == 'N' ? 0 : parseInt(ent[2][4]); - if (portalLevel >= minLevel) { - this.createPortalEntity(ent); - } else { - ignoredCount++; - } - + this.createPortalEntity(ent); } } - - if (ignoredCount) console.log('Render: ignored '+ignoredCount+' portals below the level requested from the server'); } diff --git a/code/map_data_request.js b/code/map_data_request.js index 12ad93c8..c3b3b29c 100644 --- a/code/map_data_request.js +++ b/code/map_data_request.js @@ -57,7 +57,7 @@ window.MapDataRequest = function() { // render queue // number of items to process in each render pass. there are pros and cons to smaller and larger values // (however, if using leaflet canvas rendering, it makes sense to push as much as possible through every time) - this.RENDER_BATCH_SIZE = L.Path.CANVAS ? 1E9 : 500; + this.RENDER_BATCH_SIZE = L.Path.CANVAS ? 1E9 : 1500; // delay before repeating the render loop. this gives a better chance for user interaction this.RENDER_PAUSE = (typeof android === 'undefined') ? 0.1 : 0.2; //100ms desktop, 200ms mobile @@ -233,7 +233,7 @@ window.MapDataRequest.prototype.refresh = function() { this.render.startRenderPass(tileParams.level, dataBounds); - this.render.processGameEntities(artifact.getArtifactEntities(),true); + this.render.processGameEntities(artifact.getArtifactEntities()); var logMessage = 'requesting data tiles at zoom '+dataZoom; if (tileParams.level != tileParams.maxLevel) {