@pirireis/webglobeplugins 0.10.4-alpha → 0.10.5-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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pirireis/webglobeplugins",
3
- "version": "0.10.4-alpha",
3
+ "version": "0.10.5-alpha",
4
4
  "main": "index.js",
5
5
  "author": "Toprak Nihat Deniz Ozturk",
6
6
  "license": "MIT",
@@ -35,10 +35,14 @@ export class TexturePointSampler {
35
35
  console.warn("key already registered, old one is unregistered");
36
36
  this.unregisterPoint(key);
37
37
  }
38
- if (!this._isInBBox(long, lat))
38
+ if (!this._isInBBox(long, lat)) {
39
+ this._pointObjects.set(key, pointObject(long, lat, -1, callback));
39
40
  return false;
40
- const index = this._metaCalculater.getFlooredIndex(long, lat);
41
- this._pointObjects.set(key, pointObject(long, lat, index, callback));
41
+ }
42
+ else {
43
+ const index = this._metaCalculater.getFlooredIndex(long, lat);
44
+ this._pointObjects.set(key, pointObject(long, lat, index, callback));
45
+ }
42
46
  if (this._isReady) {
43
47
  this._findAndSend(key);
44
48
  }
@@ -53,14 +57,15 @@ export class TexturePointSampler {
53
57
  console.warn("Point not registered, use registerPoint first");
54
58
  return false;
55
59
  }
60
+ pointObject.long = long;
61
+ pointObject.lat = lat;
56
62
  if (!this._isInBBox(long, lat)) {
57
63
  console.warn("Point is out of bbox, use registerPoint with valid coordinates");
64
+ pointObject.posIndex = -1; // Mark as invalid
58
65
  pointObject.callback(null, null, null);
59
66
  return false;
60
67
  }
61
68
  ;
62
- pointObject.long = long;
63
- pointObject.lat = lat;
64
69
  const index = this._metaCalculater.getFlooredIndex(long, lat);
65
70
  pointObject.posIndex = index;
66
71
  this._findAndSend(key);
@@ -118,6 +123,9 @@ export class TexturePointSampler {
118
123
  return;
119
124
  }
120
125
  const { posIndex, callback } = pointObject;
126
+ if (posIndex === -1) {
127
+ callback(null, null, null);
128
+ }
121
129
  const data0 = this._textures[0][posIndex];
122
130
  if (this._textureCount === 1) {
123
131
  callback(data0, data0, data0);