From e0e6fd5c48062399a006fccb515b361ac3653721 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sun, 28 Jun 2015 21:56:42 +0100 Subject: [PATCH] don't remove portals by level when starting a render pass - unclaimed are shown when we ask for L1 - helps preserve more data as you zoom out and links create 'placeholder' portals we already have more data for --- code/map_data_render.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/map_data_render.js b/code/map_data_render.js index 0d46ffc6..36aef41f 100644 --- a/code/map_data_render.js +++ b/code/map_data_render.js @@ -25,7 +25,7 @@ window.Render.prototype.startRenderPass = function(level,bounds) { // this will just avoid a few entity removals at start of render when they'll just be added again var paddedBounds = bounds.pad(0.1); - this.clearPortalsBelowLevelOrOutsideBounds(level,paddedBounds); + this.clearPortalsOutsideBounds(paddedBounds); this.clearLinksOutsideBounds(paddedBounds); this.clearFieldsOutsideBounds(paddedBounds); @@ -34,12 +34,12 @@ window.Render.prototype.startRenderPass = function(level,bounds) { this.rescalePortalMarkers(); } -window.Render.prototype.clearPortalsBelowLevelOrOutsideBounds = function(level,bounds) { +window.Render.prototype.clearPortalsOutsideBounds = function(bounds) { var count = 0; for (var guid in window.portals) { var p = portals[guid]; - // clear portals below specified level - unless it's the selected portal, or it's relevant to artifacts - if ((parseInt(p.options.level) < level || !bounds.contains(p.getLatLng())) && guid !== selectedPortal && !artifact.isInterestingPortal(guid)) { + // clear portals outside visible bounds - unless it's the selected portal, or it's relevant to artifacts + if (!bounds.contains(p.getLatLng()) && guid !== selectedPortal && !artifact.isInterestingPortal(guid)) { this.deletePortalEntity(guid); count++; }