@pirireis/webglobeplugins 0.10.3-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.
@@ -206,7 +206,6 @@ export class IsobarRasterToVector {
206
206
  }
207
207
  }
208
208
  _isobarsCheckAndComplete(isobars) {
209
- window.isobars = isobars;
210
209
  if (!Array.isArray(isobars))
211
210
  throw new Error("isobars must be an array");
212
211
  if (isobars.length === 0)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pirireis/webglobeplugins",
3
- "version": "0.10.3-alpha",
3
+ "version": "0.10.5-alpha",
4
4
  "main": "index.js",
5
5
  "author": "Toprak Nihat Deniz Ozturk",
6
6
  "license": "MIT",
@@ -2,7 +2,6 @@ import { createProgram } from "../../util";
2
2
  export default class {
3
3
  constructor(gl) {
4
4
  this.gl = gl;
5
- // console.log("Float2LegendWithRatioProgram gl:", gl);
6
5
  this._width = 1;
7
6
  this._height = 1;
8
7
  this._blendRatio = 0.0;
@@ -12,7 +12,7 @@ export const SeaWaveUbo = /*@__PURE__*/ new UniformBlockManager("Seawave_UBO", [
12
12
  { name: "drop_rate", type: "float", value: INITIAL_UBO_DATA.slice(7, 8) },
13
13
  { name: "color", type: "vec3", value: INITIAL_UBO_DATA.slice(4, 7) },
14
14
  ], UBO_BINDING_POINTS.SEAWAVE);
15
- window.SeaWaveUbo = SeaWaveUbo;
15
+ // window add properties
16
16
  // const shaderUboSource = `
17
17
  // layout(std140) uniform UBO {
18
18
  // float random_seed;
@@ -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);
@@ -10,7 +10,6 @@ function centigradePlus90ToVectorArray(centigradeArray, noDataValue = -9999) {
10
10
  const y = Math.sin(rad);
11
11
  vectorArray.set([x, y], i * 2);
12
12
  }
13
- console.log('centigradePlus90ToVectorArray', vectorArray);
14
13
  return vectorArray;
15
14
  }
16
15
  export { centigradePlus90ToVectorArray };
@@ -77,16 +77,6 @@ export default class Plugin {
77
77
  gl.bindTexture(gl.TEXTURE_2D, null);
78
78
  return texture;
79
79
  }
80
- displayUBO() {
81
- const { gl } = this;
82
- //read this.waveUbo.ubo content and pring
83
- const float32array = new Float32Array(SeaWaveUbo.size / Float32Array.BYTES_PER_ELEMENT);
84
- console.log("WaveUbo initial data size:", SeaWaveUbo.size / Float32Array.BYTES_PER_ELEMENT);
85
- gl.bindBuffer(gl.UNIFORM_BUFFER, this.waveUbo.ubo);
86
- gl.getBufferSubData(gl.UNIFORM_BUFFER, 0, float32array);
87
- gl.bindBuffer(gl.UNIFORM_BUFFER, null);
88
- console.log("WaveUbo initial data:", float32array);
89
- }
90
80
  _step() {
91
81
  this._stepIndex = (this._stepIndex + 1) % this._fullCycleStepCount;
92
82
  }