@pirireis/webglobeplugins 0.6.38-a → 0.6.40-a

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": "0.6.38-a",
3
+ "version": "0.6.40-a",
4
4
  "main": "index.js",
5
5
  "author": "Toprak Nihat Deniz Ozturk",
6
6
  "license": "MIT"
@@ -132,7 +132,6 @@ class Logic {
132
132
  vaoAttributeLoader(gl, buffer, 0, 3, stride, offset, divisor);
133
133
  }
134
134
  {
135
- console.log("bigRadiusObj", bigRadiusObj);
136
135
  const { buffer, stride = 0, offset = 0 } = bigRadiusObj;
137
136
  vaoAttributeLoader(gl, buffer, 1, 1, stride, offset, divisor);
138
137
  }
@@ -1,4 +1,5 @@
1
1
  import { RangeRings } from "./plugin";
2
+ import { ringKeyMethod } from "./ring-account";
2
3
  import RangeRingAngleText from './rangeringangletext';
3
4
  import { ENUM_HIDE, ENUM_TEXT_HIDE, COMPASS_MODES } from './enum';
4
- export { RangeRings, ENUM_HIDE, ENUM_TEXT_HIDE, COMPASS_MODES, RangeRingAngleText };
5
+ export { RangeRings, ENUM_HIDE, ENUM_TEXT_HIDE, COMPASS_MODES, RangeRingAngleText, ringKeyMethod };
@@ -223,6 +223,12 @@ class RangeRings {
223
223
 
224
224
  }
225
225
 
226
+ updateText(textWriterIDs) {
227
+ const textWritersMap = textWriterGetOrThrow(this._textWritersMap, textWriterIDs);
228
+ this._ringAccount.updateAllText(textWritersMap, this._textDataPreAdaptor);
229
+ this.globe.DrawRender();
230
+ }
231
+
226
232
  /**
227
233
  * @method removeCenters @param { Array < { centerID } >} centerIDs
228
234
  */
@@ -111,6 +111,12 @@ class RingAccount {
111
111
  });
112
112
 
113
113
  }
114
+
115
+ updateAllText(textWriterObjs, dataPreAdaptor = null) {
116
+ this._centeralMap.forEach((center) => {
117
+ this.textUpdate(center.centerID, textWriterObjs, dataPreAdaptor);
118
+ });
119
+ }
114
120
  }
115
121
 
116
122
 
@@ -3,7 +3,7 @@ import { isTextFont, opacityCheck } from "../util/check/typecheck";
3
3
 
4
4
  /**
5
5
  * TODOs:
6
- * 1) update all if initials change (propably need a context and a callback to iterate over payload)
6
+ * 1) update all if initials change (propably need a context and a callback to iterate over zPayload)
7
7
  * 2) expose a mechanic to update text on zoom change
8
8
  * 3) extend the mechanic on 2 to other events
9
9
  */
@@ -108,7 +108,7 @@ export class ContextTextWriter3 {
108
108
  const zoomLevel = globe.api_GetCurrentLODWithDecimal();
109
109
  const zoomAdaptor = this.zoomLevelAdaptor(zoomLevel);
110
110
  for (const item of itemMap.values()) {
111
- const { lat, long, text, opacity = null, angle = null, payload, position } = item;
111
+ const { lat, long, text, opacity = null, angle = null, zPayload, position } = item;
112
112
  const { x, y } = globe.api_GetScreenPointFromGeo(
113
113
  {
114
114
  long: long,
@@ -117,7 +117,7 @@ export class ContextTextWriter3 {
117
117
  },
118
118
  style.zMode === CSZMode.Z_MSL,
119
119
  );
120
- const { opacityMultiplier, sizeMultiplier } = zoomAdaptor(payload);
120
+ const { opacityMultiplier, sizeMultiplier } = zoomAdaptor(zPayload);
121
121
  const o = (opacity === null ? opacity_ : opacity * opacity_) * opacityMultiplier;
122
122
  textFont.size = sizeMultiplier * textSize;
123
123
  textFont.position = position;
@@ -159,11 +159,21 @@ export class ContextTextWriter3 {
159
159
  const opacity = this.opacityAdaptor(item, id, container, properties);
160
160
  const angle = this.angleAdaptor(item, id, container, properties);
161
161
  const position = this.positionAdaptor(item, id, container, properties);
162
- this.itemMap.set(key, { long: coords.long, lat: coords.lat, text, opacity, angle, payload: item, position });
162
+ this.itemMap.set(key, { long: coords.long, lat: coords.lat, text, opacity, angle, zPayload: item, position });
163
163
  }
164
164
 
165
165
 
166
166
 
167
+ updateData(key, updateMap) {
168
+ const item = this.itemMap.get(key);
169
+ if (item) {
170
+ for (const [key, value] of updateMap) {
171
+ item[key] = value;
172
+ }
173
+ }
174
+ this.globe.DrawRender();
175
+ }
176
+
167
177
  clear() {
168
178
  this.itemMap.clear();
169
179
  }