@pirireis/webglobeplugins 0.1.3 → 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.3",
3
+ "version": "0.1.5",
4
4
  "main": "index.js",
5
5
  "author": "Toprak Nihat Deniz Ozturk",
6
6
  "license": "MIT"
@@ -32,7 +32,7 @@ out vec4 v_color;
32
32
  void main() {
33
33
  if( flag == 1.0 || radius == 0.0 ) return; // 1.0 is hide
34
34
  v_color = color;
35
- if ( pad_angle == 0.0 ) v_color.rgb += 0.2;
35
+ if ( pad_angle == 0.0 ) v_color.rgb -= 0.2;
36
36
  gl_PointSize = 2.0;
37
37
 
38
38
  float odd = mod(float(gl_VertexID), 2.0);
@@ -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
@@ -292,8 +291,8 @@ export default class RangeRingAngleText {
292
291
  });
293
292
  }
294
293
  let aci = stepAngle;
295
- const cutAway = 0 == (360 % stepAngle) ? 1 : 0;
296
- for (let i = 1; i < coords_.length - cutAway; i++) {
294
+ for (let i = 1; i < coords_.length; i++) {
295
+ if (aci >= 360) break;
297
296
  const { long, lat } = coords_[i];
298
297
  coords.push(long, lat);
299
298
  coordsZ.push(0);
@@ -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
 
@@ -100,7 +100,7 @@ export default class {
100
100
 
101
101
  /**
102
102
  * @typedef {Array<{ringID, radius, paddingRange}>} rings
103
- * @param {Array<centerID:string, x:number, y:number, paddingAngles:Array<number>, rgba:[4number], rings:rings} items
103
+ * @param {Array<centerID:string, x:number, y:number, stepAngle:number, rgba:[4 numbers], rings:rings} items
104
104
  */
105
105
  insertBulk(items) {
106
106
  const insertData = ringItemsToCircleBufferInsertDataAdaptor(items);
@@ -132,7 +132,6 @@ export default class {
132
132
 
133
133
  // TODO: test
134
134
  removeCenters(centerIds) {
135
-
136
135
  this.bufferManager.removeCenters(centerIds);
137
136
  this.paddingBufferManager.removeCenters(centerIds);
138
137
  this._textPlugin?.removeCenters(centerIds);