@pirireis/webglobeplugins 0.10.5-alpha → 0.10.6-alpha
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
|
@@ -28,7 +28,7 @@ export class TexturePointSampler {
|
|
|
28
28
|
throw new Error("Texture count must be 1 or 2");
|
|
29
29
|
}
|
|
30
30
|
this._textureCount = textureCount;
|
|
31
|
-
this.
|
|
31
|
+
this._pushPointCallbackAll();
|
|
32
32
|
}
|
|
33
33
|
registerPoint(key, long, lat, callback) {
|
|
34
34
|
if (key in this._pointObjects) {
|
|
@@ -37,15 +37,14 @@ export class TexturePointSampler {
|
|
|
37
37
|
}
|
|
38
38
|
if (!this._isInBBox(long, lat)) {
|
|
39
39
|
this._pointObjects.set(key, pointObject(long, lat, -1, callback));
|
|
40
|
+
this._findAndSend(key);
|
|
40
41
|
return false;
|
|
41
42
|
}
|
|
42
43
|
else {
|
|
43
44
|
const index = this._metaCalculater.getFlooredIndex(long, lat);
|
|
44
45
|
this._pointObjects.set(key, pointObject(long, lat, index, callback));
|
|
45
46
|
}
|
|
46
|
-
|
|
47
|
-
this._findAndSend(key);
|
|
48
|
-
}
|
|
47
|
+
this._findAndSend(key);
|
|
49
48
|
return true;
|
|
50
49
|
}
|
|
51
50
|
unregisterPoint(key) {
|
|
@@ -97,9 +96,8 @@ export class TexturePointSampler {
|
|
|
97
96
|
this.updateRatio(ratio);
|
|
98
97
|
}
|
|
99
98
|
updateRatio(ratio) {
|
|
100
|
-
if (
|
|
101
|
-
|
|
102
|
-
ratio = Math.max(0, Math.min(1, ratio)); // Clamp the ratio
|
|
99
|
+
if (typeof ratio !== "number") {
|
|
100
|
+
throw new Error("Ratio must be a number");
|
|
103
101
|
}
|
|
104
102
|
this._ratio = ratio;
|
|
105
103
|
this._pushPointCallbackAll();
|
|
@@ -137,7 +135,7 @@ export class TexturePointSampler {
|
|
|
137
135
|
}
|
|
138
136
|
}
|
|
139
137
|
_pushPointCallbackAll() {
|
|
140
|
-
if (this._isReady) {
|
|
138
|
+
if (this._isReady && this._ratio >= 0 && this._ratio <= 1) {
|
|
141
139
|
for (const key of this._pointObjects.keys()) {
|
|
142
140
|
this._findAndSend(key);
|
|
143
141
|
}
|