@pirireis/webglobeplugins 0.8.12 → 0.8.14
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/bearing-line/plugin.js +21 -17
- package/circle-line-chain/plugin.js +4 -1
- package/package.json +1 -1
- package/rangerings/plugin.js +26 -2
package/bearing-line/plugin.js
CHANGED
|
@@ -16,6 +16,23 @@ export const RINGPARTIAL_DRAW_MODE = Object.freeze({
|
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* @typedef {{key, long, lat, endLong, endLat, bearingAngle, radius, rgba:[4numbers], rgbaMode, bigRadius, dashRatio, dashOpacity, circleDashAngle}} BearingLineItem
|
|
21
|
+
* @property {string} key
|
|
22
|
+
* @property {number} long
|
|
23
|
+
* @property {number} lat
|
|
24
|
+
* @property {number} endLong
|
|
25
|
+
* @property {number} endLat
|
|
26
|
+
* @property {number} bearingAngle 0-360
|
|
27
|
+
* @property {number} radius angle ring radius
|
|
28
|
+
* @property {number} altitude in meters effects all parts of the item
|
|
29
|
+
* @property {Array<numbers>} rgba [r,g,b,a] 0-1
|
|
30
|
+
* @property {number} rgbaMode 0 constant, 1 fading, 2 hides angle ring
|
|
31
|
+
* @property {number} bigRadius undefined means it will be calculated from long, lat, endLong, endLat
|
|
32
|
+
* @property {number} dashRatio 0-1
|
|
33
|
+
* @property {number} dashOpacity 0-1
|
|
34
|
+
* @property {number} circleDashAngle 0-360
|
|
35
|
+
*/
|
|
19
36
|
|
|
20
37
|
const textWriterGetOrThrow = mapGetOrThrow("BearingLine textContextInjection id does not exist in map")
|
|
21
38
|
|
|
@@ -110,21 +127,8 @@ export default class BearingLinePlugin {
|
|
|
110
127
|
|
|
111
128
|
|
|
112
129
|
/**
|
|
113
|
-
|
|
114
|
-
* @
|
|
115
|
-
* @property {number} long
|
|
116
|
-
* @property {number} lat
|
|
117
|
-
* @property {number} endLong
|
|
118
|
-
* @property {number} endLat
|
|
119
|
-
* @property {number} bearingAngle 0-360
|
|
120
|
-
* @property {number} radius angle ring radius
|
|
121
|
-
* @property {Array<4numbers>} rgba [r,g,b,a]
|
|
122
|
-
* @property {number} rgbaMode 0 constant, 1 fading, 2 hides angle ring
|
|
123
|
-
* @property {number} bigRadius undefined means it will be calculated from long, lat, endLong, endLat
|
|
124
|
-
* @property {number} dashRatio 0-1
|
|
125
|
-
* @property {number} dashOpacity 0-1
|
|
126
|
-
* @property {number} circleDashAngle 0-360
|
|
127
|
-
* @param {Array<item>} items
|
|
130
|
+
|
|
131
|
+
* @param {Array<BearingLineItem>} items
|
|
128
132
|
* @param {Array<string>} textWriterIDs | textWritersMap keys to be used for writing text.
|
|
129
133
|
*/
|
|
130
134
|
insertBulk(items, { textWriterIDs = [] } = {}) {
|
|
@@ -198,7 +202,7 @@ export default class BearingLinePlugin {
|
|
|
198
202
|
|
|
199
203
|
/**
|
|
200
204
|
*
|
|
201
|
-
* @param {
|
|
205
|
+
* @param {Array<BearingLineItem>} items some colums EXCEPT positional ones
|
|
202
206
|
* @param {string} propertyIDs
|
|
203
207
|
* @param {string} textWriterIDs
|
|
204
208
|
* Do NOT send empty data if property ID of this data is entered or NaN is loaded to the buffer, resulting in an unwanted behaviour.
|
|
@@ -262,7 +266,7 @@ export default class BearingLinePlugin {
|
|
|
262
266
|
const endLat = radian(item.endLat)
|
|
263
267
|
const endLong = radian(item.endLong)
|
|
264
268
|
const altitude = (item.altitude ?? 0) / 1000;
|
|
265
|
-
const bigRadius = item.bigRadius ?? globe.Math.
|
|
269
|
+
const bigRadius = item.bigRadius ?? globe.Math.GetDist2D(item.long, item.lat, item.endLong, item.endLat);
|
|
266
270
|
const radius = item.radius !== undefined ? item.radius : bigRadius * 0.2;
|
|
267
271
|
const { long: bearingLong, lat: bearingLat } = globe.Math.FindPointByPolar(item.long, item.lat, bigRadius, item.bearingAngle)
|
|
268
272
|
const startAngle2d = calculateStartAngle(long, lat, endLong, endLat);
|
|
@@ -37,6 +37,7 @@ import { sphereCoord } from '../util/geometry/index';
|
|
|
37
37
|
* @property {string} key
|
|
38
38
|
* @property {number} long
|
|
39
39
|
* @property {number} lat
|
|
40
|
+
* @property {number} altitude
|
|
40
41
|
* @property {StyleProperties} circleProperties
|
|
41
42
|
*
|
|
42
43
|
* @typedef {Object} Node
|
|
@@ -49,7 +50,9 @@ import { sphereCoord } from '../util/geometry/index';
|
|
|
49
50
|
* @property { number} dashOpacity 0-1
|
|
50
51
|
* @property { number} dashRatio 0-1
|
|
51
52
|
* @property { number } circleDashAngle 0-360
|
|
52
|
-
* @property {
|
|
53
|
+
* @property { number} altitude
|
|
54
|
+
*
|
|
55
|
+
* //property {Array<Node>} nodes
|
|
53
56
|
*/
|
|
54
57
|
|
|
55
58
|
|
package/package.json
CHANGED
package/rangerings/plugin.js
CHANGED
|
@@ -47,6 +47,31 @@ const coordOnSphere = (long, lat, globe, altitude = 0) => {
|
|
|
47
47
|
return normalize(coord, 6378.137 + altitude);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
*
|
|
54
|
+
* @typedef {string} centerID
|
|
55
|
+
*
|
|
56
|
+
* @typedef {Object} RangeRing
|
|
57
|
+
* @property {string} ringID
|
|
58
|
+
* @property {number} radius in range meters
|
|
59
|
+
* @property {number} padding badding range in meter
|
|
60
|
+
*
|
|
61
|
+
*
|
|
62
|
+
* Array < centerID: string, long: number, lat: number, stepAngle: number, rgba: [4 numbers], rings: rings, hide, textHide
|
|
63
|
+
* @typedef {Object} RangeRingsItem
|
|
64
|
+
* @property {centerID} centerID
|
|
65
|
+
* @property {number} long
|
|
66
|
+
* @property {number} lat
|
|
67
|
+
* @property {number} stepAngle
|
|
68
|
+
* @property {number} altitude
|
|
69
|
+
* @property {number} hide
|
|
70
|
+
* @property {number} textHide
|
|
71
|
+
* @property {number} rgba
|
|
72
|
+
* @property {Array<RangeRing>} rings
|
|
73
|
+
*/
|
|
74
|
+
|
|
50
75
|
class RangeRings {
|
|
51
76
|
constructor(id,
|
|
52
77
|
{
|
|
@@ -102,8 +127,7 @@ class RangeRings {
|
|
|
102
127
|
|
|
103
128
|
/**
|
|
104
129
|
* @method insertBulk
|
|
105
|
-
* @
|
|
106
|
-
* @param { Array < centerID: string, long: number, lat: number, stepAngle: number, rgba: [4 numbers], rings: rings, hide, textHide } items
|
|
130
|
+
* @param { Array < RangeRingsItem> } items
|
|
107
131
|
*/
|
|
108
132
|
insertBulk(items, { textWriterIDs = [] } = {}) {
|
|
109
133
|
// Algorithm
|