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
This commit is contained in:
Jon Atkins 2015-06-28 21:56:42 +01:00
parent 8f1759d7c3
commit e0e6fd5c48

View File

@ -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 // 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); var paddedBounds = bounds.pad(0.1);
this.clearPortalsBelowLevelOrOutsideBounds(level,paddedBounds); this.clearPortalsOutsideBounds(paddedBounds);
this.clearLinksOutsideBounds(paddedBounds); this.clearLinksOutsideBounds(paddedBounds);
this.clearFieldsOutsideBounds(paddedBounds); this.clearFieldsOutsideBounds(paddedBounds);
@ -34,12 +34,12 @@ window.Render.prototype.startRenderPass = function(level,bounds) {
this.rescalePortalMarkers(); this.rescalePortalMarkers();
} }
window.Render.prototype.clearPortalsBelowLevelOrOutsideBounds = function(level,bounds) { window.Render.prototype.clearPortalsOutsideBounds = function(bounds) {
var count = 0; var count = 0;
for (var guid in window.portals) { for (var guid in window.portals) {
var p = portals[guid]; var p = portals[guid];
// clear portals below specified level - unless it's the selected portal, or it's relevant to artifacts // clear portals outside visible bounds - 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)) { if (!bounds.contains(p.getLatLng()) && guid !== selectedPortal && !artifact.isInterestingPortal(guid)) {
this.deletePortalEntity(guid); this.deletePortalEntity(guid);
count++; count++;
} }