@pirireis/webglobeplugins 0.7.3 → 0.7.5

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.
@@ -49,7 +49,6 @@ export class PixelPaddingCompassTextWriter {
49
49
  this.northFont = northFont;
50
50
  this.doDraw = doDraw;
51
51
  this.angle = angle;
52
- console.log("CSMeasureTextPositionTypes", CSMeasureTextPositionTypes);
53
52
  this.angles = []
54
53
  this.texts = []
55
54
  this.positions = []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pirireis/webglobeplugins",
3
- "version": "0.7.3",
3
+ "version": "0.7.5",
4
4
  "main": "index.js",
5
5
  "author": "Toprak Nihat Deniz Ozturk",
6
6
  "license": "MIT"
@@ -16,6 +16,7 @@ class PointHeatmapPlugin {
16
16
  this._legendTexture = null;
17
17
 
18
18
  this._throttleListener = null;
19
+ this._timeTracksAreSet = false;
19
20
  const blob = new Blob([webworkerStr], { type: 'application/javascript' });
20
21
  this.timeTrackInterpolationWorker = new Worker(URL.createObjectURL(blob), { type: 'module' });
21
22
  this.timeTrackInterpolationWorker.onmessage = (e) => {
@@ -39,7 +40,8 @@ class PointHeatmapPlugin {
39
40
  this.globe = globe;
40
41
  this.gl = gl;
41
42
  this.flow = new PointHeatmapFlow(globe);
42
-
43
+ this.setGeometry();
44
+ this.resize();
43
45
  }
44
46
 
45
47
 
@@ -62,11 +64,8 @@ class PointHeatmapPlugin {
62
64
  if (this.gl === null) {
63
65
  throw new Error('Plugin not initialized');
64
66
  };
65
- console.log(values, thresholds, mode);
66
67
  const rampData = getColorRampModed(values, thresholds, mode);
67
- console.log(rampData);
68
68
  const texture = createTexture(gl, gl.LINEAR, rampData, 256, 1);
69
- console.log(texture);
70
69
  if (this._legendTexture) {
71
70
  this.gl.deleteTexture(this._legendTexture);
72
71
  }
@@ -78,7 +77,7 @@ class PointHeatmapPlugin {
78
77
  setTime(time) {
79
78
  // TODO: WORK ON THIS
80
79
  this._time = time;
81
- if (this._throttleListener === null) {
80
+ if (this.isReady() && this._throttleListener === null) {
82
81
  this._throttleListener = setTimeout(() => {
83
82
  this.timeTrackInterpolationWorker.postMessage({ time: this._time });
84
83
  }, 0);
@@ -87,6 +86,7 @@ class PointHeatmapPlugin {
87
86
 
88
87
 
89
88
  setTimetracks(timeTracks) {
89
+ this._timeTracksAreSet = true;
90
90
  this.timeTrackInterpolationWorker.postMessage({ timeTracks });
91
91
  if (this._time !== null) {
92
92
  this.setTime(this._time);
@@ -130,7 +130,7 @@ class PointHeatmapPlugin {
130
130
 
131
131
 
132
132
  isReady() {
133
- return (this.gl !== null && this._legendTexture !== null);
133
+ return (this.gl !== null && this._legendTexture !== null && this._timeTracksAreSet);
134
134
  }
135
135
 
136
136
  free() {
@@ -1,7 +1,7 @@
1
1
  import { PointHeatmapFlow } from "./point-to-heat-map-flow";
2
2
  import { TimeTrackInterpolator } from "../util/interpolation/timetrack/timetrack-interpolator";
3
3
  import { createTexture, getColorRampModed } from "../util";
4
-
4
+ // TODO: DEPRECATED
5
5
  class PointHeatmapPlugin {
6
6
 
7
7
  constructor(id, { opacity = 1.0, pointSize = 5.0 } = {}) {
@@ -24,7 +24,8 @@ class PointHeatmapPlugin {
24
24
  this.globe = globe;
25
25
  this.gl = gl;
26
26
  this.flow = new PointHeatmapFlow(globe);
27
-
27
+ this.setGeometry();
28
+ this.resize();
28
29
  }
29
30
 
30
31
 
@@ -47,11 +48,8 @@ class PointHeatmapPlugin {
47
48
  if (this.gl === null) {
48
49
  throw new Error('Plugin not initialized');
49
50
  };
50
- console.log(values, thresholds, mode);
51
51
  const rampData = getColorRampModed(values, thresholds, mode);
52
- console.log(rampData);
53
52
  const texture = createTexture(gl, gl.LINEAR, rampData, 256, 1);
54
- console.log(texture);
55
53
  if (this._legendTexture) {
56
54
  this.gl.deleteTexture(this._legendTexture);
57
55
  }
@@ -364,18 +364,4 @@ export default class RangeRingAngleText {
364
364
  this._updateData(updateBucket, CSObjectArrayUpdateTypes.UPDATE);
365
365
  }
366
366
 
367
- }
368
-
369
-
370
-
371
- const realCircle = (globe, longitude, latitude, radius, stepAngle) => {
372
- const pointsLongLat = globe.Math.F(
373
- longitude,
374
- latitude,
375
- radius,
376
- radius,
377
- 0,
378
- stepAngle);
379
- console.log("pointsLongLat", stepAngle, pointsLongLat)
380
- return pointsLongLat;
381
- }
367
+ }
@@ -178,7 +178,6 @@ export default class TimeTrackMultiColorPlugin {
178
178
  * Check Class constructor
179
179
  */
180
180
  setData(data) {
181
- console.log(data);
182
181
  if (this.gl) {
183
182
  this._ready = false;
184
183
  this.setDataAsFloat32Array(data);
@@ -42,7 +42,6 @@ class TimeTrackInterpolator {
42
42
  }
43
43
 
44
44
  setTimetracks(timeTracks) {
45
- console.log("timetracks:", timeTracks);
46
45
  this.timeTracks = timeTracks;
47
46
  }
48
47
 
@@ -89,7 +89,6 @@ class TimeTrackInterpolator {
89
89
  }
90
90
 
91
91
  setTimetracks(timeTracks) {
92
- console.log("timetracks:", timeTracks);
93
92
  this.timeTracks = timeTracks;
94
93
  }
95
94
 
@@ -51,7 +51,7 @@ export function createProgramWrapper(gl, vertexSource, fragmentSource) {
51
51
 
52
52
  gl.linkProgram(program);
53
53
  if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
54
- console.log(gl.getProgramInfoLog(program));
54
+ // console.log(gl.getProgramInfoLog(program));
55
55
  throw new Error(gl.getProgramInfoLog(program));
56
56
  }
57
57