@pirireis/webglobeplugins 0.6.39-a → 0.6.41-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.39-a",
3
+ "version": "0.6.41-a",
4
4
  "main": "index.js",
5
5
  "author": "Toprak Nihat Deniz Ozturk",
6
6
  "license": "MIT"
@@ -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,12 +223,18 @@ class RangeRings {
223
223
 
224
224
  }
225
225
 
226
+
227
+ /**
228
+ * Use on ContextTextWriter adaptor methods are updated
229
+ * */
226
230
  updateText(textWriterIDs) {
227
231
  const textWritersMap = textWriterGetOrThrow(this._textWritersMap, textWriterIDs);
228
232
  this._ringAccount.updateAllText(textWritersMap, this._textDataPreAdaptor);
229
233
  this.globe.DrawRender();
230
234
  }
231
235
 
236
+
237
+
232
238
  /**
233
239
  * @method removeCenters @param { Array < { centerID } >} centerIDs
234
240
  */
@@ -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,15 +159,15 @@ 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, properties: properties });
162
+ this.itemMap.set(key, { long: coords.long, lat: coords.lat, text, opacity, angle, zPayload: item, position });
163
163
  }
164
164
 
165
165
 
166
-
167
166
  clear() {
168
167
  this.itemMap.clear();
169
168
  }
170
169
 
170
+
171
171
  free() {
172
172
  this.itemMap = null;
173
173
  }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * registerMap(id, aMap, textFont)
3
+ * aMap key, object map.
4
+ * aMap is a specifical tem for a use case.
5
+ * The object has { text, long, lat, opacity, angle, zPayload, achor, xOffset, yOffset, ...extraPropertiesForZoomLevelAdaptor } properties.
6
+ * the plugin runs over items in aMap and draw text on the globe.
7
+ */