@pirireis/webglobeplugins 0.8.23 → 0.8.24

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/wind/plugin.js +9 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pirireis/webglobeplugins",
3
- "version": "0.8.23",
3
+ "version": "0.8.24",
4
4
  "main": "index.js",
5
5
  "author": "Toprak Nihat Deniz Ozturk",
6
6
  "license": "MIT"
package/wind/plugin.js CHANGED
@@ -605,11 +605,8 @@ export default class WindPlugin {
605
605
 
606
606
  gl.useProgram(currentProgram);
607
607
 
608
- if (this.coordinatesDataCalculator) {
609
- const magnitude = imageToMagnitude(windData);
610
- this.coordinatesDataCalculator.updateData(0, magnitude, magnitude);
611
608
 
612
- }
609
+ this._setCoorcinatesDataCalculatorData();
613
610
  this.resize();
614
611
  }
615
612
 
@@ -640,10 +637,15 @@ export default class WindPlugin {
640
637
 
641
638
 
642
639
  _createPointCoordinatesDataCalculator() {
643
- if (!this.windData) {
644
- throw new Error("wind plugin. _createPointCoordinatesDataCalculator is called before wind data is set.");
645
- }
646
640
  this.coordinatesDataCalculator = new PointCoordinatesDataCalculator(this.windData.bbox, this.windData.width, this.windData.height);
641
+ this._setCoorcinatesDataCalculatorData();
642
+ }
643
+
644
+
645
+ _setCoorcinatesDataCalculatorData() {
646
+ if (!this.windData || !this.coordinatesDataCalculator) {
647
+ return;
648
+ }
647
649
  const magnitude = imageToMagnitude(this.windData);
648
650
  this.coordinatesDataCalculator.updateData(0, magnitude, magnitude);
649
651
  }