@artstesh/maps 6.0.7 → 6.0.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 (175) hide show
  1. package/dist/esm2022/map/map-plate/controls/map-control-zoom/map-control-zoom.component.mjs +3 -3
  2. package/dist/esm2022/map/map-plate/features/markers/markers.component.mjs +2 -2
  3. package/dist/esm2022/map/map-plate/features/polygons/polygons.component.mjs +2 -2
  4. package/dist/esm2022/map/map-plate/layers/cluster-layer/cluster-layer.component.mjs +2 -2
  5. package/dist/esm2022/map/map-plate/layers/cluster-layer/cluster-layer.manager.mjs +4 -4
  6. package/dist/esm2022/map/map-plate/layers/feature-layer/feature-layer.component.mjs +2 -2
  7. package/dist/esm2022/map/map-plate/layers/tile-layer/tile-layer.component.mjs +2 -2
  8. package/dist/esm2022/map/map-plate/tooltips/tooltip/tooltip.component.mjs +4 -4
  9. package/dist/esm2022/map/messages/commands/add-control.command.mjs +9 -5
  10. package/dist/esm2022/map/messages/commands/add-layer.command.mjs +1 -5
  11. package/dist/esm2022/map/messages/commands/add-tile.command.mjs +1 -5
  12. package/dist/esm2022/map/messages/commands/cancel-drawing.command.mjs +4 -5
  13. package/dist/esm2022/map/messages/commands/cancel-feature-modification.command.mjs +4 -5
  14. package/dist/esm2022/map/messages/commands/close-tooltip.command.mjs +9 -5
  15. package/dist/esm2022/map/messages/commands/draw-selection-area.command.mjs +13 -5
  16. package/dist/esm2022/map/messages/commands/fit-to-features.command.mjs +1 -5
  17. package/dist/esm2022/map/messages/commands/fit-to-polygons.command.mjs +11 -5
  18. package/dist/esm2022/map/messages/commands/modify-feature.command.mjs +14 -5
  19. package/dist/esm2022/map/messages/commands/place-layer-features.command.mjs +1 -5
  20. package/dist/esm2022/map/messages/commands/remove-control.command.mjs +14 -5
  21. package/dist/esm2022/map/messages/commands/remove-layer.command.mjs +1 -5
  22. package/dist/esm2022/map/messages/commands/remove-tile.command.mjs +1 -5
  23. package/dist/esm2022/map/messages/commands/set-map-center.command.mjs +1 -5
  24. package/dist/esm2022/map/messages/commands/start-drawing.command.mjs +11 -5
  25. package/dist/esm2022/map/messages/events/drawing-finished.event.mjs +1 -8
  26. package/dist/esm2022/map/messages/events/map-click.event.mjs +14 -5
  27. package/dist/esm2022/map/messages/events/map-move-end.event.mjs +7 -5
  28. package/dist/esm2022/map/messages/events/map-rendered.event.mjs +9 -5
  29. package/dist/esm2022/map/messages/executors/calculate-area.executor.mjs +8 -5
  30. package/dist/esm2022/map/messages/executors/filter-features-in-area.executor.mjs +9 -5
  31. package/dist/esm2022/map/messages/executors/filter-features-in-point.executor.mjs +13 -6
  32. package/dist/esm2022/map/messages/executors/generate-draw.executor.mjs +1 -5
  33. package/dist/esm2022/map/messages/executors/generate-zoom-control.executor.mjs +1 -5
  34. package/dist/esm2022/map/messages/executors/get-map-position.executor.mjs +1 -4
  35. package/dist/esm2022/map/messages/index.mjs +8 -8
  36. package/dist/esm2022/map/messages/queries/get-features-in-area.query.mjs +11 -5
  37. package/dist/esm2022/map/messages/queries/get-features-in-point.query.mjs +8 -5
  38. package/dist/esm2022/map/messages/queries/get-layer.query.mjs +1 -5
  39. package/dist/esm2022/map/models/drawing-type.enum.mjs +14 -1
  40. package/dist/esm2022/map/models/feature-format.enum.mjs +9 -1
  41. package/dist/esm2022/map/models/map-position.model.mjs +1 -1
  42. package/dist/esm2022/map/models/map-settings.mjs +47 -1
  43. package/dist/esm2022/map/services/controls/controls.service.mjs +4 -6
  44. package/dist/esm2022/map/services/drawing/drawing.service.mjs +9 -15
  45. package/dist/esm2022/map/services/drawing/feature-modification.service.mjs +5 -7
  46. package/dist/esm2022/map/services/map-click.service.mjs +2 -2
  47. package/dist/esm2022/map/services/map-feature.service.mjs +4 -4
  48. package/dist/esm2022/map/services/map-management.service.mjs +12 -12
  49. package/dist/esm2022/map/services/map-postboy.service.mjs +6 -2
  50. package/dist/esm2022/map/services/map-state.service.mjs +3 -3
  51. package/dist/esm2022/map/services/message-registrator.service.mjs +30 -30
  52. package/dist/esm2022/src/map/map-plate/controls/map-control-zoom/map-control-zoom.component.mjs +3 -3
  53. package/dist/esm2022/src/map/map-plate/features/markers/markers.component.mjs +2 -2
  54. package/dist/esm2022/src/map/map-plate/features/polygons/polygons.component.mjs +2 -2
  55. package/dist/esm2022/src/map/map-plate/layers/cluster-layer/cluster-layer.component.mjs +2 -2
  56. package/dist/esm2022/src/map/map-plate/layers/cluster-layer/cluster-layer.manager.mjs +4 -4
  57. package/dist/esm2022/src/map/map-plate/layers/feature-layer/feature-layer.component.mjs +2 -2
  58. package/dist/esm2022/src/map/map-plate/layers/tile-layer/tile-layer.component.mjs +2 -2
  59. package/dist/esm2022/src/map/map-plate/tooltips/tooltip/tooltip.component.mjs +4 -4
  60. package/dist/esm2022/src/map/messages/commands/add-control.command.mjs +9 -5
  61. package/dist/esm2022/src/map/messages/commands/add-layer.command.mjs +1 -5
  62. package/dist/esm2022/src/map/messages/commands/add-tile.command.mjs +1 -5
  63. package/dist/esm2022/src/map/messages/commands/cancel-drawing.command.mjs +4 -5
  64. package/dist/esm2022/src/map/messages/commands/cancel-feature-modification.command.mjs +4 -5
  65. package/dist/esm2022/src/map/messages/commands/close-tooltip.command.mjs +9 -5
  66. package/dist/esm2022/src/map/messages/commands/draw-selection-area.command.mjs +13 -5
  67. package/dist/esm2022/src/map/messages/commands/fit-to-features.command.mjs +1 -5
  68. package/dist/esm2022/src/map/messages/commands/fit-to-polygons.command.mjs +11 -5
  69. package/dist/esm2022/src/map/messages/commands/modify-feature.command.mjs +14 -5
  70. package/dist/esm2022/src/map/messages/commands/place-layer-features.command.mjs +1 -5
  71. package/dist/esm2022/src/map/messages/commands/remove-control.command.mjs +14 -5
  72. package/dist/esm2022/src/map/messages/commands/remove-layer.command.mjs +1 -5
  73. package/dist/esm2022/src/map/messages/commands/remove-tile.command.mjs +1 -5
  74. package/dist/esm2022/src/map/messages/commands/set-map-center.command.mjs +1 -5
  75. package/dist/esm2022/src/map/messages/commands/start-drawing.command.mjs +11 -5
  76. package/dist/esm2022/src/map/messages/events/drawing-finished.event.mjs +1 -8
  77. package/dist/esm2022/src/map/messages/events/map-click.event.mjs +14 -5
  78. package/dist/esm2022/src/map/messages/events/map-move-end.event.mjs +7 -5
  79. package/dist/esm2022/src/map/messages/events/map-rendered.event.mjs +9 -5
  80. package/dist/esm2022/src/map/messages/executors/calculate-area.executor.mjs +8 -5
  81. package/dist/esm2022/src/map/messages/executors/filter-features-in-area.executor.mjs +9 -5
  82. package/dist/esm2022/src/map/messages/executors/filter-features-in-point.executor.mjs +13 -6
  83. package/dist/esm2022/src/map/messages/executors/generate-draw.executor.mjs +1 -5
  84. package/dist/esm2022/src/map/messages/executors/generate-zoom-control.executor.mjs +1 -5
  85. package/dist/esm2022/src/map/messages/executors/get-map-position.executor.mjs +1 -4
  86. package/dist/esm2022/src/map/messages/index.mjs +8 -8
  87. package/dist/esm2022/src/map/messages/queries/get-features-in-area.query.mjs +11 -5
  88. package/dist/esm2022/src/map/messages/queries/get-features-in-point.query.mjs +8 -5
  89. package/dist/esm2022/src/map/messages/queries/get-layer.query.mjs +1 -5
  90. package/dist/esm2022/src/map/models/drawing-type.enum.mjs +14 -1
  91. package/dist/esm2022/src/map/models/feature-format.enum.mjs +9 -1
  92. package/dist/esm2022/src/map/models/map-position.model.mjs +1 -1
  93. package/dist/esm2022/src/map/models/map-settings.mjs +47 -1
  94. package/dist/esm2022/src/map/services/controls/controls.service.mjs +4 -6
  95. package/dist/esm2022/src/map/services/drawing/drawing.service.mjs +9 -15
  96. package/dist/esm2022/src/map/services/drawing/feature-modification.service.mjs +5 -7
  97. package/dist/esm2022/src/map/services/map-click.service.mjs +2 -2
  98. package/dist/esm2022/src/map/services/map-feature.service.mjs +4 -4
  99. package/dist/esm2022/src/map/services/map-management.service.mjs +12 -12
  100. package/dist/esm2022/src/map/services/map-postboy.service.mjs +6 -2
  101. package/dist/esm2022/src/map/services/map-state.service.mjs +3 -3
  102. package/dist/esm2022/src/map/services/message-registrator.service.mjs +30 -30
  103. package/dist/fesm2022/maps-components-src-map.mjs +358 -265
  104. package/dist/fesm2022/maps-components-src-map.mjs.map +1 -1
  105. package/dist/fesm2022/maps-components.mjs +358 -265
  106. package/dist/fesm2022/maps-components.mjs.map +1 -1
  107. package/dist/map/messages/commands/add-control.command.d.ts +8 -2
  108. package/dist/map/messages/commands/add-layer.command.d.ts +0 -2
  109. package/dist/map/messages/commands/add-tile.command.d.ts +0 -2
  110. package/dist/map/messages/commands/cancel-drawing.command.d.ts +3 -2
  111. package/dist/map/messages/commands/cancel-feature-modification.command.d.ts +3 -2
  112. package/dist/map/messages/commands/close-tooltip.command.d.ts +8 -2
  113. package/dist/map/messages/commands/draw-selection-area.command.d.ts +12 -2
  114. package/dist/map/messages/commands/fit-to-features.command.d.ts +0 -2
  115. package/dist/map/messages/commands/fit-to-polygons.command.d.ts +10 -2
  116. package/dist/map/messages/commands/modify-feature.command.d.ts +13 -2
  117. package/dist/map/messages/commands/place-layer-features.command.d.ts +0 -2
  118. package/dist/map/messages/commands/remove-control.command.d.ts +13 -2
  119. package/dist/map/messages/commands/remove-layer.command.d.ts +0 -2
  120. package/dist/map/messages/commands/remove-tile.command.d.ts +0 -2
  121. package/dist/map/messages/commands/set-map-center.command.d.ts +0 -2
  122. package/dist/map/messages/commands/start-drawing.command.d.ts +10 -2
  123. package/dist/map/messages/events/drawing-finished.event.d.ts +0 -3
  124. package/dist/map/messages/events/map-click.event.d.ts +13 -2
  125. package/dist/map/messages/events/map-move-end.event.d.ts +6 -2
  126. package/dist/map/messages/events/map-rendered.event.d.ts +8 -2
  127. package/dist/map/messages/executors/calculate-area.executor.d.ts +7 -2
  128. package/dist/map/messages/executors/filter-features-in-area.executor.d.ts +8 -2
  129. package/dist/map/messages/executors/filter-features-in-point.executor.d.ts +12 -3
  130. package/dist/map/messages/executors/generate-draw.executor.d.ts +0 -2
  131. package/dist/map/messages/executors/generate-zoom-control.executor.d.ts +0 -2
  132. package/dist/map/messages/executors/get-map-position.executor.d.ts +0 -1
  133. package/dist/map/messages/index.d.ts +7 -7
  134. package/dist/map/messages/queries/get-features-in-area.query.d.ts +10 -2
  135. package/dist/map/messages/queries/get-features-in-point.query.d.ts +7 -2
  136. package/dist/map/messages/queries/get-layer.query.d.ts +0 -2
  137. package/dist/map/models/drawing-type.enum.d.ts +13 -0
  138. package/dist/map/models/feature-format.enum.d.ts +8 -0
  139. package/dist/map/models/map-position.model.d.ts +12 -0
  140. package/dist/map/models/map-settings.d.ts +46 -0
  141. package/dist/src/map/messages/commands/add-control.command.d.ts +8 -2
  142. package/dist/src/map/messages/commands/add-layer.command.d.ts +0 -2
  143. package/dist/src/map/messages/commands/add-tile.command.d.ts +0 -2
  144. package/dist/src/map/messages/commands/cancel-drawing.command.d.ts +3 -2
  145. package/dist/src/map/messages/commands/cancel-feature-modification.command.d.ts +3 -2
  146. package/dist/src/map/messages/commands/close-tooltip.command.d.ts +8 -2
  147. package/dist/src/map/messages/commands/draw-selection-area.command.d.ts +12 -2
  148. package/dist/src/map/messages/commands/fit-to-features.command.d.ts +0 -2
  149. package/dist/src/map/messages/commands/fit-to-polygons.command.d.ts +10 -2
  150. package/dist/src/map/messages/commands/modify-feature.command.d.ts +13 -2
  151. package/dist/src/map/messages/commands/place-layer-features.command.d.ts +0 -2
  152. package/dist/src/map/messages/commands/remove-control.command.d.ts +13 -2
  153. package/dist/src/map/messages/commands/remove-layer.command.d.ts +0 -2
  154. package/dist/src/map/messages/commands/remove-tile.command.d.ts +0 -2
  155. package/dist/src/map/messages/commands/set-map-center.command.d.ts +0 -2
  156. package/dist/src/map/messages/commands/start-drawing.command.d.ts +10 -2
  157. package/dist/src/map/messages/events/drawing-finished.event.d.ts +0 -3
  158. package/dist/src/map/messages/events/map-click.event.d.ts +13 -2
  159. package/dist/src/map/messages/events/map-move-end.event.d.ts +6 -2
  160. package/dist/src/map/messages/events/map-rendered.event.d.ts +8 -2
  161. package/dist/src/map/messages/executors/calculate-area.executor.d.ts +7 -2
  162. package/dist/src/map/messages/executors/filter-features-in-area.executor.d.ts +8 -2
  163. package/dist/src/map/messages/executors/filter-features-in-point.executor.d.ts +12 -3
  164. package/dist/src/map/messages/executors/generate-draw.executor.d.ts +0 -2
  165. package/dist/src/map/messages/executors/generate-zoom-control.executor.d.ts +0 -2
  166. package/dist/src/map/messages/executors/get-map-position.executor.d.ts +0 -1
  167. package/dist/src/map/messages/index.d.ts +7 -7
  168. package/dist/src/map/messages/queries/get-features-in-area.query.d.ts +10 -2
  169. package/dist/src/map/messages/queries/get-features-in-point.query.d.ts +7 -2
  170. package/dist/src/map/messages/queries/get-layer.query.d.ts +0 -2
  171. package/dist/src/map/models/drawing-type.enum.d.ts +13 -0
  172. package/dist/src/map/models/feature-format.enum.d.ts +8 -0
  173. package/dist/src/map/models/map-position.model.d.ts +12 -0
  174. package/dist/src/map/models/map-settings.d.ts +46 -0
  175. package/package.json +13 -13
@@ -64,6 +64,10 @@ class MapLyrsLabel {
64
64
  }
65
65
  }
66
66
 
67
+ /**
68
+ * Represents the configurable settings for a map instance, providing
69
+ * options for center coordinates, zoom levels, map layers, and language.
70
+ */
67
71
  class MapSettings {
68
72
  center = [0, 0];
69
73
  maxZoom = 19;
@@ -81,24 +85,66 @@ class MapSettings {
81
85
  result.language = model.language;
82
86
  return result;
83
87
  }
88
+ /**
89
+ * Sets the center for the map settings.
90
+ *
91
+ * @param {number[]} center - A two-element array representing the latitude and longitude of the map's center.
92
+ * @return {MapSettings} A new MapSettings object with the updated center.
93
+ */
84
94
  setCenter(center) {
85
95
  return MapSettings.copy({ ...this, center });
86
96
  }
97
+ /**
98
+ * Sets the maximum zoom level for the map.
99
+ *
100
+ * @param {number} maxZoom - The maximum zoom level to be set.
101
+ * @return {MapSettings} A new instance of MapSettings with the updated maximum zoom level.
102
+ */
87
103
  setMaxZoom(maxZoom) {
88
104
  return MapSettings.copy({ ...this, maxZoom });
89
105
  }
106
+ /**
107
+ * Sets the minimum zoom level for the map settings.
108
+ *
109
+ * @param {number} minZoom The minimum zoom level to be set. Must be a valid numeric value.
110
+ * @return {MapSettings} A new MapSettings object with the updated minimum zoom level.
111
+ */
90
112
  setMinZoom(minZoom) {
91
113
  return MapSettings.copy({ ...this, minZoom });
92
114
  }
115
+ /**
116
+ * Adjusts the zoom level of the map by setting the specified value.
117
+ *
118
+ * @param {number} zoom - The desired zoom level to be set.
119
+ * @return {MapSettings} A new MapSettings instance with the updated zoom level.
120
+ */
93
121
  setZoom(zoom) {
94
122
  return MapSettings.copy({ ...this, zoom });
95
123
  }
124
+ /**
125
+ * Sets the layers in the map settings with the provided layers.
126
+ *
127
+ * @param {MapLyrs} lyrs - The layers to be set in the map settings.
128
+ * @return {MapSettings} A new instance of MapSettings with the updated layers.
129
+ */
96
130
  setLyrs(lyrs) {
97
131
  return MapSettings.copy({ ...this, lyrs });
98
132
  }
133
+ /**
134
+ * Updates the language setting for the map configuration and returns a new instance with the updated language.
135
+ *
136
+ * @param {string} language - The language to be set for the map configuration.
137
+ * @return {MapSettings} A new instance of MapSettings with the updated language.
138
+ */
99
139
  setLanguage(language) {
100
140
  return MapSettings.copy({ ...this, language });
101
141
  }
142
+ /**
143
+ * Compares the current MapSettings instance with another to determine if they are identical.
144
+ *
145
+ * @param {MapSettings} model - The MapSettings instance to compare with the current instance.
146
+ * @return {boolean} Returns true if both MapSettings instances have the same properties and values; otherwise, false.
147
+ */
102
148
  isSame(model) {
103
149
  if (this.maxZoom !== model.maxZoom)
104
150
  return false;
@@ -187,6 +233,19 @@ class PolygonModel {
187
233
  }
188
234
  }
189
235
 
236
+ /**
237
+ * Enum representing various drawing types.
238
+ *
239
+ * This enumeration is used to define the types of drawable shapes
240
+ * within a specific drawing context. Each member corresponds to
241
+ * a specific type of drawing.
242
+ *
243
+ * Members:
244
+ * - `Polygon`: Represents a polygonal shape (e.g., triangle, pentagon, etc.).
245
+ * - `Circle`: Represents a circular shape.
246
+ * - `Square`: Represents a square shape.
247
+ * - `Box`: Represents a rectangular box shape.
248
+ */
190
249
  var DrawingType;
191
250
  (function (DrawingType) {
192
251
  DrawingType[DrawingType["Polygon"] = 1] = "Polygon";
@@ -195,6 +254,14 @@ var DrawingType;
195
254
  DrawingType[DrawingType["Box"] = 4] = "Box";
196
255
  })(DrawingType || (DrawingType = {}));
197
256
 
257
+ /**
258
+ * An enumeration representing different formats for feature outputs.
259
+ * This can be used to specify the desired output format when dealing with geospatial data.
260
+ *
261
+ * Enumerators:
262
+ * - GeoJson: Represents the GeoJSON format for geospatial data.
263
+ * - WKT: Represents the Well-Known Text (WKT) format for geospatial data.
264
+ */
198
265
  var FeatureOutputFormat;
199
266
  (function (FeatureOutputFormat) {
200
267
  FeatureOutputFormat[FeatureOutputFormat["GeoJson"] = 1] = "GeoJson";
@@ -215,142 +282,140 @@ class MapControl extends Control {
215
282
  }
216
283
  }
217
284
 
218
- class MapRenderedEvent extends PostboyGenericMessage {
219
- map;
220
- static ID = 'b6121807-3b89-4cd3-82cf-089d2cefdc4f';
221
- constructor(map) {
222
- super();
223
- this.map = map;
224
- }
225
- get id() {
226
- return MapRenderedEvent.ID;
227
- }
228
- }
229
-
230
- class MapClickEvent extends PostboyGenericMessage {
231
- coordinates;
232
- entities;
233
- features;
234
- static ID = '323df526-8d9c-49c6-83e8-6e9a1e7762f7';
235
- constructor(coordinates, entities, features) {
236
- super();
237
- this.coordinates = coordinates;
238
- this.entities = entities;
239
- this.features = features;
240
- }
241
- get id() {
242
- return MapClickEvent.ID;
243
- }
244
- }
245
-
246
- class MapMoveEndEvent extends PostboyGenericMessage {
247
- position;
248
- static ID = 'f21f783e-b5af-4489-9fec-8027fd07a8ad';
249
- constructor(position) {
285
+ /**
286
+ * Represents a command to add a custom control to a map.
287
+ */
288
+ class AddControlCommand extends PostboyGenericMessage {
289
+ item;
290
+ /**
291
+ * Creates an instance of the class with the specified MapControl object.
292
+ *
293
+ * @param {MapControl} item - The MapControl object to be associated with the instance.
294
+ */
295
+ constructor(item) {
250
296
  super();
251
- this.position = position;
252
- }
253
- get id() {
254
- return MapMoveEndEvent.ID;
297
+ this.item = item;
255
298
  }
256
299
  }
257
300
 
301
+ /**
302
+ * A command class that represents the action to close a tooltip.
303
+ */
258
304
  class CloseTooltipCommand extends PostboyGenericMessage {
259
305
  tooltipId;
260
- static ID = '4896d52c-e34f-4994-bcfd-32832d12dbe4';
306
+ /**
307
+ * Creates an instance of the class with the specified tooltip ID.
308
+ *
309
+ * @param {string} tooltipId - The unique identifier for the tooltip.
310
+ */
261
311
  constructor(tooltipId) {
262
312
  super();
263
313
  this.tooltipId = tooltipId;
264
314
  }
265
- get id() {
266
- return CloseTooltipCommand.ID;
267
- }
268
315
  }
269
316
 
317
+ /**
318
+ * Represents a command to start a drawing operation.
319
+ */
270
320
  class StartDrawingCommand extends PostboyCallbackMessage {
271
321
  type;
272
322
  style;
273
323
  format;
274
- static ID = 'da904f4b-a1c8-4db7-a6af-14d9ee18ec8c';
324
+ /**
325
+ * Constructor for creating an instance of the class that represents a drawing feature with specific type, style, and output format.
326
+ *
327
+ * @param {DrawingType} type - The type of the drawing to be created.
328
+ * @param {Style} style - The style defining visual appearance of the drawing.
329
+ * @param {FeatureOutputFormat} [format=FeatureOutputFormat.GeoJson] - The format of the feature output. Defaults to GeoJson.
330
+ */
275
331
  constructor(type, style, format = FeatureOutputFormat.GeoJson) {
276
332
  super();
277
333
  this.type = type;
278
334
  this.style = style;
279
335
  this.format = format;
280
336
  }
281
- get id() {
282
- return StartDrawingCommand.ID;
283
- }
284
337
  }
285
338
 
339
+ /**
340
+ * Represents a command to cancel a drawing action.
341
+ */
286
342
  class CancelDrawingCommand extends PostboyGenericMessage {
287
- static ID = '7d38d983-feba-4176-a66b-18175e5ecd6b';
288
- get id() {
289
- return CancelDrawingCommand.ID;
290
- }
291
343
  }
292
344
 
345
+ /**
346
+ * Class representing a command to draw a selection area with a specific type and style.
347
+ *
348
+ * @return {Dictionary<IIdentified[]>} - a collection of features inside the selected area, grouped by a layer's name
349
+ */
293
350
  class DrawSelectionAreaCommand extends PostboyCallbackMessage {
294
351
  type;
295
352
  style;
296
353
  ignore;
297
- static ID = '573d8a0d-f25b-42b7-9ad7-0ac6d86ac362';
354
+ /**
355
+ * Constructs a new instance with the specified type, style, and optional set of ignored items.
356
+ *
357
+ * @param {DrawingType} type - The type of drawing to be created.
358
+ * @param {Style} style - The style information for the drawing.
359
+ * @param {Set<string>} [ignore=new Set<string>()] - Optional set of items to be ignored.
360
+ */
298
361
  constructor(type, style, ignore = new Set()) {
299
362
  super();
300
363
  this.type = type;
301
364
  this.style = style;
302
365
  this.ignore = ignore;
303
366
  }
304
- get id() {
305
- return DrawSelectionAreaCommand.ID;
306
- }
307
367
  }
308
368
 
369
+ /**
370
+ * Represents a command to modify a feature with a specific style and output format
371
+ * for a polygonal model.
372
+ *
373
+ * @return {string | null} a string representation of the modified feature in the appropriate format
374
+ */
309
375
  class ModifyFeatureCommand extends PostboyCallbackMessage {
310
376
  model;
311
377
  style;
312
378
  format;
313
- static ID = 'ead85caa-24c6-4844-a68c-2cea91774c8c';
379
+ /**
380
+ * Constructs an instance of the class.
381
+ *
382
+ * @param {PolygonModel} model - The polygon model to be used.
383
+ * @param {Style} style - The style configuration for the polygon.
384
+ * @param {FeatureOutputFormat} [format=FeatureOutputFormat.GeoJson] - The output format of the features. Default is GeoJson.
385
+ */
314
386
  constructor(model, style, format = FeatureOutputFormat.GeoJson) {
315
387
  super();
316
388
  this.model = model;
317
389
  this.style = style;
318
390
  this.format = format;
319
391
  }
320
- get id() {
321
- return ModifyFeatureCommand.ID;
322
- }
323
392
  }
324
393
 
394
+ /**
395
+ * Represents a command to cancel a feature modification.
396
+ */
325
397
  class CancelFeatureModificationCommand extends PostboyGenericMessage {
326
- static ID = '9c9fb40f-ea95-4704-8177-0e9ecabf36fa';
327
- get id() {
328
- return CancelFeatureModificationCommand.ID;
329
- }
330
- }
331
-
332
- class AddControlCommand extends PostboyGenericMessage {
333
- item;
334
- static ID = '8e1c06eb-b395-4fe1-929c-ebf0805eeb49';
335
- constructor(item) {
336
- super();
337
- this.item = item;
338
- }
339
- get id() {
340
- return AddControlCommand.ID;
341
- }
342
398
  }
343
399
 
400
+ /**
401
+ * Represents a command to remove a map control from the map.
402
+ *
403
+ * The command is identified by a unique static ID, and it requires a MapControl item
404
+ * to specify the control to be removed.
405
+ *
406
+ * @extends PostboyGenericMessage
407
+ */
344
408
  class RemoveControlCommand extends PostboyGenericMessage {
345
409
  item;
346
- static ID = '361641e0-804a-4930-8c27-0cea6330dbfc';
410
+ /**
411
+ * Constructs an instance of the class.
412
+ *
413
+ * @param {MapControl} item - The map control instance to be removed.
414
+ */
347
415
  constructor(item) {
348
416
  super();
349
417
  this.item = item;
350
418
  }
351
- get id() {
352
- return RemoveControlCommand.ID;
353
- }
354
419
  }
355
420
 
356
421
  /**
@@ -360,7 +425,6 @@ class SetMapCenterCommand extends PostboyGenericMessage {
360
425
  lat;
361
426
  lng;
362
427
  zoom;
363
- static ID = 'd50e89c9-6707-4f8c-ab57-65fcef232182';
364
428
  /**
365
429
  *
366
430
  * @param lat - the desired latitude
@@ -373,215 +437,258 @@ class SetMapCenterCommand extends PostboyGenericMessage {
373
437
  this.lng = lng;
374
438
  this.zoom = zoom;
375
439
  }
376
- get id() {
377
- return SetMapCenterCommand.ID;
378
- }
379
- }
380
-
381
- class CalculateAreaExecutor extends PostboyExecutor {
382
- polygon;
383
- static ID = '172ecf46-86b5-4f46-a5f1-96ba2cbb1694';
384
- constructor(polygon) {
385
- super();
386
- this.polygon = polygon;
387
- }
388
- get id() {
389
- return CalculateAreaExecutor.ID;
390
- }
391
440
  }
392
441
 
442
+ /**
443
+ * FitToPolygonsCommand is a command used to fit a given set of polygon features
444
+ * to the viewable area, optionally applying a zoom transformation afterwards.
445
+ */
393
446
  class FitToPolygonsCommand extends PostboyGenericMessage {
394
447
  features;
395
448
  zoomAfter;
396
- static ID = 'a9e42b23-ffaf-4c46-8370-e0432cd14d60';
449
+ /**
450
+ * Creates an instance of the class with specified polygon features and an optional zoom level.
451
+ *
452
+ * @param {PolygonModel[]} features - An array of polygon models to fit to.
453
+ * @param {number} [zoomAfter=0] - Optional zoom level change to apply after initialization. Defaults to 0.
454
+ */
397
455
  constructor(features, zoomAfter = 0) {
398
456
  super();
399
457
  this.features = features;
400
458
  this.zoomAfter = zoomAfter;
401
459
  }
402
- get id() {
403
- return FitToPolygonsCommand.ID;
404
- }
405
460
  }
406
461
 
407
462
  /**
408
- * A message that allows to get the current state of the map.
409
- * If the map's state is not defined yet, the executor would return null
410
- * @returns {MapPosition | null}
463
+ * Represents an event triggered when a map rendering process is completed.
411
464
  */
412
- class GetMapPositionExecutor extends PostboyExecutor {
413
- static ID = '52c95689-d09b-4082-ba58-9183ea96a213';
414
- get id() {
415
- return GetMapPositionExecutor.ID;
465
+ class MapRenderedEvent extends PostboyGenericMessage {
466
+ map;
467
+ /**
468
+ * Constructor for creating an instance of the class.
469
+ *
470
+ * @param {Map} map - The map instance to be used by the class.
471
+ */
472
+ constructor(map) {
473
+ super();
474
+ this.map = map;
416
475
  }
417
- constructor() {
476
+ }
477
+
478
+ /**
479
+ * Represents an event triggered by a click on a map, containing information about the
480
+ * click's location, relevant entities, and features present at the clicked position.
481
+ *
482
+ * @extends {PostboyGenericMessage}
483
+ */
484
+ class MapClickEvent extends PostboyGenericMessage {
485
+ coordinates;
486
+ entities;
487
+ features;
488
+ /**
489
+ * Creates an instance of this class with the provided coordinates, entities, and features.
490
+ *
491
+ * @param {number[]} coordinates - An array representing the coordinates.
492
+ * @param {{ [layer: string]: IIdentified[] }} entities - A mapping of layer names to arrays of IIdentified entities.
493
+ * @param {{ [layer: string]: Feature<Geometry>[] }} features - A mapping of layer names to arrays of features with geometry.
494
+ */
495
+ constructor(coordinates, entities, features) {
418
496
  super();
497
+ this.coordinates = coordinates;
498
+ this.entities = entities;
499
+ this.features = features;
419
500
  }
420
501
  }
421
502
 
422
- class GetFeaturesInAreaQuery extends PostboyCallbackMessage {
423
- area;
424
- ignore;
425
- static ID = 'efcf4271-a07a-40e0-9f02-d4dade40b8ac';
426
- constructor(area, ignore = new Set()) {
503
+ /**
504
+ * Represents an event that is triggered when the movement of a map ends.
505
+ * This class is used to capture the final position of a map after a movement operation.
506
+ *
507
+ * @property {MapPosition | null} position - The final position of the map after movement ends. Can be null.
508
+ */
509
+ class MapMoveEndEvent extends PostboyGenericMessage {
510
+ position;
511
+ constructor(position) {
427
512
  super();
428
- this.area = area;
429
- this.ignore = ignore;
513
+ this.position = position;
430
514
  }
431
- get id() {
432
- return GetFeaturesInAreaQuery.ID;
515
+ }
516
+
517
+ /**
518
+ * A class responsible for executing filtering of geographical features
519
+ * based on a specific geographical point (latitude and longitude).
520
+ *
521
+ * @template Feature - A geographical feature that is processed by the executor.
522
+ * @template Geometry - The type of geometry associated with the feature.
523
+ */
524
+ class FilterFeaturesInPointExecutor extends PostboyExecutor {
525
+ lat;
526
+ lng;
527
+ features;
528
+ /**
529
+ * Constructs a new instance with the specified latitude, longitude, and features.
530
+ *
531
+ * @param {number} lat - The latitude coordinate.
532
+ * @param {number} lng - The longitude coordinate.
533
+ * @param {Feature<Geometry>[]} features - The array of features associated with the location.
534
+ */
535
+ constructor(lat, lng, features) {
536
+ super();
537
+ this.lat = lat;
538
+ this.lng = lng;
539
+ this.features = features;
433
540
  }
434
541
  }
435
542
 
543
+ /**
544
+ * A class that extends the PostboyExecutor to filter geographical features within a specified area.
545
+ * This class is designed to process a list of input features and determine which of them are located inside the provided area geometry.
546
+ *
547
+ * Parameters:
548
+ * - `area`: A Geometry object defining the area to filter geographical features.
549
+ * - `features`: An array of geographical features, represented as `Feature<Geometry>` objects, to be filtered by their presence within the specified area.
550
+ */
436
551
  class FilterFeaturesInAreaExecutor extends PostboyExecutor {
437
552
  area;
438
553
  features;
439
- static ID = '36bb2d94-8028-4512-90dd-2386af3fc67c';
440
554
  constructor(area, features) {
441
555
  super();
442
556
  this.area = area;
443
557
  this.features = features;
444
558
  }
445
- get id() {
446
- return FilterFeaturesInAreaExecutor.ID;
559
+ }
560
+
561
+ /**
562
+ * An executor responsible for calculating the area of a given polygon.
563
+ *
564
+ * Use this class to manage and execute area-calculation logic for a polygon.
565
+ *
566
+ * @return {number} - the spherical area (in square meters)
567
+ */
568
+ class CalculateAreaExecutor extends PostboyExecutor {
569
+ polygon;
570
+ constructor(polygon) {
571
+ super();
572
+ this.polygon = polygon;
447
573
  }
448
574
  }
449
575
 
450
576
  /**
451
- * Represents a query to retrieve features located at a specific geographical point.
452
- * The query is defined by latitude, longitude, and an optional set of features to ignore.
577
+ * A message that allows to get the current state of the map.
578
+ * If the map's state is not defined yet, the executor would return null
579
+ * @returns {MapPosition | null}
453
580
  */
454
- class GetFeaturesInPointQuery extends PostboyCallbackMessage {
455
- lat;
456
- lng;
581
+ class GetMapPositionExecutor extends PostboyExecutor {
582
+ static ID = '52c95689-d09b-4082-ba58-9183ea96a213';
583
+ constructor() {
584
+ super();
585
+ }
586
+ }
587
+
588
+ /**
589
+ * Class representing a query to get features within a specified geographical area.
590
+ * The query optionally takes a set of layer names to ignore during the operation.
591
+ */
592
+ class GetFeaturesInAreaQuery extends PostboyCallbackMessage {
593
+ area;
457
594
  ignore;
458
- static ID = '7c051c97-bbf1-47eb-baa3-4d1eef6f281f';
459
- constructor(lat, lng, ignore = new Set()) {
595
+ /**
596
+ * Constructor to initialize the object with a Geometry instance and an optional set of strings to ignore.
597
+ *
598
+ * @param {Geometry} area - The Geometry object used to define the area.
599
+ * @param {Set<string>} [ignore] - An optional set of layer names that will be ignored. Defaults to an empty set.
600
+ */
601
+ constructor(area, ignore = new Set()) {
460
602
  super();
461
- this.lat = lat;
462
- this.lng = lng;
603
+ this.area = area;
463
604
  this.ignore = ignore;
464
605
  }
465
- get id() {
466
- return GetFeaturesInPointQuery.ID;
467
- }
468
606
  }
469
607
 
470
608
  /**
471
- * The FilterFeaturesInPointExecutor class is responsible for filtering features within a given point.
609
+ * Represents a query to retrieve features located at a specific geographical point.
610
+ * The query is defined by latitude, longitude, and an optional set of features to ignore.
472
611
  */
473
- class FilterFeaturesInPointExecutor extends PostboyExecutor {
612
+ class GetFeaturesInPointQuery extends PostboyCallbackMessage {
474
613
  lat;
475
614
  lng;
476
- features;
477
- static ID = '5b859282-5d5a-47ca-a6ad-863a66c8b82b';
478
- get id() {
479
- return FilterFeaturesInPointExecutor.ID;
480
- }
481
- constructor(lat, lng, features) {
615
+ ignore;
616
+ /**
617
+ * Constructor for initializing a geographic coordinate object.
618
+ *
619
+ * @param {number} lat - The latitude of the location.
620
+ * @param {number} lng - The longitude of the location.
621
+ * @param {Set<string>} [ignore=new Set<string>()] - An optional set of strings to ignore during processing.
622
+ */
623
+ constructor(lat, lng, ignore = new Set()) {
482
624
  super();
483
625
  this.lat = lat;
484
626
  this.lng = lng;
485
- this.features = features;
627
+ this.ignore = ignore;
486
628
  }
487
629
  }
488
630
 
489
631
  class AddLayerCommand extends PostboyGenericMessage {
490
632
  layer;
491
- static ID = 'd93e250f-92bc-43ac-9c6a-46c521a1aaa5';
492
633
  constructor(layer) {
493
634
  super();
494
635
  this.layer = layer;
495
636
  }
496
- get id() {
497
- return AddLayerCommand.ID;
498
- }
499
637
  }
500
638
 
501
639
  class PlaceLayerFeaturesCommand extends PostboyGenericMessage {
502
640
  layer;
503
641
  features;
504
- static ID = '8caf86bc-869b-426f-b36d-4642f6b8aab0';
505
642
  constructor(layer, features) {
506
643
  super();
507
644
  this.layer = layer;
508
645
  this.features = features;
509
646
  }
510
- get id() {
511
- return PlaceLayerFeaturesCommand.ID;
512
- }
513
647
  }
514
648
 
515
649
  class RemoveLayerCommand extends PostboyGenericMessage {
516
650
  layer;
517
- static ID = 'ab484e0e-e185-45cd-8434-12101f3c7eb1';
518
651
  constructor(layer) {
519
652
  super();
520
653
  this.layer = layer;
521
654
  }
522
- get id() {
523
- return RemoveLayerCommand.ID;
524
- }
525
655
  }
526
656
 
527
657
  class AddTileCommand extends PostboyGenericMessage {
528
658
  layer;
529
- static ID = '25b7df28-72ce-4453-9fe6-54285a2fdc57';
530
659
  constructor(layer) {
531
660
  super();
532
661
  this.layer = layer;
533
662
  }
534
- get id() {
535
- return AddTileCommand.ID;
536
- }
537
663
  }
538
664
 
539
665
  class RemoveTileCommand extends PostboyGenericMessage {
540
666
  layer;
541
- static ID = 'c36ccc0b-5638-4819-b148-2de57a59a5b7';
542
667
  constructor(layer) {
543
668
  super();
544
669
  this.layer = layer;
545
670
  }
546
- get id() {
547
- return RemoveTileCommand.ID;
548
- }
549
671
  }
550
672
 
551
673
  class FitToFeaturesCommand extends PostboyGenericMessage {
552
674
  features;
553
675
  zoomAfter;
554
- static ID = '76cdc091-3793-4b6c-82f7-1e0334cf08a8';
555
676
  constructor(features, zoomAfter = 0) {
556
677
  super();
557
678
  this.features = features;
558
679
  this.zoomAfter = zoomAfter;
559
680
  }
560
- get id() {
561
- return FitToFeaturesCommand.ID;
562
- }
563
681
  }
564
682
 
565
683
  class GetLayerQuery extends PostboyCallbackMessage {
566
684
  name;
567
- static ID = '5c04c87b-8a93-4c2a-979e-d1e313d860ed';
568
685
  constructor(name) {
569
686
  super();
570
687
  this.name = name;
571
688
  }
572
- get id() {
573
- return GetLayerQuery.ID;
574
- }
575
689
  }
576
690
 
577
691
  class DrawingFinishedEvent extends PostboyGenericMessage {
578
- static ID = 'c724b68e-b4eb-4783-90f1-a8e31973fd36';
579
- constructor() {
580
- super();
581
- }
582
- get id() {
583
- return DrawingFinishedEvent.ID;
584
- }
585
692
  }
586
693
 
587
694
  class DrawingGenerationService {
@@ -634,28 +741,20 @@ class GenerateDrawExecutor extends PostboyExecutor {
634
741
  layer;
635
742
  style;
636
743
  type;
637
- static ID = 'f01c99ba-0953-4ab5-82f9-04e6fbb678c1';
638
744
  constructor(layer, style, type) {
639
745
  super();
640
746
  this.layer = layer;
641
747
  this.style = style;
642
748
  this.type = type;
643
749
  }
644
- get id() {
645
- return GenerateDrawExecutor.ID;
646
- }
647
750
  }
648
751
 
649
752
  class GenerateZoomControlExecutor extends PostboyExecutor {
650
753
  settings;
651
- static ID = 'ff16a833-c68e-4b1a-bc23-c0d16b002810';
652
754
  constructor(settings) {
653
755
  super();
654
756
  this.settings = settings;
655
757
  }
656
- get id() {
657
- return GenerateZoomControlExecutor.ID;
658
- }
659
758
  }
660
759
 
661
760
  class ZoomControlFactory {
@@ -673,7 +772,11 @@ class ZoomControlFactory {
673
772
  class MapPostboyService extends PostboyService {
674
773
  constructor() {
675
774
  super();
676
- this.addLocker({ locker: StartDrawingCommand.ID, unlocker: DrawingFinishedEvent.ID, locking: [MapClickEvent.ID] });
775
+ this.addLocker({
776
+ locker: StartDrawingCommand.name,
777
+ unlocker: DrawingFinishedEvent.name,
778
+ locking: [MapClickEvent.name],
779
+ });
677
780
  }
678
781
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapPostboyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
679
782
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapPostboyService });
@@ -701,29 +804,29 @@ class MapManagementService {
701
804
  this.observeFeaturesInPoint();
702
805
  }
703
806
  observeRemoveTile() {
704
- this.postboy.subscribe(RemoveTileCommand.ID).subscribe((c) => {
807
+ this.postboy.sub(RemoveTileCommand).subscribe((c) => {
705
808
  if (!this.map)
706
809
  return;
707
810
  this.map.removeLayer(c.layer);
708
811
  });
709
812
  }
710
813
  observeLayerQuery() {
711
- this.postboy.subscribe(GetLayerQuery.ID).subscribe((ev) => ev.finish(this.layers.take(ev.name)));
814
+ this.postboy.sub(GetLayerQuery).subscribe((ev) => ev.finish(this.layers.take(ev.name)));
712
815
  }
713
816
  observeAddTile() {
714
- this.postboy.subscribe(AddTileCommand.ID).subscribe((c) => {
817
+ this.postboy.sub(AddTileCommand).subscribe((c) => {
715
818
  if (!this.map)
716
819
  return;
717
820
  this.map.addLayer(c.layer);
718
821
  });
719
822
  }
720
823
  observeMapRender() {
721
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
824
+ this.postboy.sub(MapRenderedEvent).subscribe((m) => {
722
825
  this.map = m.map;
723
826
  });
724
827
  }
725
828
  observeAddLayer() {
726
- this.postboy.subscribe(AddLayerCommand.ID).subscribe((c) => {
829
+ this.postboy.sub(AddLayerCommand).subscribe((c) => {
727
830
  if (!this.map)
728
831
  return;
729
832
  this.layers.put(c.layer.get('name'), c.layer);
@@ -731,7 +834,7 @@ class MapManagementService {
731
834
  });
732
835
  }
733
836
  observePlaceFeatures() {
734
- this.postboy.subscribe(PlaceLayerFeaturesCommand.ID).subscribe((c) => {
837
+ this.postboy.sub(PlaceLayerFeaturesCommand).subscribe((c) => {
735
838
  if (!this.layers.has(c.layer))
736
839
  return;
737
840
  let source = this.layers.take(c.layer).getSource();
@@ -742,7 +845,7 @@ class MapManagementService {
742
845
  });
743
846
  }
744
847
  observeRemoveLayer() {
745
- this.postboy.subscribe(RemoveLayerCommand.ID).subscribe((c) => {
848
+ this.postboy.sub(RemoveLayerCommand).subscribe((c) => {
746
849
  if (!this.map)
747
850
  return;
748
851
  this.layers.rmv(c.layer.get('name'));
@@ -750,20 +853,20 @@ class MapManagementService {
750
853
  });
751
854
  }
752
855
  observeFeaturesInArea() {
753
- this.postboy.subscribe(GetFeaturesInAreaQuery.ID).subscribe((qr) => {
856
+ this.postboy.sub(GetFeaturesInAreaQuery).subscribe((qr) => {
754
857
  let result = new Dictionary();
755
858
  this.forEachLayer((l, s) => {
756
- let features = this.postboy.execute(new FilterFeaturesInAreaExecutor(qr.area, s?.getFeatures() ?? []));
859
+ let features = this.postboy.exec(new FilterFeaturesInAreaExecutor(qr.area, s?.getFeatures() ?? []));
757
860
  result.put(l.get('name'), features.map((e) => ({ id: e.getId(), ...e.get(MapConstants.FeatureInfo) })));
758
861
  }, qr.ignore);
759
862
  qr.finish(result);
760
863
  });
761
864
  }
762
865
  observeFeaturesInPoint() {
763
- this.postboy.subscribe(GetFeaturesInPointQuery.ID).subscribe((qr) => {
866
+ this.postboy.sub(GetFeaturesInPointQuery).subscribe((qr) => {
764
867
  let result = new Dictionary();
765
868
  this.forEachLayer((l, s) => {
766
- let features = this.postboy.execute(new FilterFeaturesInPointExecutor(qr.lat, qr.lng, s?.getFeatures() ?? []));
869
+ let features = this.postboy.exec(new FilterFeaturesInPointExecutor(qr.lat, qr.lng, s?.getFeatures() ?? []));
767
870
  result.put(l.get('name'), features.map((e) => ({ id: e.getId(), ...e.get(MapConstants.FeatureInfo) })));
768
871
  }, qr.ignore);
769
872
  qr.finish(result);
@@ -807,7 +910,7 @@ class MapStateService {
807
910
  }
808
911
  observeMapRendering() {
809
912
  this.postboy
810
- .subscribe(MapRenderedEvent.ID)
913
+ .sub(MapRenderedEvent)
811
914
  .pipe(first())
812
915
  .subscribe((ev) => {
813
916
  this.map = ev.map;
@@ -817,7 +920,7 @@ class MapStateService {
817
920
  });
818
921
  }
819
922
  observeCenter() {
820
- this.postboy.subscribe(SetMapCenterCommand.ID).subscribe((c) => {
923
+ this.postboy.sub(SetMapCenterCommand).subscribe((c) => {
821
924
  this.map?.getView().setCenter([c.lng, c.lat]);
822
925
  if (c.zoom)
823
926
  this.map?.getView().setZoom(c.zoom);
@@ -843,19 +946,19 @@ class MapFeatureService {
843
946
  this.observeFitToPolygons();
844
947
  }
845
948
  observeMapRender() {
846
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
949
+ this.postboy.sub(MapRenderedEvent).subscribe((m) => {
847
950
  this.map = m.map;
848
951
  if (this.fitPolygonsWaiting)
849
952
  this.postboy.fire(this.fitPolygonsWaiting);
850
953
  });
851
954
  }
852
955
  observeFitToFeatures() {
853
- this.postboy.subscribe(FitToFeaturesCommand.ID).subscribe((cmd) => {
956
+ this.postboy.sub(FitToFeaturesCommand).subscribe((cmd) => {
854
957
  this.fitToGeometries(cmd.features.map((f) => f.getGeometry()), cmd.zoomAfter);
855
958
  });
856
959
  }
857
960
  observeFitToPolygons() {
858
- this.postboy.subscribe(FitToPolygonsCommand.ID).subscribe((cmd) => {
961
+ this.postboy.sub(FitToPolygonsCommand).subscribe((cmd) => {
859
962
  if (!this.map) {
860
963
  this.fitPolygonsWaiting = cmd;
861
964
  return;
@@ -906,7 +1009,7 @@ class MapClickService {
906
1009
  return model;
907
1010
  }
908
1011
  observeMapRender() {
909
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
1012
+ this.postboy.sub(MapRenderedEvent).subscribe((m) => {
910
1013
  this.map = m.map;
911
1014
  this.map?.on('singleclick', (e) => {
912
1015
  this.postboy.fire(this.onClick(e));
@@ -941,30 +1044,26 @@ class DrawingService {
941
1044
  this.observeMapRender();
942
1045
  }
943
1046
  observeSelectArea() {
944
- this.postboy.subscribe(DrawSelectionAreaCommand.ID).subscribe((ev) => {
945
- const drawingCommand = new StartDrawingCommand(ev.type, ev.style);
946
- drawingCommand.result.subscribe((r) => {
1047
+ this.postboy.sub(DrawSelectionAreaCommand).subscribe((ev) => {
1048
+ this.postboy.fireCallback(new StartDrawingCommand(ev.type, ev.style), (r) => {
947
1049
  if (!r) {
948
1050
  ev.finish(new Dictionary());
949
1051
  return;
950
1052
  }
951
1053
  const area = PolygonModel.fromGeoJson(1, r).feature.getGeometry();
952
- const getFeaturesCommand = new GetFeaturesInAreaQuery(area, ev.ignore);
953
- getFeaturesCommand.result.subscribe((result) => ev.finish(result));
954
- this.postboy.fire(getFeaturesCommand);
1054
+ this.postboy.fireCallback(new GetFeaturesInAreaQuery(area, ev.ignore), (result) => ev.finish(result));
955
1055
  });
956
- this.postboy.fire(drawingCommand);
957
1056
  });
958
1057
  }
959
1058
  observeDrawing() {
960
- this.postboy.subscribe(StartDrawingCommand.ID).subscribe((ev) => {
1059
+ this.postboy.sub(StartDrawingCommand).subscribe((ev) => {
961
1060
  this.draw((l) => {
962
1061
  if (!l || !this.map) {
963
1062
  this.clearInteraction(l);
964
1063
  return;
965
1064
  }
966
1065
  const cancelSub = this.observeCancelation(ev, l);
967
- this.drawInteraction = this.postboy.execute(new GenerateDrawExecutor(l, ev.style, ev.type));
1066
+ this.drawInteraction = this.postboy.exec(new GenerateDrawExecutor(l, ev.style, ev.type));
968
1067
  this.map?.addInteraction(this.drawInteraction);
969
1068
  this.drawInteraction.on('drawend', (evt) => {
970
1069
  cancelSub.unsubscribe();
@@ -980,18 +1079,16 @@ class DrawingService {
980
1079
  this.clearInteraction(layer);
981
1080
  }
982
1081
  observeMapRender() {
983
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
1082
+ this.postboy.sub(MapRenderedEvent).subscribe((m) => {
984
1083
  this.map = m.map;
985
1084
  });
986
1085
  }
987
1086
  draw(action) {
988
- const query = new GetLayerQuery(MapConstants.DrawingLayerId);
989
- query.result.subscribe((l) => action(l));
990
- this.postboy.fire(query);
1087
+ this.postboy.fireCallback(new GetLayerQuery(MapConstants.DrawingLayerId), (l) => action(l));
991
1088
  }
992
1089
  observeCancelation(ev, layer) {
993
1090
  return this.postboy
994
- .subscribe(CancelDrawingCommand.ID)
1091
+ .sub(CancelDrawingCommand)
995
1092
  .pipe(first())
996
1093
  .subscribe(() => {
997
1094
  ev.finish(null);
@@ -1025,7 +1122,7 @@ class FeatureModificationService {
1025
1122
  this.observeMapRender();
1026
1123
  }
1027
1124
  observeModification() {
1028
- this.postboy.subscribe(ModifyFeatureCommand.ID).subscribe((ev) => {
1125
+ this.postboy.sub(ModifyFeatureCommand).subscribe((ev) => {
1029
1126
  this.defineLayer((l) => {
1030
1127
  if (!l || !this.map) {
1031
1128
  this.clearInteraction(l);
@@ -1071,18 +1168,16 @@ class FeatureModificationService {
1071
1168
  : new WKT().writeFeature(command.model.feature));
1072
1169
  }
1073
1170
  observeMapRender() {
1074
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
1171
+ this.postboy.sub(MapRenderedEvent).subscribe((m) => {
1075
1172
  this.map = m.map;
1076
1173
  });
1077
1174
  }
1078
1175
  defineLayer(action) {
1079
- const query = new GetLayerQuery(MapConstants.DrawingLayerId);
1080
- query.result.subscribe((l) => action(l));
1081
- this.postboy.fire(query);
1176
+ this.postboy.fireCallback(new GetLayerQuery(MapConstants.DrawingLayerId), (l) => action(l));
1082
1177
  }
1083
1178
  observeCancelation(ev, layer) {
1084
1179
  return this.postboy
1085
- .subscribe(CancelFeatureModificationCommand.ID)
1180
+ .sub(CancelFeatureModificationCommand)
1086
1181
  .pipe(first())
1087
1182
  .subscribe(() => {
1088
1183
  ev.finish(null);
@@ -1113,7 +1208,7 @@ class ControlsService {
1113
1208
  }
1114
1209
  observeMapRender() {
1115
1210
  this.postboy
1116
- .subscribe(MapRenderedEvent.ID)
1211
+ .sub(MapRenderedEvent)
1117
1212
  .pipe(first())
1118
1213
  .subscribe((m) => {
1119
1214
  this.map = m.map;
@@ -1122,12 +1217,10 @@ class ControlsService {
1122
1217
  });
1123
1218
  }
1124
1219
  observeAdding() {
1125
- this.postboy.subscribe(AddControlCommand.ID).subscribe((c) => this.map?.addControl(c.item));
1220
+ this.postboy.sub(AddControlCommand).subscribe((c) => this.map?.addControl(c.item));
1126
1221
  }
1127
1222
  observeRemoving() {
1128
- this.postboy
1129
- .subscribe(RemoveControlCommand.ID)
1130
- .subscribe((c) => this.map?.removeControl(c.item));
1223
+ this.postboy.sub(RemoveControlCommand).subscribe((c) => this.map?.removeControl(c.item));
1131
1224
  }
1132
1225
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ControlsService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
1133
1226
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ControlsService });
@@ -1144,38 +1237,38 @@ class MessageRegistratorService extends PostboyAbstractRegistrator {
1144
1237
  this.registerServices([management, state, interaction, mapFeature, drawing, featureModification, controls]);
1145
1238
  }
1146
1239
  _up() {
1147
- this.registerReplay(MapRenderedEvent.ID);
1148
- this.registerReplay(PlaceLayerFeaturesCommand.ID);
1149
- this.registerReplay(RemoveControlCommand.ID);
1150
- this.registerReplay(AddControlCommand.ID);
1151
- this.registerReplay(SetMapCenterCommand.ID);
1152
- this.registerSubject(AddLayerCommand.ID);
1153
- this.registerSubject(RemoveLayerCommand.ID);
1154
- this.registerSubject(AddTileCommand.ID);
1155
- this.registerSubject(RemoveTileCommand.ID);
1156
- this.registerSubject(MapClickEvent.ID);
1157
- this.registerSubject(CloseTooltipCommand.ID);
1158
- this.registerSubject(FitToFeaturesCommand.ID);
1159
- this.registerSubject(FitToPolygonsCommand.ID);
1160
- this.registerSubject(MapMoveEndEvent.ID);
1161
- this.registerSubject(CancelDrawingCommand.ID);
1162
- this.registerSubject(StartDrawingCommand.ID);
1163
- this.registerSubject(GetLayerQuery.ID);
1164
- this.registerSubject(DrawingFinishedEvent.ID);
1165
- this.registerSubject(GetFeaturesInAreaQuery.ID);
1166
- this.registerSubject(DrawSelectionAreaCommand.ID);
1167
- this.registerSubject(CancelFeatureModificationCommand.ID);
1168
- this.registerSubject(ModifyFeatureCommand.ID);
1169
- this.registerSubject(GetFeaturesInPointQuery.ID);
1240
+ this.recordReplay(MapRenderedEvent);
1241
+ this.recordReplay(PlaceLayerFeaturesCommand);
1242
+ this.recordReplay(RemoveControlCommand);
1243
+ this.recordReplay(AddControlCommand);
1244
+ this.recordReplay(SetMapCenterCommand);
1245
+ this.recordSubject(AddLayerCommand);
1246
+ this.recordSubject(RemoveLayerCommand);
1247
+ this.recordSubject(AddTileCommand);
1248
+ this.recordSubject(RemoveTileCommand);
1249
+ this.recordSubject(MapClickEvent);
1250
+ this.recordSubject(CloseTooltipCommand);
1251
+ this.recordSubject(FitToFeaturesCommand);
1252
+ this.recordSubject(FitToPolygonsCommand);
1253
+ this.recordSubject(MapMoveEndEvent);
1254
+ this.recordSubject(CancelDrawingCommand);
1255
+ this.recordSubject(StartDrawingCommand);
1256
+ this.recordSubject(GetLayerQuery);
1257
+ this.recordSubject(DrawingFinishedEvent);
1258
+ this.recordSubject(GetFeaturesInAreaQuery);
1259
+ this.recordSubject(DrawSelectionAreaCommand);
1260
+ this.recordSubject(CancelFeatureModificationCommand);
1261
+ this.recordSubject(ModifyFeatureCommand);
1262
+ this.recordSubject(GetFeaturesInPointQuery);
1170
1263
  this.setExecutors();
1171
1264
  }
1172
1265
  setExecutors() {
1173
- this.registerExecutor(FilterFeaturesInAreaExecutor.ID, (e) => FeatureService.filterFeaturesInArea(e));
1174
- this.registerExecutor(FilterFeaturesInPointExecutor.ID, (e) => FeatureService.filterFeaturesInPoint(e));
1175
- this.registerExecutor(CalculateAreaExecutor.ID, (e) => FeatureService.calculateArea(e.polygon?.feature?.getGeometry()));
1176
- this.registerExecutor(GenerateDrawExecutor.ID, (e) => DrawingGenerationService.getDraw(e));
1177
- this.registerExecutor(GenerateZoomControlExecutor.ID, (e) => ZoomControlFactory.build(e.settings));
1178
- this.registerExecutor(GetMapPositionExecutor.ID, () => this.state.getMapPosition());
1266
+ this.recordExecutor(FilterFeaturesInAreaExecutor, (e) => FeatureService.filterFeaturesInArea(e));
1267
+ this.recordExecutor(FilterFeaturesInPointExecutor, (e) => FeatureService.filterFeaturesInPoint(e));
1268
+ this.recordExecutor(CalculateAreaExecutor, (e) => FeatureService.calculateArea(e.polygon?.feature?.getGeometry()));
1269
+ this.recordExecutor(GenerateDrawExecutor, (e) => DrawingGenerationService.getDraw(e));
1270
+ this.recordExecutor(GenerateZoomControlExecutor, (e) => ZoomControlFactory.build(e.settings));
1271
+ this.recordExecutor(GetMapPositionExecutor, () => this.state.getMapPosition());
1179
1272
  }
1180
1273
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MessageRegistratorService, deps: [{ token: MapPostboyService }, { token: MapManagementService }, { token: MapStateService }, { token: MapFeatureService }, { token: MapClickService }, { token: DrawingService }, { token: FeatureModificationService }, { token: ControlsService }], target: i0.ɵɵFactoryTarget.Injectable });
1181
1274
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MessageRegistratorService });
@@ -1404,7 +1497,7 @@ class TileLayerComponent extends DestructibleComponent {
1404
1497
  }
1405
1498
  ngOnInit() {
1406
1499
  this.postboy
1407
- .subscribe(MapRenderedEvent.ID)
1500
+ .sub(MapRenderedEvent)
1408
1501
  .pipe(filter((m) => !!m), first())
1409
1502
  .subscribe((m) => this.initLayer());
1410
1503
  }
@@ -1633,7 +1726,7 @@ class FeatureLayerComponent extends DestructibleComponent {
1633
1726
  }
1634
1727
  ngOnInit() {
1635
1728
  this.postboy
1636
- .subscribe(MapRenderedEvent.ID)
1729
+ .sub(MapRenderedEvent)
1637
1730
  .pipe(filter((m) => !!m), first())
1638
1731
  .subscribe((m) => this.initLayer());
1639
1732
  }
@@ -1814,14 +1907,14 @@ class ClusterLayerManager {
1814
1907
  }
1815
1908
  observeMapMovement() {
1816
1909
  combineLatest([
1817
- this.postboy.subscribe(MapMoveEndEvent.ID).pipe(auditTime(250)),
1818
- this.postboy.subscribe(MapRenderedEvent.ID),
1910
+ this.postboy.sub(MapMoveEndEvent).pipe(auditTime(250)),
1911
+ this.postboy.sub(MapRenderedEvent),
1819
1912
  ]).subscribe(([movement, renderEvent]) => {
1820
1913
  this.checkClusterNecessity(renderEvent.map);
1821
1914
  });
1822
1915
  }
1823
1916
  observeClick() {
1824
- this.postboy.subscribe(MapClickEvent.ID).subscribe((m) => {
1917
+ this.postboy.sub(MapClickEvent).subscribe((m) => {
1825
1918
  if ((m.features[this.settings.name]?.length ?? 0) > 1) {
1826
1919
  this.postboy.fire(new FitToFeaturesCommand(m.features[this.settings.name], -1));
1827
1920
  }
@@ -1910,7 +2003,7 @@ class ClusterLayerComponent extends DestructibleComponent {
1910
2003
  }
1911
2004
  ngOnInit() {
1912
2005
  this.postboy
1913
- .subscribe(MapRenderedEvent.ID)
2006
+ .sub(MapRenderedEvent)
1914
2007
  .pipe(filter((m) => !!m), first())
1915
2008
  .subscribe((m) => this.initLayer());
1916
2009
  }
@@ -2059,7 +2152,7 @@ class MarkersComponent extends DestructibleComponent {
2059
2152
  }
2060
2153
  ngOnInit() {
2061
2154
  this.postboy
2062
- .subscribe(MapRenderedEvent.ID)
2155
+ .sub(MapRenderedEvent)
2063
2156
  .pipe(filter((m) => !!m), first())
2064
2157
  .subscribe(() => this.putMarkers());
2065
2158
  }
@@ -2150,18 +2243,18 @@ class TooltipComponent extends DestructibleComponent {
2150
2243
  };
2151
2244
  };
2152
2245
  observeMapClick() {
2153
- return this.postboy.subscribe(MapClickEvent.ID).subscribe((ev) => {
2246
+ return this.postboy.sub(MapClickEvent).subscribe((ev) => {
2154
2247
  this._settings.show(ev) ? this.addOverlay(ev.coordinates) : this.removeOverlay();
2155
2248
  });
2156
2249
  }
2157
2250
  observeClose() {
2158
2251
  return this.postboy
2159
- .subscribe(CloseTooltipCommand.ID)
2252
+ .sub(CloseTooltipCommand)
2160
2253
  .pipe(filter((ev) => ev.tooltipId === this._settings.id))
2161
2254
  .subscribe(() => this.removeOverlay());
2162
2255
  }
2163
2256
  observeMapRender() {
2164
- return this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
2257
+ return this.postboy.sub(MapRenderedEvent).subscribe((m) => {
2165
2258
  this.map = m.map;
2166
2259
  });
2167
2260
  }
@@ -2206,7 +2299,7 @@ class PolygonsComponent extends DestructibleComponent {
2206
2299
  }
2207
2300
  ngOnInit() {
2208
2301
  this.postboy
2209
- .subscribe(MapRenderedEvent.ID)
2302
+ .sub(MapRenderedEvent)
2210
2303
  .pipe(filter((m) => !!m), first())
2211
2304
  .subscribe(() => this.putPolygons());
2212
2305
  }
@@ -2377,7 +2470,7 @@ class MapControlZoomComponent extends DestructibleComponent {
2377
2470
  }
2378
2471
  ngOnInit() {
2379
2472
  this.postboy
2380
- .subscribe(MapRenderedEvent.ID)
2473
+ .sub(MapRenderedEvent)
2381
2474
  .pipe(filter((m) => !!m), first())
2382
2475
  .subscribe((m) => {
2383
2476
  this.map = m.map;
@@ -2390,7 +2483,7 @@ class MapControlZoomComponent extends DestructibleComponent {
2390
2483
  setControl() {
2391
2484
  if (!this.map)
2392
2485
  return;
2393
- this.control = this.postboy.execute(new GenerateZoomControlExecutor(this._settings));
2486
+ this.control = this.postboy.exec(new GenerateZoomControlExecutor(this._settings));
2394
2487
  this.map.addControl(this.control);
2395
2488
  }
2396
2489
  eliminate = () => !!this.map && !!this.control && this.map.removeControl(this.control);