@pirireis/webglobeplugins 0.7.4 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pirireis/webglobeplugins",
3
- "version": "0.7.4",
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) => {
@@ -76,7 +77,7 @@ class PointHeatmapPlugin {
76
77
  setTime(time) {
77
78
  // TODO: WORK ON THIS
78
79
  this._time = time;
79
- if (this._throttleListener === null) {
80
+ if (this.isReady() && this._throttleListener === null) {
80
81
  this._throttleListener = setTimeout(() => {
81
82
  this.timeTrackInterpolationWorker.postMessage({ time: this._time });
82
83
  }, 0);
@@ -85,6 +86,7 @@ class PointHeatmapPlugin {
85
86
 
86
87
 
87
88
  setTimetracks(timeTracks) {
89
+ this._timeTracksAreSet = true;
88
90
  this.timeTrackInterpolationWorker.postMessage({ timeTracks });
89
91
  if (this._time !== null) {
90
92
  this.setTime(this._time);
@@ -128,7 +130,7 @@ class PointHeatmapPlugin {
128
130
 
129
131
 
130
132
  isReady() {
131
- return (this.gl !== null && this._legendTexture !== null);
133
+ return (this.gl !== null && this._legendTexture !== null && this._timeTracksAreSet);
132
134
  }
133
135
 
134
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 } = {}) {