bruce-models 2.3.7 → 2.3.8

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.
Files changed (195) hide show
  1. package/dist/bruce-models.es5.js +8041 -8037
  2. package/dist/bruce-models.es5.js.map +1 -1
  3. package/dist/bruce-models.umd.js +7805 -7801
  4. package/dist/bruce-models.umd.js.map +1 -1
  5. package/dist/lib/account/account-invite.js +81 -81
  6. package/dist/lib/account/account-settings.js +2 -2
  7. package/dist/lib/account/account.js +169 -169
  8. package/dist/lib/account/account.js.map +1 -1
  9. package/dist/lib/ann-document/ann-document.js +94 -94
  10. package/dist/lib/api/abstract-api.js +269 -269
  11. package/dist/lib/api/api-getters.js +172 -172
  12. package/dist/lib/api/api.js +93 -93
  13. package/dist/lib/api/bruce-api.js +224 -224
  14. package/dist/lib/api/bruce-api.js.map +1 -1
  15. package/dist/lib/api/cam-api.js +88 -88
  16. package/dist/lib/api/global-api.js +82 -82
  17. package/dist/lib/api/guardian-api.js +82 -82
  18. package/dist/lib/api/idm-api.js +90 -90
  19. package/dist/lib/bruce-models.js +95 -91
  20. package/dist/lib/bruce-models.js.map +1 -1
  21. package/dist/lib/calculator/calculator.js +341 -341
  22. package/dist/lib/client-file/client-file.js +255 -255
  23. package/dist/lib/client-file/client-file.js.map +1 -1
  24. package/dist/lib/common/bounds.js +61 -61
  25. package/dist/lib/common/bruce-event.js +46 -46
  26. package/dist/lib/common/bruce-variable.js +60 -60
  27. package/dist/lib/common/cache.js +188 -188
  28. package/dist/lib/common/cache.js.map +1 -1
  29. package/dist/lib/common/camera.js +11 -11
  30. package/dist/lib/common/cartes.js +123 -123
  31. package/dist/lib/common/carto.js +60 -60
  32. package/dist/lib/common/color.js +86 -86
  33. package/dist/lib/common/delay-queue.js +56 -56
  34. package/dist/lib/common/dictionary.js +2 -2
  35. package/dist/lib/common/geometry.js +120 -120
  36. package/dist/lib/common/lru-cache.js +25 -25
  37. package/dist/lib/common/transform.js +2 -2
  38. package/dist/lib/common/utc.js +39 -39
  39. package/dist/lib/custom-form/custom-form-content.js +26 -26
  40. package/dist/lib/custom-form/custom-form.js +114 -114
  41. package/dist/lib/data-lab/data-lab.js +49 -49
  42. package/dist/lib/entity/entity-attachment-type.js +87 -87
  43. package/dist/lib/entity/entity-attachment-type.js.map +1 -1
  44. package/dist/lib/entity/entity-attachment.js +126 -126
  45. package/dist/lib/entity/entity-attachment.js.map +1 -1
  46. package/dist/lib/entity/entity-attribute.js +29 -29
  47. package/dist/lib/entity/entity-comment.js +86 -86
  48. package/dist/lib/entity/entity-comment.js.map +1 -1
  49. package/dist/lib/entity/entity-coords.js +153 -153
  50. package/dist/lib/entity/entity-coords.js.map +1 -1
  51. package/dist/lib/entity/entity-link.js +86 -86
  52. package/dist/lib/entity/entity-link.js.map +1 -1
  53. package/dist/lib/entity/entity-lod-category.js +108 -108
  54. package/dist/lib/entity/entity-lod.js +197 -197
  55. package/dist/lib/entity/entity-lod.js.map +1 -1
  56. package/dist/lib/entity/entity-relation-type.js +117 -117
  57. package/dist/lib/entity/entity-relation-type.js.map +1 -1
  58. package/dist/lib/entity/entity-relation.js +157 -157
  59. package/dist/lib/entity/entity-source.js +136 -136
  60. package/dist/lib/entity/entity-source.js.map +1 -1
  61. package/dist/lib/entity/entity-tag.js +157 -157
  62. package/dist/lib/entity/entity-type-visual-settings.js +13 -13
  63. package/dist/lib/entity/entity-type.js +122 -122
  64. package/dist/lib/entity/entity.js +341 -341
  65. package/dist/lib/entity/entity.js.map +1 -1
  66. package/dist/lib/entity/getters/batched-data-getter.js +84 -84
  67. package/dist/lib/entity/getters/batched-data-getter.js.map +1 -1
  68. package/dist/lib/entity/getters/entity-filter-getter.js +316 -316
  69. package/dist/lib/entity/getters/entity-filter-getter.js.map +1 -1
  70. package/dist/lib/entity/getters/entity-globe.js +175 -175
  71. package/dist/lib/entity/getters/view-monitor.js +2 -2
  72. package/dist/lib/import/import-cad.js +53 -53
  73. package/dist/lib/import/import-cad.js.map +1 -1
  74. package/dist/lib/import/import-csv.js +23 -23
  75. package/dist/lib/import/import-json.js +23 -23
  76. package/dist/lib/import/import-kml.js +23 -23
  77. package/dist/lib/import/imported-file.js +130 -130
  78. package/dist/lib/internal/uploader.js +76 -76
  79. package/dist/lib/internal/uploader.js.map +1 -1
  80. package/dist/lib/markup/markup.js +185 -185
  81. package/dist/lib/plugin/plugin.js +91 -91
  82. package/dist/lib/program-key/program-key.js +120 -120
  83. package/dist/lib/program-key/program-key.js.map +1 -1
  84. package/dist/lib/project/menu-item.js +122 -122
  85. package/dist/lib/project/project-view-bookmark.js +159 -159
  86. package/dist/lib/project/project-view-bookmark.js.map +1 -1
  87. package/dist/lib/project/project-view-legacy-tile.js +77 -77
  88. package/dist/lib/project/project-view-legacy-tile.js.map +1 -1
  89. package/dist/lib/project/project-view-tile.js +125 -125
  90. package/dist/lib/project/project-view.js +141 -141
  91. package/dist/lib/project/zoom-control.js +17 -17
  92. package/dist/lib/server/hosting-location.js +156 -156
  93. package/dist/lib/server/hosting-location.js.map +1 -1
  94. package/dist/lib/server/message-broker.js +142 -142
  95. package/dist/lib/server/message-broker.js.map +1 -1
  96. package/dist/lib/server/pending-action.js +83 -83
  97. package/dist/lib/server/task.js +63 -63
  98. package/dist/lib/style/style.js +129 -129
  99. package/dist/lib/style/style.js.map +1 -1
  100. package/dist/lib/tileset/tileset.js +431 -431
  101. package/dist/lib/tileset/tileset.js.map +1 -1
  102. package/dist/lib/user/permission.js +20 -20
  103. package/dist/lib/user/session.js +145 -142
  104. package/dist/lib/user/session.js.map +1 -1
  105. package/dist/lib/user/user-group.js +94 -94
  106. package/dist/lib/user/user.js +475 -474
  107. package/dist/lib/user/user.js.map +1 -1
  108. package/dist/lib/util/encrypt-utils.js +19 -19
  109. package/dist/lib/util/math-utils.js +40 -40
  110. package/dist/lib/util/object-utils.js +17 -17
  111. package/dist/lib/util/path-utils.js +61 -61
  112. package/dist/lib/util/url-utils.js +94 -94
  113. package/dist/lib/util/url-utils.js.map +1 -1
  114. package/dist/types/account/account-invite.d.ts +68 -68
  115. package/dist/types/account/account-settings.d.ts +24 -24
  116. package/dist/types/account/account.d.ts +84 -84
  117. package/dist/types/ann-document/ann-document.d.ts +50 -50
  118. package/dist/types/api/abstract-api.d.ts +36 -36
  119. package/dist/types/api/api-getters.d.ts +64 -64
  120. package/dist/types/api/api.d.ts +93 -93
  121. package/dist/types/api/bruce-api.d.ts +64 -64
  122. package/dist/types/api/cam-api.d.ts +26 -26
  123. package/dist/types/api/global-api.d.ts +25 -25
  124. package/dist/types/api/guardian-api.d.ts +25 -25
  125. package/dist/types/api/idm-api.d.ts +28 -28
  126. package/dist/types/bruce-models.d.ts +79 -79
  127. package/dist/types/calculator/calculator.d.ts +61 -61
  128. package/dist/types/client-file/client-file.d.ts +130 -130
  129. package/dist/types/common/bounds.d.ts +30 -30
  130. package/dist/types/common/bruce-event.d.ts +12 -12
  131. package/dist/types/common/bruce-variable.d.ts +21 -21
  132. package/dist/types/common/cache.d.ts +57 -57
  133. package/dist/types/common/camera.d.ts +6 -6
  134. package/dist/types/common/cartes.d.ts +51 -51
  135. package/dist/types/common/carto.d.ts +15 -15
  136. package/dist/types/common/color.d.ts +24 -24
  137. package/dist/types/common/delay-queue.d.ts +14 -14
  138. package/dist/types/common/dictionary.d.ts +3 -3
  139. package/dist/types/common/geometry.d.ts +44 -44
  140. package/dist/types/common/lru-cache.d.ts +7 -7
  141. package/dist/types/common/transform.d.ts +15 -15
  142. package/dist/types/common/utc.d.ts +29 -29
  143. package/dist/types/custom-form/custom-form-content.d.ts +60 -60
  144. package/dist/types/custom-form/custom-form.d.ts +49 -49
  145. package/dist/types/data-lab/data-lab.d.ts +28 -28
  146. package/dist/types/entity/entity-attachment-type.d.ts +39 -39
  147. package/dist/types/entity/entity-attachment.d.ts +61 -61
  148. package/dist/types/entity/entity-attribute.d.ts +39 -39
  149. package/dist/types/entity/entity-comment.d.ts +40 -40
  150. package/dist/types/entity/entity-coords.d.ts +66 -66
  151. package/dist/types/entity/entity-link.d.ts +36 -36
  152. package/dist/types/entity/entity-lod-category.d.ts +36 -36
  153. package/dist/types/entity/entity-lod.d.ts +99 -99
  154. package/dist/types/entity/entity-relation-type.d.ts +44 -44
  155. package/dist/types/entity/entity-relation.d.ts +59 -59
  156. package/dist/types/entity/entity-source.d.ts +45 -45
  157. package/dist/types/entity/entity-tag.d.ts +53 -53
  158. package/dist/types/entity/entity-type-visual-settings.d.ts +16 -16
  159. package/dist/types/entity/entity-type.d.ts +63 -63
  160. package/dist/types/entity/entity.d.ts +118 -118
  161. package/dist/types/entity/getters/batched-data-getter.d.ts +26 -26
  162. package/dist/types/entity/getters/entity-filter-getter.d.ts +61 -61
  163. package/dist/types/entity/getters/entity-globe.d.ts +21 -21
  164. package/dist/types/entity/getters/view-monitor.d.ts +13 -13
  165. package/dist/types/import/import-cad.d.ts +49 -49
  166. package/dist/types/import/import-csv.d.ts +31 -31
  167. package/dist/types/import/import-json.d.ts +26 -26
  168. package/dist/types/import/import-kml.d.ts +19 -19
  169. package/dist/types/import/imported-file.d.ts +47 -47
  170. package/dist/types/internal/uploader.d.ts +16 -16
  171. package/dist/types/markup/markup.d.ts +227 -227
  172. package/dist/types/plugin/plugin.d.ts +39 -39
  173. package/dist/types/program-key/program-key.d.ts +48 -48
  174. package/dist/types/project/menu-item.d.ts +169 -169
  175. package/dist/types/project/project-view-bookmark.d.ts +179 -179
  176. package/dist/types/project/project-view-legacy-tile.d.ts +48 -48
  177. package/dist/types/project/project-view-tile.d.ts +65 -65
  178. package/dist/types/project/project-view.d.ts +136 -136
  179. package/dist/types/project/zoom-control.d.ts +22 -22
  180. package/dist/types/server/hosting-location.d.ts +74 -74
  181. package/dist/types/server/message-broker.d.ts +86 -86
  182. package/dist/types/server/pending-action.d.ts +66 -66
  183. package/dist/types/server/task.d.ts +36 -36
  184. package/dist/types/style/style.d.ts +107 -107
  185. package/dist/types/tileset/tileset.d.ts +264 -264
  186. package/dist/types/user/permission.d.ts +15 -15
  187. package/dist/types/user/session.d.ts +72 -66
  188. package/dist/types/user/user-group.d.ts +58 -58
  189. package/dist/types/user/user.d.ts +189 -188
  190. package/dist/types/util/encrypt-utils.d.ts +3 -3
  191. package/dist/types/util/math-utils.d.ts +16 -16
  192. package/dist/types/util/object-utils.d.ts +7 -7
  193. package/dist/types/util/path-utils.d.ts +8 -8
  194. package/dist/types/util/url-utils.d.ts +26 -26
  195. package/package.json +79 -78
@@ -1,61 +1,61 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Carto = void 0;
4
- /**
5
- * Describes a geographic point.
6
- * The units of the stored data should be in Degrees.
7
- * Utilities may use this in Radians for temporary calculations.
8
- */
9
- var Carto;
10
- (function (Carto) {
11
- function ValidateCarto(carto) {
12
- if (!carto) {
13
- return false;
14
- }
15
- else if (!carto.longitude && carto.longitude != 0) {
16
- return false;
17
- }
18
- else if (!carto.latitude && carto.latitude != 0) {
19
- return false;
20
- }
21
- return true;
22
- }
23
- Carto.ValidateCarto = ValidateCarto;
24
- function IsEqual(a, b) {
25
- if (a.longitude != b.longitude) {
26
- return false;
27
- }
28
- else if (a.latitude != b.latitude) {
29
- return false;
30
- }
31
- return true;
32
- }
33
- Carto.IsEqual = IsEqual;
34
- function GetCenter(list) {
35
- let center = {
36
- longitude: 0,
37
- latitude: 0,
38
- altitude: 0
39
- };
40
- for (let i = 0; i < list.length; i++) {
41
- const carto = list[i];
42
- center.longitude += carto.longitude;
43
- center.latitude += carto.latitude;
44
- if (carto.altitude) {
45
- center.altitude += carto.altitude;
46
- }
47
- }
48
- if (center.longitude) {
49
- center.longitude /= list.length;
50
- }
51
- if (center.latitude) {
52
- center.latitude /= list.length;
53
- }
54
- if (center.altitude) {
55
- center.altitude /= list.length;
56
- }
57
- return center;
58
- }
59
- Carto.GetCenter = GetCenter;
60
- })(Carto = exports.Carto || (exports.Carto = {}));
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Carto = void 0;
4
+ /**
5
+ * Describes a geographic point.
6
+ * The units of the stored data should be in Degrees.
7
+ * Utilities may use this in Radians for temporary calculations.
8
+ */
9
+ var Carto;
10
+ (function (Carto) {
11
+ function ValidateCarto(carto) {
12
+ if (!carto) {
13
+ return false;
14
+ }
15
+ else if (!carto.longitude && carto.longitude != 0) {
16
+ return false;
17
+ }
18
+ else if (!carto.latitude && carto.latitude != 0) {
19
+ return false;
20
+ }
21
+ return true;
22
+ }
23
+ Carto.ValidateCarto = ValidateCarto;
24
+ function IsEqual(a, b) {
25
+ if (a.longitude != b.longitude) {
26
+ return false;
27
+ }
28
+ else if (a.latitude != b.latitude) {
29
+ return false;
30
+ }
31
+ return true;
32
+ }
33
+ Carto.IsEqual = IsEqual;
34
+ function GetCenter(list) {
35
+ let center = {
36
+ longitude: 0,
37
+ latitude: 0,
38
+ altitude: 0
39
+ };
40
+ for (let i = 0; i < list.length; i++) {
41
+ const carto = list[i];
42
+ center.longitude += carto.longitude;
43
+ center.latitude += carto.latitude;
44
+ if (carto.altitude) {
45
+ center.altitude += carto.altitude;
46
+ }
47
+ }
48
+ if (center.longitude) {
49
+ center.longitude /= list.length;
50
+ }
51
+ if (center.latitude) {
52
+ center.latitude /= list.length;
53
+ }
54
+ if (center.altitude) {
55
+ center.altitude /= list.length;
56
+ }
57
+ return center;
58
+ }
59
+ Carto.GetCenter = GetCenter;
60
+ })(Carto = exports.Carto || (exports.Carto = {}));
61
61
  //# sourceMappingURL=carto.js.map
@@ -1,87 +1,87 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Color = void 0;
4
- var Color;
5
- (function (Color) {
6
- let EBlendMode;
7
- (function (EBlendMode) {
8
- EBlendMode[EBlendMode["HIGHLIGHT"] = 0] = "HIGHLIGHT";
9
- EBlendMode[EBlendMode["REPLACE"] = 1] = "REPLACE";
10
- EBlendMode[EBlendMode["MIX"] = 2] = "MIX";
11
- })(EBlendMode = Color.EBlendMode || (Color.EBlendMode = {}));
12
- function RandomColor() {
13
- // https://stackoverflow.com/a/7352887
14
- const brightness = 4;
15
- const rgb = [Math.random() * 256, Math.random() * 256, Math.random() * 256];
16
- const mix = [brightness * 51, brightness * 51, brightness * 51];
17
- const mixedrgb = [rgb[0] + mix[0], rgb[1] + mix[1], rgb[2] + mix[2]].map(function (x) {
18
- return Math.round(x / 2.0);
19
- });
20
- const str = "rgba(" + mixedrgb.join(",") + ",0.9" + ")";
21
- return ColorFromStr(str);
22
- }
23
- Color.RandomColor = RandomColor;
24
- /**
25
- * Attempts to parse a given color string into a model.
26
- * @param str
27
- * @returns
28
- */
29
- function ColorFromStr(str) {
30
- let r, g, b, a;
31
- const rgba = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([^\)]+)\s*)?\)$/.exec(str);
32
- if (rgba) {
33
- r = parseInt(rgba[1]);
34
- g = parseInt(rgba[2]);
35
- b = parseInt(rgba[3]);
36
- a = rgba[4] != null ? parseFloat(rgba[4]) : 1;
37
- return {
38
- red: r,
39
- green: g,
40
- blue: b,
41
- alpha: a
42
- };
43
- }
44
- if (str.charAt(0) == "#") {
45
- str = str.substring(1);
46
- }
47
- if (str.length == 6) {
48
- // rgb.
49
- const parsed = /^(.{2})(.{2})(.{2})/.exec(str);
50
- if (!parsed) {
51
- return null;
52
- }
53
- r = parseInt(parsed[1], 16);
54
- g = parseInt(parsed[2], 16);
55
- b = parseInt(parsed[3], 16);
56
- a = 1;
57
- }
58
- else if (str.length == 8) {
59
- // rgba.
60
- const parsed = /^(.{2})(.{2})(.{2})(.{2})/.exec(str);
61
- if (!parsed) {
62
- return null;
63
- }
64
- r = parseInt(parsed[1], 16);
65
- g = parseInt(parsed[2], 16);
66
- b = parseInt(parsed[3], 16);
67
- a = parseInt(parsed[4], 16);
68
- if (a != 0) {
69
- a = a / 255;
70
- }
71
- }
72
- else {
73
- return null;
74
- }
75
- if (a == null) {
76
- a = 1;
77
- }
78
- return {
79
- red: r,
80
- blue: b,
81
- green: g,
82
- alpha: a
83
- };
84
- }
85
- Color.ColorFromStr = ColorFromStr;
86
- })(Color = exports.Color || (exports.Color = {}));
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Color = void 0;
4
+ var Color;
5
+ (function (Color) {
6
+ let EBlendMode;
7
+ (function (EBlendMode) {
8
+ EBlendMode[EBlendMode["HIGHLIGHT"] = 0] = "HIGHLIGHT";
9
+ EBlendMode[EBlendMode["REPLACE"] = 1] = "REPLACE";
10
+ EBlendMode[EBlendMode["MIX"] = 2] = "MIX";
11
+ })(EBlendMode = Color.EBlendMode || (Color.EBlendMode = {}));
12
+ function RandomColor() {
13
+ // https://stackoverflow.com/a/7352887
14
+ const brightness = 4;
15
+ const rgb = [Math.random() * 256, Math.random() * 256, Math.random() * 256];
16
+ const mix = [brightness * 51, brightness * 51, brightness * 51];
17
+ const mixedrgb = [rgb[0] + mix[0], rgb[1] + mix[1], rgb[2] + mix[2]].map(function (x) {
18
+ return Math.round(x / 2.0);
19
+ });
20
+ const str = "rgba(" + mixedrgb.join(",") + ",0.9" + ")";
21
+ return ColorFromStr(str);
22
+ }
23
+ Color.RandomColor = RandomColor;
24
+ /**
25
+ * Attempts to parse a given color string into a model.
26
+ * @param str
27
+ * @returns
28
+ */
29
+ function ColorFromStr(str) {
30
+ let r, g, b, a;
31
+ const rgba = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([^\)]+)\s*)?\)$/.exec(str);
32
+ if (rgba) {
33
+ r = parseInt(rgba[1]);
34
+ g = parseInt(rgba[2]);
35
+ b = parseInt(rgba[3]);
36
+ a = rgba[4] != null ? parseFloat(rgba[4]) : 1;
37
+ return {
38
+ red: r,
39
+ green: g,
40
+ blue: b,
41
+ alpha: a
42
+ };
43
+ }
44
+ if (str.charAt(0) == "#") {
45
+ str = str.substring(1);
46
+ }
47
+ if (str.length == 6) {
48
+ // rgb.
49
+ const parsed = /^(.{2})(.{2})(.{2})/.exec(str);
50
+ if (!parsed) {
51
+ return null;
52
+ }
53
+ r = parseInt(parsed[1], 16);
54
+ g = parseInt(parsed[2], 16);
55
+ b = parseInt(parsed[3], 16);
56
+ a = 1;
57
+ }
58
+ else if (str.length == 8) {
59
+ // rgba.
60
+ const parsed = /^(.{2})(.{2})(.{2})(.{2})/.exec(str);
61
+ if (!parsed) {
62
+ return null;
63
+ }
64
+ r = parseInt(parsed[1], 16);
65
+ g = parseInt(parsed[2], 16);
66
+ b = parseInt(parsed[3], 16);
67
+ a = parseInt(parsed[4], 16);
68
+ if (a != 0) {
69
+ a = a / 255;
70
+ }
71
+ }
72
+ else {
73
+ return null;
74
+ }
75
+ if (a == null) {
76
+ a = 1;
77
+ }
78
+ return {
79
+ red: r,
80
+ blue: b,
81
+ green: g,
82
+ alpha: a
83
+ };
84
+ }
85
+ Color.ColorFromStr = ColorFromStr;
86
+ })(Color = exports.Color || (exports.Color = {}));
87
87
  //# sourceMappingURL=color.js.map
@@ -1,57 +1,57 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DelayQueue = void 0;
4
- /**
5
- * Controls the flow of method calls.
6
- * If you have a method that may be called often, but you don't want it to run often, use this.
7
- */
8
- class DelayQueue {
9
- constructor(callback, delay = 200) {
10
- // Millisecond delay.
11
- this.delay = 200;
12
- // Date-time stamp for the last callback call.
13
- this.lastCallTime = null;
14
- this.callback = callback;
15
- this.delay = delay;
16
- }
17
- Call(force = false) {
18
- if (this.lastCallTime == null) {
19
- force = true;
20
- }
21
- if (force) {
22
- let endDate = new Date().getTime();
23
- this.doCall(endDate);
24
- }
25
- else {
26
- const endDate = new Date().getTime();
27
- const seconds = (endDate - this.lastCallTime) / 1000;
28
- const delay = this.delay / 1000;
29
- if (seconds > delay) {
30
- this.doCall(endDate);
31
- }
32
- else if (this.delayTimeout == null) {
33
- const diff = (delay - seconds) * 1000;
34
- this.delayTimeout = setTimeout(() => {
35
- this.delayTimeout = null;
36
- this.Call();
37
- }, diff + 0.02);
38
- }
39
- }
40
- }
41
- doCall(endDate) {
42
- if (this.delayTimeout != null) {
43
- clearTimeout(this.delayTimeout);
44
- this.delayTimeout = null;
45
- }
46
- this.lastCallTime = endDate;
47
- this.callback();
48
- }
49
- Dispose() {
50
- if (this.delayTimeout != null) {
51
- clearTimeout(this.delayTimeout);
52
- this.delayTimeout = null;
53
- }
54
- }
55
- }
56
- exports.DelayQueue = DelayQueue;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DelayQueue = void 0;
4
+ /**
5
+ * Controls the flow of method calls.
6
+ * If you have a method that may be called often, but you don't want it to run often, use this.
7
+ */
8
+ class DelayQueue {
9
+ constructor(callback, delay = 200) {
10
+ // Millisecond delay.
11
+ this.delay = 200;
12
+ // Date-time stamp for the last callback call.
13
+ this.lastCallTime = null;
14
+ this.callback = callback;
15
+ this.delay = delay;
16
+ }
17
+ Call(force = false) {
18
+ if (this.lastCallTime == null) {
19
+ force = true;
20
+ }
21
+ if (force) {
22
+ let endDate = new Date().getTime();
23
+ this.doCall(endDate);
24
+ }
25
+ else {
26
+ const endDate = new Date().getTime();
27
+ const seconds = (endDate - this.lastCallTime) / 1000;
28
+ const delay = this.delay / 1000;
29
+ if (seconds > delay) {
30
+ this.doCall(endDate);
31
+ }
32
+ else if (this.delayTimeout == null) {
33
+ const diff = (delay - seconds) * 1000;
34
+ this.delayTimeout = setTimeout(() => {
35
+ this.delayTimeout = null;
36
+ this.Call();
37
+ }, diff + 0.02);
38
+ }
39
+ }
40
+ }
41
+ doCall(endDate) {
42
+ if (this.delayTimeout != null) {
43
+ clearTimeout(this.delayTimeout);
44
+ this.delayTimeout = null;
45
+ }
46
+ this.lastCallTime = endDate;
47
+ this.callback();
48
+ }
49
+ Dispose() {
50
+ if (this.delayTimeout != null) {
51
+ clearTimeout(this.delayTimeout);
52
+ this.delayTimeout = null;
53
+ }
54
+ }
55
+ }
56
+ exports.DelayQueue = DelayQueue;
57
57
  //# sourceMappingURL=delay-queue.js.map
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=dictionary.js.map
@@ -1,121 +1,121 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Geometry = void 0;
4
- /**
5
- * Describes vector geometry that Bruce uses.
6
- */
7
- var Geometry;
8
- (function (Geometry) {
9
- let EPolygonRingType;
10
- (function (EPolygonRingType) {
11
- EPolygonRingType["Boundaries"] = "out";
12
- EPolygonRingType["Hole"] = "in";
13
- })(EPolygonRingType = Geometry.EPolygonRingType || (Geometry.EPolygonRingType = {}));
14
- /**
15
- * Turns an array of points into string vector geometry that Bruce can use.
16
- * This is used for saving polyline and polygon data.
17
- * @param points
18
- * @returns
19
- */
20
- function LineStrFromPoints(points) {
21
- if (!points.length) {
22
- throw ("points is empty.");
23
- }
24
- let carto = points[0];
25
- let lineString = `${carto.longitude},${carto.latitude}` + (carto.altitude != null ? `,${carto.altitude}` : "");
26
- for (let i = 1; i < points.length; i++) {
27
- carto = points[i];
28
- lineString += ` ${carto.longitude},${carto.latitude}` + (carto.altitude != null ? `,${carto.altitude}` : "");
29
- }
30
- return lineString;
31
- }
32
- Geometry.LineStrFromPoints = LineStrFromPoints;
33
- /**
34
- * Removes same points that occur in a row.
35
- * This will not modify the original array.
36
- * @param positions
37
- * @returns
38
- */
39
- function RemoveRepeatPoints(positions) {
40
- const filteredList = [];
41
- for (let i = 0; i < positions.length; i++) {
42
- const pos = positions[i];
43
- const lastPos = filteredList.length > 0 ? filteredList[filteredList.length - 1] : null;
44
- if (!lastPos || (pos.latitude != lastPos.latitude || pos.longitude != lastPos.longitude || pos.altitude != lastPos.altitude)) {
45
- filteredList.push(pos);
46
- }
47
- }
48
- return filteredList;
49
- }
50
- Geometry.RemoveRepeatPoints = RemoveRepeatPoints;
51
- function ParsePoints(pointsStr) {
52
- pointsStr = pointsStr.replace(/[^\d.,-\s]/g, "");
53
- let splitterCoordinates = " ";
54
- let splitterAxis = ",";
55
- const commaIndex = pointsStr.indexOf(",");
56
- const spaceIndex = pointsStr.indexOf(" ");
57
- if ((spaceIndex > -1 && commaIndex > spaceIndex) || commaIndex <= -1) {
58
- splitterCoordinates = ",";
59
- splitterAxis = " ";
60
- }
61
- let points = pointsStr.trim().split(splitterCoordinates);
62
- points = points.filter(a => a != "");
63
- const result = [];
64
- for (let i = 0; i < points.length; i++) {
65
- const pointData = points[i];
66
- const coords = pointData.trim().split(splitterAxis);
67
- if (coords.length == 2 || coords.length == 3) {
68
- const longitude = Number(coords[0]);
69
- const latitude = Number(coords[1]);
70
- const altitude = Number(coords.length >= 3 ? coords[2] : 0);
71
- if (longitude != null && latitude != null) {
72
- result.push({
73
- altitude: altitude,
74
- latitude: latitude,
75
- longitude: longitude
76
- });
77
- }
78
- else {
79
- console.warn("Invalid point data detected.", pointData);
80
- }
81
- }
82
- }
83
- return result;
84
- }
85
- Geometry.ParsePoints = ParsePoints;
86
- /**
87
- * Parses both string and object Bruce geometry.
88
- * String geometry is legacy Bruce data.
89
- * @param geometry
90
- * @returns
91
- */
92
- function ParseGeometry(geometry) {
93
- if (typeof geometry == "string") {
94
- let positions = [];
95
- const geometryParsed = (geometry || "").split(";");
96
- for (let i = 0; i < geometryParsed.length; i++) {
97
- const data = geometryParsed[i];
98
- const points = ParsePoints(data);
99
- if (points && points.length > 0) {
100
- positions = positions.concat(points);
101
- }
102
- }
103
- positions = RemoveRepeatPoints(positions);
104
- const newGeometry = {};
105
- if (positions.length > 0) {
106
- const topPoint = positions[0];
107
- newGeometry.Point = `${topPoint.latitude},${topPoint.longitude}` + (topPoint.altitude != null ? `,${topPoint.altitude}` : "");
108
- if (positions.length > 1) {
109
- newGeometry.Polygon = [{ Facing: EPolygonRingType.Boundaries, LinearRing: LineStrFromPoints(positions) }];
110
- }
111
- if (positions.length > 2) {
112
- newGeometry.LineString = LineStrFromPoints(positions);
113
- }
114
- }
115
- return newGeometry;
116
- }
117
- return geometry;
118
- }
119
- Geometry.ParseGeometry = ParseGeometry;
120
- })(Geometry = exports.Geometry || (exports.Geometry = {}));
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Geometry = void 0;
4
+ /**
5
+ * Describes vector geometry that Bruce uses.
6
+ */
7
+ var Geometry;
8
+ (function (Geometry) {
9
+ let EPolygonRingType;
10
+ (function (EPolygonRingType) {
11
+ EPolygonRingType["Boundaries"] = "out";
12
+ EPolygonRingType["Hole"] = "in";
13
+ })(EPolygonRingType = Geometry.EPolygonRingType || (Geometry.EPolygonRingType = {}));
14
+ /**
15
+ * Turns an array of points into string vector geometry that Bruce can use.
16
+ * This is used for saving polyline and polygon data.
17
+ * @param points
18
+ * @returns
19
+ */
20
+ function LineStrFromPoints(points) {
21
+ if (!points.length) {
22
+ throw ("points is empty.");
23
+ }
24
+ let carto = points[0];
25
+ let lineString = `${carto.longitude},${carto.latitude}` + (carto.altitude != null ? `,${carto.altitude}` : "");
26
+ for (let i = 1; i < points.length; i++) {
27
+ carto = points[i];
28
+ lineString += ` ${carto.longitude},${carto.latitude}` + (carto.altitude != null ? `,${carto.altitude}` : "");
29
+ }
30
+ return lineString;
31
+ }
32
+ Geometry.LineStrFromPoints = LineStrFromPoints;
33
+ /**
34
+ * Removes same points that occur in a row.
35
+ * This will not modify the original array.
36
+ * @param positions
37
+ * @returns
38
+ */
39
+ function RemoveRepeatPoints(positions) {
40
+ const filteredList = [];
41
+ for (let i = 0; i < positions.length; i++) {
42
+ const pos = positions[i];
43
+ const lastPos = filteredList.length > 0 ? filteredList[filteredList.length - 1] : null;
44
+ if (!lastPos || (pos.latitude != lastPos.latitude || pos.longitude != lastPos.longitude || pos.altitude != lastPos.altitude)) {
45
+ filteredList.push(pos);
46
+ }
47
+ }
48
+ return filteredList;
49
+ }
50
+ Geometry.RemoveRepeatPoints = RemoveRepeatPoints;
51
+ function ParsePoints(pointsStr) {
52
+ pointsStr = pointsStr.replace(/[^\d.,-\s]/g, "");
53
+ let splitterCoordinates = " ";
54
+ let splitterAxis = ",";
55
+ const commaIndex = pointsStr.indexOf(",");
56
+ const spaceIndex = pointsStr.indexOf(" ");
57
+ if ((spaceIndex > -1 && commaIndex > spaceIndex) || commaIndex <= -1) {
58
+ splitterCoordinates = ",";
59
+ splitterAxis = " ";
60
+ }
61
+ let points = pointsStr.trim().split(splitterCoordinates);
62
+ points = points.filter(a => a != "");
63
+ const result = [];
64
+ for (let i = 0; i < points.length; i++) {
65
+ const pointData = points[i];
66
+ const coords = pointData.trim().split(splitterAxis);
67
+ if (coords.length == 2 || coords.length == 3) {
68
+ const longitude = Number(coords[0]);
69
+ const latitude = Number(coords[1]);
70
+ const altitude = Number(coords.length >= 3 ? coords[2] : 0);
71
+ if (longitude != null && latitude != null) {
72
+ result.push({
73
+ altitude: altitude,
74
+ latitude: latitude,
75
+ longitude: longitude
76
+ });
77
+ }
78
+ else {
79
+ console.warn("Invalid point data detected.", pointData);
80
+ }
81
+ }
82
+ }
83
+ return result;
84
+ }
85
+ Geometry.ParsePoints = ParsePoints;
86
+ /**
87
+ * Parses both string and object Bruce geometry.
88
+ * String geometry is legacy Bruce data.
89
+ * @param geometry
90
+ * @returns
91
+ */
92
+ function ParseGeometry(geometry) {
93
+ if (typeof geometry == "string") {
94
+ let positions = [];
95
+ const geometryParsed = (geometry || "").split(";");
96
+ for (let i = 0; i < geometryParsed.length; i++) {
97
+ const data = geometryParsed[i];
98
+ const points = ParsePoints(data);
99
+ if (points && points.length > 0) {
100
+ positions = positions.concat(points);
101
+ }
102
+ }
103
+ positions = RemoveRepeatPoints(positions);
104
+ const newGeometry = {};
105
+ if (positions.length > 0) {
106
+ const topPoint = positions[0];
107
+ newGeometry.Point = `${topPoint.latitude},${topPoint.longitude}` + (topPoint.altitude != null ? `,${topPoint.altitude}` : "");
108
+ if (positions.length > 1) {
109
+ newGeometry.Polygon = [{ Facing: EPolygonRingType.Boundaries, LinearRing: LineStrFromPoints(positions) }];
110
+ }
111
+ if (positions.length > 2) {
112
+ newGeometry.LineString = LineStrFromPoints(positions);
113
+ }
114
+ }
115
+ return newGeometry;
116
+ }
117
+ return geometry;
118
+ }
119
+ Geometry.ParseGeometry = ParseGeometry;
120
+ })(Geometry = exports.Geometry || (exports.Geometry = {}));
121
121
  //# sourceMappingURL=geometry.js.map