@pirireis/webglobeplugins 0.1.4 → 0.1.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.
@@ -29,11 +29,11 @@ const object = {
29
29
  "text": "'${title}'",
30
30
  "textCallback": null,
31
31
  "offset": {
32
- "x": 16,
33
- "y": -16
32
+ "x": 0,
33
+ "y": 0
34
34
  },
35
- "vAlignment": 0,
36
- "hAlignment": 0,
35
+ "vAlignment": 2,
36
+ "hAlignment": 2,
37
37
  "size": 20,
38
38
  "hollowColor": "#000",
39
39
  "textColor": "#FFF",
@@ -208,37 +208,6 @@ const setFIDKey = (object, key) => {
208
208
  object.style.fidKey = key;
209
209
  }
210
210
 
211
- const IMAGE_URL = "10494_1024px-compass-rose-simple.svg.png";
212
-
213
- export class RotationalIcon2D {
214
- constructor(id, globe) {
215
- this.id = id;
216
- this.globe = globe;
217
- this.objectType = CSObjectTypes.POINT;
218
- const symbolSet = "symbolSetName";
219
- // copy object
220
- this.object = object;
221
- this.setData(
222
- [
223
- {
224
- coords: [32, 40, 34, 42, 35, 41],
225
- coordsZ: [0, 0, 0],
226
- attribs: [
227
- ]
228
- }
229
- ]
230
- )
231
- setIconSize(this.object, 100);
232
- setMapName(this.object, symbolSet);
233
- setIconName(this.object, symbolSet);
234
- addSingleImageIconMap(symbolSet)(IMAGE_URL);
235
- globe.ObjectArray.Add(this.object);
236
- }
237
- setData(data) {
238
- const { globe, object } = this;
239
- setData(object, data);
240
- }
241
- }
242
211
 
243
212
 
244
213
  export default class CompassRose {
@@ -1,3 +1,2 @@
1
1
  import CompassRose from "./compassrose";
2
- import { RotationalIcon2D } from "./compassrose";
3
- export { CompassRose, RotationalIcon2D };
2
+ export { CompassRose };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pirireis/webglobeplugins",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "main": "index.js",
5
5
  "author": "Toprak Nihat Deniz Ozturk",
6
6
  "license": "MIT"
@@ -33,10 +33,10 @@ const object = {
33
33
 
34
34
 
35
35
  export default class RangeRingAngleText {
36
- constructor(globe, { style = null, flatCompassMode = COMPASS_MODES.REAL } = {}) {
36
+ constructor(globe, id, { style = null, flatCompassMode = COMPASS_MODES.REAL } = {}) {
37
37
  this.globe = globe;
38
38
  this.ObjectArray = globe.ObjectArray;
39
-
39
+ this.id = id;
40
40
  this._flatCompassMode = flatCompassMode;
41
41
  this._lastImplicitCompassMode = this.__implicitCompassMode();
42
42
  if (style) {
@@ -64,7 +64,7 @@ export default class RangeRingAngleText {
64
64
 
65
65
  this.style.labels[0].text = "`${aci}`"
66
66
  this.style.fidKey = fidKey;
67
- this.object = Object.assign({}, object, { style: this.style });
67
+ this.object = Object.assign({}, object, { style: this.style, id: this.id });
68
68
 
69
69
  this._centerCollection = new Map();
70
70
  // new inner MAP params
@@ -85,11 +85,10 @@ export default class RangeRingAngleText {
85
85
 
86
86
  free() {
87
87
  this.flush();
88
- this.ObjectArray.RemoveObject(this.object);
88
+ this.ObjectArray.Delete(this.id);
89
89
  }
90
90
 
91
91
 
92
-
93
92
  /**
94
93
  * @param {Array<{centerID,stepAngle, x, y, rings>} ringDatas
95
94
  * centerID: string | ObjectArray fidKey de kullanilir
@@ -31,6 +31,7 @@ export default class {
31
31
  this.bufferManager = null;
32
32
  }
33
33
 
34
+
34
35
  setOneDegreePaddingOn(oneDegreePadding) {
35
36
  this._onedegreepaddingOn = oneDegreePadding;
36
37
  }
@@ -42,7 +43,7 @@ export default class {
42
43
  this.paddyFlatProgram = new PaddyFlatProgram(globe, gl);
43
44
  this.paddingFreeAngleProgram = PaddingFreeAngleCache.getProgram(globe);
44
45
  if (this._showNumbers) {
45
- this._textPlugin = new RangeRingAngleText(globe, { flatCompassMode: this.compass });
46
+ this._textPlugin = new RangeRingAngleText(globe, this.id + "text", { flatCompassMode: this.compass });
46
47
  }
47
48
  }
48
49
 
@@ -50,9 +51,8 @@ export default class {
50
51
  free() {
51
52
  this.circleFlatProgram.free();
52
53
  this.paddyFlatProgram.free();
53
- if (this.bufferManager !== null) {
54
- this.bufferManager.free();
55
- }
54
+ this.bufferManager?.free();
55
+ this._textPlugin?.free();
56
56
  }
57
57
 
58
58