@pirireis/webglobeplugins 1.2.23 → 1.2.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -6,6 +6,9 @@ const cache = new Cache();
|
|
|
6
6
|
let _pickableState = false;
|
|
7
7
|
let _arcState = false;
|
|
8
8
|
let _variativeColorsOnState = false;
|
|
9
|
+
// Keep the last bboxes so inserts/deletes can tessellate immediately
|
|
10
|
+
// without requiring a new camera move / tile update message.
|
|
11
|
+
let _lastBboxes = null;
|
|
9
12
|
let showThreshold = 0;
|
|
10
13
|
const NO_COLOR_ALPHA = 255;
|
|
11
14
|
const MAX_ALPHA_VALUE = 254;
|
|
@@ -54,23 +57,24 @@ self.onmessage = (event) => {
|
|
|
54
57
|
// Update bboxes if provided
|
|
55
58
|
if (bboxes) {
|
|
56
59
|
cache.setBBOXes(bboxes);
|
|
60
|
+
_lastBboxes = bboxes;
|
|
57
61
|
if (bboxes.length > 0) {
|
|
58
62
|
showThreshold = zoomLevelShowThreshold(bboxes[0].zoom, 0.05);
|
|
59
63
|
}
|
|
60
64
|
}
|
|
61
65
|
const trianglesInView = cache.search();
|
|
62
66
|
const results = [];
|
|
63
|
-
// Convert bbox to BBoxZoom format for partialTessellation
|
|
64
|
-
//
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
67
|
+
// Convert bbox to BBoxZoom format for partialTessellation.
|
|
68
|
+
// IMPORTANT: inserts/deletes may arrive without `bboxes`, but we still
|
|
69
|
+
// want to tessellate against the last-known visible tiles.
|
|
70
|
+
const bboxesForTessellation = bboxes ?? _lastBboxes ?? [];
|
|
71
|
+
const bboxZooms = bboxesForTessellation.map((b) => ({
|
|
72
|
+
bbox: {
|
|
73
|
+
min: [b.minX, b.minY],
|
|
74
|
+
max: [b.maxX, b.maxY],
|
|
75
|
+
},
|
|
76
|
+
zoom: b.zoom,
|
|
77
|
+
}));
|
|
74
78
|
let counter = 0;
|
|
75
79
|
let indexCounter = 0;
|
|
76
80
|
let arcCounter = 0;
|