@pirireis/webglobeplugins 1.4.0 → 1.4.1

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": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "main": "index.js",
5
5
  "author": "Toprak Nihat Deniz Ozturk",
6
6
  "license": "MIT",
@@ -169,18 +169,12 @@ class PointTracksPlugin {
169
169
  const wrapper = (selectedIDsSet) => {
170
170
  const selectedIDs = Array.from(selectedIDsSet);
171
171
  if (selectedIDs.length === 0) {
172
- this._selectedObj = null;
173
- this._selectedID = -1;
174
172
  callback([]);
175
173
  return;
176
174
  }
177
175
  const selectedPoints = [];
178
176
  for (let i = 0; i < selectedIDs.length; i++) {
179
177
  const id = selectedIDs[i];
180
- if (i === 0) {
181
- this._selectedID = id;
182
- this._selectedObj = objectStore.get(id);
183
- }
184
178
  const obj = objectStore.get(id);
185
179
  selectedPoints.push(obj);
186
180
  }
@@ -366,27 +360,38 @@ class PointTracksPlugin {
366
360
  this._tracksToPointsMap.delete(trackID);
367
361
  }
368
362
  }
369
- _selfSelect() {
370
- const { globe } = this;
371
- const pos = globe.api_GetMousePos();
372
- const x = pos.canvasX;
373
- const y = globe.api_ScrH() - pos.canvasY;
374
- this.screenSelection(x, y, (selectedPoints) => {
375
- if (selectedPoints.length > 0) {
376
- if (this._lastSelectedID !== this._selectedID) {
377
- this._lastSelectedID = this._selectedID;
378
- this._drawOptionsUBO.updateSingle("hovered_vertexID", this._selectedID);
379
- this.globe.DrawRender();
380
- }
381
- }
382
- else {
363
+ _updateHoverState(x, y) {
364
+ const { pointSizes, _pickerDisplayer } = this;
365
+ const objectStore = this._StorageManagersMap.get("objectStore").bufferManager;
366
+ const wrapper = (selectedIDsSet) => {
367
+ const selectedIDs = Array.from(selectedIDsSet);
368
+ if (selectedIDs.length === 0) {
369
+ this._selectedObj = null;
370
+ this._selectedID = -1;
383
371
  if (this._lastSelectedID !== -1) {
384
372
  this._lastSelectedID = -1;
385
373
  this._drawOptionsUBO.updateSingle("hovered_vertexID", -1);
386
374
  this.globe.DrawRender();
387
375
  }
376
+ return;
388
377
  }
389
- });
378
+ const id = selectedIDs[0];
379
+ this._selectedID = id;
380
+ this._selectedObj = objectStore.get(id);
381
+ if (this._lastSelectedID !== this._selectedID) {
382
+ this._lastSelectedID = this._selectedID;
383
+ this._drawOptionsUBO.updateSingle("hovered_vertexID", this._selectedID);
384
+ this.globe.DrawRender();
385
+ }
386
+ };
387
+ _pickerDisplayer.pickXY(x, y, pointSizes.selectionPointFilling, wrapper);
388
+ }
389
+ _selfSelect() {
390
+ const { globe } = this;
391
+ const pos = globe.api_GetMousePos();
392
+ const x = pos.canvasX;
393
+ const y = globe.api_ScrH() - pos.canvasY;
394
+ this._updateHoverState(x, y);
390
395
  }
391
396
  _turnOffFocus() {
392
397
  const { gl } = this;