@pirireis/webglobeplugins 0.6.39-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 +1 -1
- package/rangerings/index.js +2 -1
- package/write-text/context-text3.js +14 -4
package/package.json
CHANGED
package/rangerings/index.js
CHANGED
|
@@ -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 };
|
|
@@ -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
|
|
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,
|
|
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(
|
|
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,
|
|
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
|
}
|