From f1ed0b3c68ac8e17c601bf8b68bf71219c132994 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 11 Jun 2018 23:34:34 -0400 Subject: [PATCH] skip duplicate bubbles --- modules/services/streetside.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/services/streetside.js b/modules/services/streetside.js index cf9da69f3..9bb56d350 100644 --- a/modules/services/streetside.js +++ b/modules/services/streetside.js @@ -143,6 +143,9 @@ function loadNextTilePage(which, currZoom, url, tile) { bubbles.shift(); var features = bubbles.map(function (bubble) { + var bubbleId = bubble.id; + if (cache.points[bubbleId]) return null; // skip duplicates + var loc = [bubble.lo, bubble.la]; var d = { loc: loc, @@ -164,12 +167,13 @@ function loadNextTilePage(which, currZoom, url, tile) { type: 'Feature' }; - var bubbleId = bubble.id; cache.points[bubbleId] = feature; cache.forImageKey[bubbleId] = bubbleId; + return { minX: loc[0], minY: loc[1], maxX: loc[0], maxY: loc[1], data: d }; + }).filter(Boolean); cache.rtree.load(features); @@ -297,7 +301,7 @@ export default { var options = { 'default': { firstScene: sceneID }, scenes: {} - } + }; options.scenes[sceneID] = _sceneOptions; _pannellumViewer = window.pannellum.viewer('viewer-streetside', options);