@pirireis/webglobeplugins 0.8.0 → 0.8.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 +1 -1
- package/point-tracks/plugin.js +9 -14
package/package.json
CHANGED
package/point-tracks/plugin.js
CHANGED
|
@@ -4,46 +4,40 @@ import { PickerDisplayer } from "../util/picking/picker-displayer";
|
|
|
4
4
|
import { pointOnGlobeProgramCache } from "../programs/point-on-globe/square-pixel-point";
|
|
5
5
|
|
|
6
6
|
import { wgs84ToCartesian3d, wgs84ToMercator } from "../Math/methods";
|
|
7
|
-
import { hover } from "@testing-library/user-event/dist/hover";
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
|
-
*
|
|
9
|
+
* @typedef {number} long
|
|
10
|
+
* @typedef {number} lat
|
|
11
|
+
* @typedef {number} height
|
|
12
|
+
* @typedef {string} ID
|
|
13
|
+
* @typedef {string} trackID
|
|
14
|
+
* @typedef {[number, number, number, number]} rgba 0-1
|
|
11
15
|
* @typedef { long ,lat, height, ID } Point
|
|
12
16
|
* @typedef {Array<Point>, rgba, trackID} Track
|
|
13
17
|
*/
|
|
14
18
|
|
|
15
|
-
// TODO: redraw after insert and delete operations
|
|
16
19
|
|
|
17
20
|
class PointTracksPlugin {
|
|
18
21
|
|
|
19
22
|
constructor(id, { pointSize = 2, hoveredPointSize = 4, selectionPointFilling = 4, opacity = 1.0 } = {}) {
|
|
20
23
|
this.id = id;
|
|
21
24
|
this._isFreed = false;
|
|
22
|
-
|
|
23
25
|
this._pointProgram = null
|
|
24
26
|
this._vao = null;
|
|
25
27
|
this._bufferManagersMap = null;
|
|
26
28
|
this._bufferOrchestrator = null;
|
|
27
|
-
|
|
28
29
|
this._pickerDisplayer = null
|
|
29
30
|
this._selectedID = -1;
|
|
30
31
|
this._selectedObj = null;
|
|
31
|
-
|
|
32
32
|
this._tracksToPointsMap = new Map(); // one to many
|
|
33
|
-
|
|
34
33
|
this._opacity = opacity;
|
|
34
|
+
this.program = null
|
|
35
|
+
this._lastWH = { w: 0, h: 0 };
|
|
35
36
|
this.pointSizes = {
|
|
36
37
|
pointSize,
|
|
37
38
|
selectionPointFilling,
|
|
38
39
|
hoveredPointSize
|
|
39
40
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
this._lastWH = { w: 0, h: 0 };
|
|
43
|
-
|
|
44
|
-
this.program = null
|
|
45
|
-
// selectionPointFilling will be used to create a selection buffer and the iteration
|
|
46
|
-
|
|
47
41
|
}
|
|
48
42
|
|
|
49
43
|
|
|
@@ -268,6 +262,7 @@ class PointTracksPlugin {
|
|
|
268
262
|
}
|
|
269
263
|
}
|
|
270
264
|
|
|
265
|
+
|
|
271
266
|
_deletePointsFromTracksMap(trackID, pointIDs) {
|
|
272
267
|
const trackSet = this._tracksToPointsMap.get(trackID);
|
|
273
268
|
for (const pointID of pointIDs) {
|