@pirireis/webglobeplugins 1.2.9 → 1.2.11
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
|
@@ -11,6 +11,10 @@ function fineTuneBboxZooms(bboxZooms) {
|
|
|
11
11
|
if (bboxZooms.length >= 3 && bboxZooms[0].zoom > 12) {
|
|
12
12
|
const first = bboxZooms.shift();
|
|
13
13
|
bboxZooms[0].zoom = first.zoom;
|
|
14
|
+
bboxZooms[0].minX = Math.min(first.minX, bboxZooms[0].minX);
|
|
15
|
+
bboxZooms[0].minY = Math.min(first.minY, bboxZooms[0].minY);
|
|
16
|
+
bboxZooms[0].maxX = Math.max(first.maxX, bboxZooms[0].maxX);
|
|
17
|
+
bboxZooms[0].maxY = Math.max(first.maxY, bboxZooms[0].maxY);
|
|
14
18
|
}
|
|
15
19
|
return bboxZooms;
|
|
16
20
|
}
|
|
@@ -63,7 +67,7 @@ self.onmessage = (event) => {
|
|
|
63
67
|
const fineTunedBboxes = fineTuneBboxZooms(bboxes);
|
|
64
68
|
cache.setBBOXes(fineTunedBboxes);
|
|
65
69
|
if (fineTunedBboxes.length > 0) {
|
|
66
|
-
showThreshold = zoomLevelShowThreshold(fineTunedBboxes[0].zoom, 0.
|
|
70
|
+
showThreshold = zoomLevelShowThreshold(fineTunedBboxes[0].zoom, 0.05);
|
|
67
71
|
}
|
|
68
72
|
}
|
|
69
73
|
const trianglesInView = cache.search();
|
|
@@ -5,6 +5,7 @@ import { PickerDisplayer } from "../../../util/picking/picker-displayer";
|
|
|
5
5
|
import { IndexPolygonMap } from "./data/index-polygon-map";
|
|
6
6
|
import { TestRecords } from "./test-records";
|
|
7
7
|
import { defaultblendfunction } from "../../../util/globe-default-gl-states";
|
|
8
|
+
import { opacityCheck } from "../../../util/check/typecheck";
|
|
8
9
|
export class TerrainPolygonSemiPlugin {
|
|
9
10
|
id;
|
|
10
11
|
globe = null;
|
|
@@ -184,7 +185,7 @@ export class TerrainPolygonSemiPlugin {
|
|
|
184
185
|
throw new Error(`Cannot set private uniform ${name}`);
|
|
185
186
|
}
|
|
186
187
|
const isStyleKey = name === "defaultColor" || name === "hoverColor" || name === "opacity" || name === "useDefaultColor";
|
|
187
|
-
const ubo = this.
|
|
188
|
+
const ubo = this._getUBO(target);
|
|
188
189
|
if (isStyleKey) {
|
|
189
190
|
const prev = this._options.polygonStyle[name];
|
|
190
191
|
if (prev === value)
|
|
@@ -225,28 +226,31 @@ export class TerrainPolygonSemiPlugin {
|
|
|
225
226
|
this.globe.DrawRender();
|
|
226
227
|
}
|
|
227
228
|
setUsePickedColorState(state, target = "polygon") {
|
|
228
|
-
|
|
229
|
-
if (oldState === state)
|
|
230
|
-
return;
|
|
231
|
-
this._options[`${target}Style`].changePickedColor = state;
|
|
232
|
-
const ubo = this.__getUBO(target);
|
|
233
|
-
ubo.updateSingle("private_changeHoverColor", new Float32Array([state ? 1 : 0]));
|
|
234
|
-
this.globe.DrawRender();
|
|
229
|
+
throw new Error("use setChangeColorOnHoverState instead");
|
|
235
230
|
}
|
|
236
|
-
setOpacity(
|
|
237
|
-
if (
|
|
238
|
-
|
|
239
|
-
this.
|
|
240
|
-
this._uboForRealEdgeArcs?.updateSingle("opacity", this._effectiveOpacity("edgeArc"));
|
|
241
|
-
this.globe.DrawRender();
|
|
231
|
+
setOpacity(opacities) {
|
|
232
|
+
if (opacities.common !== undefined) {
|
|
233
|
+
opacityCheck(opacities.common);
|
|
234
|
+
this._options.opacity = opacities.common;
|
|
242
235
|
}
|
|
236
|
+
if (opacities.polygon !== undefined) {
|
|
237
|
+
opacityCheck(opacities.polygon);
|
|
238
|
+
this._options.polygonStyle.opacity = opacities.polygon;
|
|
239
|
+
}
|
|
240
|
+
if (opacities.edgeArc !== undefined) {
|
|
241
|
+
opacityCheck(opacities.edgeArc);
|
|
242
|
+
this._options.edgeStyle.opacity = opacities.edgeArc;
|
|
243
|
+
}
|
|
244
|
+
this._uboHandler.updateSingle("opacity", this._effectiveOpacity("polygon"));
|
|
245
|
+
this._uboForRealEdgeArcs?.updateSingle("opacity", this._effectiveOpacity("edgeArc"));
|
|
246
|
+
this.globe.DrawRender();
|
|
243
247
|
}
|
|
244
248
|
setChangeColorOnHoverState(state, target = "polygon") {
|
|
245
249
|
const oldState = this._options[`${target}Style`].changeHoverColor;
|
|
246
250
|
if (oldState === state)
|
|
247
251
|
return;
|
|
248
252
|
this._options[`${target}Style`].changeHoverColor = state;
|
|
249
|
-
const ubo = this.
|
|
253
|
+
const ubo = this._getUBO(target);
|
|
250
254
|
ubo.updateSingle("private_changeHoverColor", new Float32Array([state ? 1 : 0]));
|
|
251
255
|
this.globe.DrawRender();
|
|
252
256
|
}
|
|
@@ -432,7 +436,7 @@ export class TerrainPolygonSemiPlugin {
|
|
|
432
436
|
this.insertBulk(TestRecords.get(recordName));
|
|
433
437
|
}
|
|
434
438
|
}
|
|
435
|
-
|
|
439
|
+
_getUBO(target = "polygon") {
|
|
436
440
|
let targetUBO;
|
|
437
441
|
if (target === "polygon") {
|
|
438
442
|
targetUBO = this._uboHandler;
|
|
@@ -441,7 +445,7 @@ export class TerrainPolygonSemiPlugin {
|
|
|
441
445
|
targetUBO = this._uboForRealEdgeArcs;
|
|
442
446
|
}
|
|
443
447
|
else {
|
|
444
|
-
throw new Error(`unknown target ${target} for
|
|
448
|
+
throw new Error(`unknown target ${target} for _getUBO, must be "polygon" or "edgeArc"`);
|
|
445
449
|
}
|
|
446
450
|
return targetUBO;
|
|
447
451
|
}
|