@artstesh/maps 6.0.7 → 6.0.9

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 +10 -5
  10. package/dist/esm2022/map/messages/commands/add-layer.command.mjs +2 -5
  11. package/dist/esm2022/map/messages/commands/add-tile.command.mjs +2 -5
  12. package/dist/esm2022/map/messages/commands/cancel-drawing.command.mjs +5 -5
  13. package/dist/esm2022/map/messages/commands/cancel-feature-modification.command.mjs +5 -5
  14. package/dist/esm2022/map/messages/commands/close-tooltip.command.mjs +10 -5
  15. package/dist/esm2022/map/messages/commands/draw-selection-area.command.mjs +14 -5
  16. package/dist/esm2022/map/messages/commands/fit-to-features.command.mjs +2 -5
  17. package/dist/esm2022/map/messages/commands/fit-to-polygons.command.mjs +12 -5
  18. package/dist/esm2022/map/messages/commands/modify-feature.command.mjs +15 -5
  19. package/dist/esm2022/map/messages/commands/place-layer-features.command.mjs +2 -5
  20. package/dist/esm2022/map/messages/commands/remove-control.command.mjs +15 -5
  21. package/dist/esm2022/map/messages/commands/remove-layer.command.mjs +2 -5
  22. package/dist/esm2022/map/messages/commands/remove-tile.command.mjs +2 -5
  23. package/dist/esm2022/map/messages/commands/set-map-center.command.mjs +2 -5
  24. package/dist/esm2022/map/messages/commands/start-drawing.command.mjs +12 -5
  25. package/dist/esm2022/map/messages/events/drawing-finished.event.mjs +2 -8
  26. package/dist/esm2022/map/messages/events/map-click.event.mjs +15 -5
  27. package/dist/esm2022/map/messages/events/map-move-end.event.mjs +8 -5
  28. package/dist/esm2022/map/messages/events/map-rendered.event.mjs +10 -5
  29. package/dist/esm2022/map/messages/executors/calculate-area.executor.mjs +9 -5
  30. package/dist/esm2022/map/messages/executors/filter-features-in-area.executor.mjs +10 -5
  31. package/dist/esm2022/map/messages/executors/filter-features-in-point.executor.mjs +14 -6
  32. package/dist/esm2022/map/messages/executors/generate-draw.executor.mjs +2 -5
  33. package/dist/esm2022/map/messages/executors/generate-zoom-control.executor.mjs +2 -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 +12 -5
  37. package/dist/esm2022/map/messages/queries/get-features-in-point.query.mjs +9 -5
  38. package/dist/esm2022/map/messages/queries/get-layer.query.mjs +2 -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 +10 -5
  61. package/dist/esm2022/src/map/messages/commands/add-layer.command.mjs +2 -5
  62. package/dist/esm2022/src/map/messages/commands/add-tile.command.mjs +2 -5
  63. package/dist/esm2022/src/map/messages/commands/cancel-drawing.command.mjs +5 -5
  64. package/dist/esm2022/src/map/messages/commands/cancel-feature-modification.command.mjs +5 -5
  65. package/dist/esm2022/src/map/messages/commands/close-tooltip.command.mjs +10 -5
  66. package/dist/esm2022/src/map/messages/commands/draw-selection-area.command.mjs +14 -5
  67. package/dist/esm2022/src/map/messages/commands/fit-to-features.command.mjs +2 -5
  68. package/dist/esm2022/src/map/messages/commands/fit-to-polygons.command.mjs +12 -5
  69. package/dist/esm2022/src/map/messages/commands/modify-feature.command.mjs +15 -5
  70. package/dist/esm2022/src/map/messages/commands/place-layer-features.command.mjs +2 -5
  71. package/dist/esm2022/src/map/messages/commands/remove-control.command.mjs +15 -5
  72. package/dist/esm2022/src/map/messages/commands/remove-layer.command.mjs +2 -5
  73. package/dist/esm2022/src/map/messages/commands/remove-tile.command.mjs +2 -5
  74. package/dist/esm2022/src/map/messages/commands/set-map-center.command.mjs +2 -5
  75. package/dist/esm2022/src/map/messages/commands/start-drawing.command.mjs +12 -5
  76. package/dist/esm2022/src/map/messages/events/drawing-finished.event.mjs +2 -8
  77. package/dist/esm2022/src/map/messages/events/map-click.event.mjs +15 -5
  78. package/dist/esm2022/src/map/messages/events/map-move-end.event.mjs +8 -5
  79. package/dist/esm2022/src/map/messages/events/map-rendered.event.mjs +10 -5
  80. package/dist/esm2022/src/map/messages/executors/calculate-area.executor.mjs +9 -5
  81. package/dist/esm2022/src/map/messages/executors/filter-features-in-area.executor.mjs +10 -5
  82. package/dist/esm2022/src/map/messages/executors/filter-features-in-point.executor.mjs +14 -6
  83. package/dist/esm2022/src/map/messages/executors/generate-draw.executor.mjs +2 -5
  84. package/dist/esm2022/src/map/messages/executors/generate-zoom-control.executor.mjs +2 -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 +12 -5
  88. package/dist/esm2022/src/map/messages/queries/get-features-in-point.query.mjs +9 -5
  89. package/dist/esm2022/src/map/messages/queries/get-layer.query.mjs +2 -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 +386 -265
  104. package/dist/fesm2022/maps-components-src-map.mjs.map +1 -1
  105. package/dist/fesm2022/maps-components.mjs +386 -265
  106. package/dist/fesm2022/maps-components.mjs.map +1 -1
  107. package/dist/map/messages/commands/add-control.command.d.ts +9 -2
  108. package/dist/map/messages/commands/add-layer.command.d.ts +1 -2
  109. package/dist/map/messages/commands/add-tile.command.d.ts +1 -2
  110. package/dist/map/messages/commands/cancel-drawing.command.d.ts +4 -2
  111. package/dist/map/messages/commands/cancel-feature-modification.command.d.ts +4 -2
  112. package/dist/map/messages/commands/close-tooltip.command.d.ts +9 -2
  113. package/dist/map/messages/commands/draw-selection-area.command.d.ts +13 -2
  114. package/dist/map/messages/commands/fit-to-features.command.d.ts +1 -2
  115. package/dist/map/messages/commands/fit-to-polygons.command.d.ts +11 -2
  116. package/dist/map/messages/commands/modify-feature.command.d.ts +14 -2
  117. package/dist/map/messages/commands/place-layer-features.command.d.ts +1 -2
  118. package/dist/map/messages/commands/remove-control.command.d.ts +14 -2
  119. package/dist/map/messages/commands/remove-layer.command.d.ts +1 -2
  120. package/dist/map/messages/commands/remove-tile.command.d.ts +1 -2
  121. package/dist/map/messages/commands/set-map-center.command.d.ts +1 -2
  122. package/dist/map/messages/commands/start-drawing.command.d.ts +11 -2
  123. package/dist/map/messages/events/drawing-finished.event.d.ts +1 -3
  124. package/dist/map/messages/events/map-click.event.d.ts +14 -2
  125. package/dist/map/messages/events/map-move-end.event.d.ts +7 -2
  126. package/dist/map/messages/events/map-rendered.event.d.ts +9 -2
  127. package/dist/map/messages/executors/calculate-area.executor.d.ts +8 -2
  128. package/dist/map/messages/executors/filter-features-in-area.executor.d.ts +9 -2
  129. package/dist/map/messages/executors/filter-features-in-point.executor.d.ts +13 -3
  130. package/dist/map/messages/executors/generate-draw.executor.d.ts +1 -2
  131. package/dist/map/messages/executors/generate-zoom-control.executor.d.ts +1 -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 +11 -2
  135. package/dist/map/messages/queries/get-features-in-point.query.d.ts +8 -2
  136. package/dist/map/messages/queries/get-layer.query.d.ts +1 -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 +9 -2
  142. package/dist/src/map/messages/commands/add-layer.command.d.ts +1 -2
  143. package/dist/src/map/messages/commands/add-tile.command.d.ts +1 -2
  144. package/dist/src/map/messages/commands/cancel-drawing.command.d.ts +4 -2
  145. package/dist/src/map/messages/commands/cancel-feature-modification.command.d.ts +4 -2
  146. package/dist/src/map/messages/commands/close-tooltip.command.d.ts +9 -2
  147. package/dist/src/map/messages/commands/draw-selection-area.command.d.ts +13 -2
  148. package/dist/src/map/messages/commands/fit-to-features.command.d.ts +1 -2
  149. package/dist/src/map/messages/commands/fit-to-polygons.command.d.ts +11 -2
  150. package/dist/src/map/messages/commands/modify-feature.command.d.ts +14 -2
  151. package/dist/src/map/messages/commands/place-layer-features.command.d.ts +1 -2
  152. package/dist/src/map/messages/commands/remove-control.command.d.ts +14 -2
  153. package/dist/src/map/messages/commands/remove-layer.command.d.ts +1 -2
  154. package/dist/src/map/messages/commands/remove-tile.command.d.ts +1 -2
  155. package/dist/src/map/messages/commands/set-map-center.command.d.ts +1 -2
  156. package/dist/src/map/messages/commands/start-drawing.command.d.ts +11 -2
  157. package/dist/src/map/messages/events/drawing-finished.event.d.ts +1 -3
  158. package/dist/src/map/messages/events/map-click.event.d.ts +14 -2
  159. package/dist/src/map/messages/events/map-move-end.event.d.ts +7 -2
  160. package/dist/src/map/messages/events/map-rendered.event.d.ts +9 -2
  161. package/dist/src/map/messages/executors/calculate-area.executor.d.ts +8 -2
  162. package/dist/src/map/messages/executors/filter-features-in-area.executor.d.ts +9 -2
  163. package/dist/src/map/messages/executors/filter-features-in-point.executor.d.ts +13 -3
  164. package/dist/src/map/messages/executors/generate-draw.executor.d.ts +1 -2
  165. package/dist/src/map/messages/executors/generate-zoom-control.executor.d.ts +1 -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 +11 -2
  169. package/dist/src/map/messages/queries/get-features-in-point.query.d.ts +8 -2
  170. package/dist/src/map/messages/queries/get-layer.query.d.ts +1 -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,148 @@ 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
+ static ID = '2921fb19-f1c4-4bf4-97be-001f98241f3b';
291
+ /**
292
+ * Creates an instance of the class with the specified MapControl object.
293
+ *
294
+ * @param {MapControl} item - The MapControl object to be associated with the instance.
295
+ */
296
+ constructor(item) {
250
297
  super();
251
- this.position = position;
252
- }
253
- get id() {
254
- return MapMoveEndEvent.ID;
298
+ this.item = item;
255
299
  }
256
300
  }
257
301
 
302
+ /**
303
+ * A command class that represents the action to close a tooltip.
304
+ */
258
305
  class CloseTooltipCommand extends PostboyGenericMessage {
259
306
  tooltipId;
260
- static ID = '4896d52c-e34f-4994-bcfd-32832d12dbe4';
307
+ static ID = 'df687e26-7298-46d7-8911-d014801dafac';
308
+ /**
309
+ * Creates an instance of the class with the specified tooltip ID.
310
+ *
311
+ * @param {string} tooltipId - The unique identifier for the tooltip.
312
+ */
261
313
  constructor(tooltipId) {
262
314
  super();
263
315
  this.tooltipId = tooltipId;
264
316
  }
265
- get id() {
266
- return CloseTooltipCommand.ID;
267
- }
268
317
  }
269
318
 
319
+ /**
320
+ * Represents a command to start a drawing operation.
321
+ */
270
322
  class StartDrawingCommand extends PostboyCallbackMessage {
271
323
  type;
272
324
  style;
273
325
  format;
274
- static ID = 'da904f4b-a1c8-4db7-a6af-14d9ee18ec8c';
326
+ static ID = '4407e9ee-d6c3-4e77-8000-c1aae7433fb6';
327
+ /**
328
+ * Constructor for creating an instance of the class that represents a drawing feature with specific type, style, and output format.
329
+ *
330
+ * @param {DrawingType} type - The type of the drawing to be created.
331
+ * @param {Style} style - The style defining visual appearance of the drawing.
332
+ * @param {FeatureOutputFormat} [format=FeatureOutputFormat.GeoJson] - The format of the feature output. Defaults to GeoJson.
333
+ */
275
334
  constructor(type, style, format = FeatureOutputFormat.GeoJson) {
276
335
  super();
277
336
  this.type = type;
278
337
  this.style = style;
279
338
  this.format = format;
280
339
  }
281
- get id() {
282
- return StartDrawingCommand.ID;
283
- }
284
340
  }
285
341
 
342
+ /**
343
+ * Represents a command to cancel a drawing action.
344
+ */
286
345
  class CancelDrawingCommand extends PostboyGenericMessage {
287
- static ID = '7d38d983-feba-4176-a66b-18175e5ecd6b';
288
- get id() {
289
- return CancelDrawingCommand.ID;
290
- }
346
+ static ID = '192d70f8-9d12-4cb3-a8ad-0fc2dc5af1de';
291
347
  }
292
348
 
349
+ /**
350
+ * Class representing a command to draw a selection area with a specific type and style.
351
+ *
352
+ * @return {Dictionary<IIdentified[]>} - a collection of features inside the selected area, grouped by a layer's name
353
+ */
293
354
  class DrawSelectionAreaCommand extends PostboyCallbackMessage {
294
355
  type;
295
356
  style;
296
357
  ignore;
297
- static ID = '573d8a0d-f25b-42b7-9ad7-0ac6d86ac362';
358
+ static ID = '06e43f59-c6ba-41bb-9c5b-f6534d914905';
359
+ /**
360
+ * Constructs a new instance with the specified type, style, and optional set of ignored items.
361
+ *
362
+ * @param {DrawingType} type - The type of drawing to be created.
363
+ * @param {Style} style - The style information for the drawing.
364
+ * @param {Set<string>} [ignore=new Set<string>()] - Optional set of items to be ignored.
365
+ */
298
366
  constructor(type, style, ignore = new Set()) {
299
367
  super();
300
368
  this.type = type;
301
369
  this.style = style;
302
370
  this.ignore = ignore;
303
371
  }
304
- get id() {
305
- return DrawSelectionAreaCommand.ID;
306
- }
307
372
  }
308
373
 
374
+ /**
375
+ * Represents a command to modify a feature with a specific style and output format
376
+ * for a polygonal model.
377
+ *
378
+ * @return {string | null} a string representation of the modified feature in the appropriate format
379
+ */
309
380
  class ModifyFeatureCommand extends PostboyCallbackMessage {
310
381
  model;
311
382
  style;
312
383
  format;
313
- static ID = 'ead85caa-24c6-4844-a68c-2cea91774c8c';
384
+ static ID = '8f76507e-f18d-4232-bab7-f3d4e3d707bb';
385
+ /**
386
+ * Constructs an instance of the class.
387
+ *
388
+ * @param {PolygonModel} model - The polygon model to be used.
389
+ * @param {Style} style - The style configuration for the polygon.
390
+ * @param {FeatureOutputFormat} [format=FeatureOutputFormat.GeoJson] - The output format of the features. Default is GeoJson.
391
+ */
314
392
  constructor(model, style, format = FeatureOutputFormat.GeoJson) {
315
393
  super();
316
394
  this.model = model;
317
395
  this.style = style;
318
396
  this.format = format;
319
397
  }
320
- get id() {
321
- return ModifyFeatureCommand.ID;
322
- }
323
398
  }
324
399
 
400
+ /**
401
+ * Represents a command to cancel a feature modification.
402
+ */
325
403
  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
- }
404
+ static ID = 'e7886353-53b3-4bbe-93b5-6490e5f1305e';
342
405
  }
343
406
 
407
+ /**
408
+ * Represents a command to remove a map control from the map.
409
+ *
410
+ * The command is identified by a unique static ID, and it requires a MapControl item
411
+ * to specify the control to be removed.
412
+ *
413
+ * @extends PostboyGenericMessage
414
+ */
344
415
  class RemoveControlCommand extends PostboyGenericMessage {
345
416
  item;
346
- static ID = '361641e0-804a-4930-8c27-0cea6330dbfc';
417
+ static ID = '73bcb4f5-ce7d-4c71-b70d-e772100136a1';
418
+ /**
419
+ * Constructs an instance of the class.
420
+ *
421
+ * @param {MapControl} item - The map control instance to be removed.
422
+ */
347
423
  constructor(item) {
348
424
  super();
349
425
  this.item = item;
350
426
  }
351
- get id() {
352
- return RemoveControlCommand.ID;
353
- }
354
427
  }
355
428
 
356
429
  /**
@@ -360,7 +433,7 @@ class SetMapCenterCommand extends PostboyGenericMessage {
360
433
  lat;
361
434
  lng;
362
435
  zoom;
363
- static ID = 'd50e89c9-6707-4f8c-ab57-65fcef232182';
436
+ static ID = 'd4e3cf4f-0be7-4c1a-8355-8607d02c3dea';
364
437
  /**
365
438
  *
366
439
  * @param lat - the desired latitude
@@ -373,215 +446,275 @@ class SetMapCenterCommand extends PostboyGenericMessage {
373
446
  this.lng = lng;
374
447
  this.zoom = zoom;
375
448
  }
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
449
  }
392
450
 
451
+ /**
452
+ * FitToPolygonsCommand is a command used to fit a given set of polygon features
453
+ * to the viewable area, optionally applying a zoom transformation afterwards.
454
+ */
393
455
  class FitToPolygonsCommand extends PostboyGenericMessage {
394
456
  features;
395
457
  zoomAfter;
396
- static ID = 'a9e42b23-ffaf-4c46-8370-e0432cd14d60';
458
+ static ID = '308394ce-48d3-45f5-8671-52207fba4be3';
459
+ /**
460
+ * Creates an instance of the class with specified polygon features and an optional zoom level.
461
+ *
462
+ * @param {PolygonModel[]} features - An array of polygon models to fit to.
463
+ * @param {number} [zoomAfter=0] - Optional zoom level change to apply after initialization. Defaults to 0.
464
+ */
397
465
  constructor(features, zoomAfter = 0) {
398
466
  super();
399
467
  this.features = features;
400
468
  this.zoomAfter = zoomAfter;
401
469
  }
402
- get id() {
403
- return FitToPolygonsCommand.ID;
404
- }
405
470
  }
406
471
 
407
472
  /**
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}
473
+ * Represents an event triggered when a map rendering process is completed.
411
474
  */
412
- class GetMapPositionExecutor extends PostboyExecutor {
413
- static ID = '52c95689-d09b-4082-ba58-9183ea96a213';
414
- get id() {
415
- return GetMapPositionExecutor.ID;
475
+ class MapRenderedEvent extends PostboyGenericMessage {
476
+ map;
477
+ static ID = '4515dde8-1519-4e3f-a0e3-10d3c52deabe';
478
+ /**
479
+ * Constructor for creating an instance of the class.
480
+ *
481
+ * @param {Map} map - The map instance to be used by the class.
482
+ */
483
+ constructor(map) {
484
+ super();
485
+ this.map = map;
416
486
  }
417
- constructor() {
487
+ }
488
+
489
+ /**
490
+ * Represents an event triggered by a click on a map, containing information about the
491
+ * click's location, relevant entities, and features present at the clicked position.
492
+ *
493
+ * @extends {PostboyGenericMessage}
494
+ */
495
+ class MapClickEvent extends PostboyGenericMessage {
496
+ coordinates;
497
+ entities;
498
+ features;
499
+ static ID = 'ee31a86c-e838-4531-8399-983753a354df';
500
+ /**
501
+ * Creates an instance of this class with the provided coordinates, entities, and features.
502
+ *
503
+ * @param {number[]} coordinates - An array representing the coordinates.
504
+ * @param {{ [layer: string]: IIdentified[] }} entities - A mapping of layer names to arrays of IIdentified entities.
505
+ * @param {{ [layer: string]: Feature<Geometry>[] }} features - A mapping of layer names to arrays of features with geometry.
506
+ */
507
+ constructor(coordinates, entities, features) {
418
508
  super();
509
+ this.coordinates = coordinates;
510
+ this.entities = entities;
511
+ this.features = features;
419
512
  }
420
513
  }
421
514
 
422
- class GetFeaturesInAreaQuery extends PostboyCallbackMessage {
423
- area;
424
- ignore;
425
- static ID = 'efcf4271-a07a-40e0-9f02-d4dade40b8ac';
426
- constructor(area, ignore = new Set()) {
515
+ /**
516
+ * Represents an event that is triggered when the movement of a map ends.
517
+ * This class is used to capture the final position of a map after a movement operation.
518
+ *
519
+ * @property {MapPosition | null} position - The final position of the map after movement ends. Can be null.
520
+ */
521
+ class MapMoveEndEvent extends PostboyGenericMessage {
522
+ position;
523
+ static ID = 'd210ec7e-032f-4ce8-8a39-7b816519eaae';
524
+ constructor(position) {
427
525
  super();
428
- this.area = area;
429
- this.ignore = ignore;
526
+ this.position = position;
430
527
  }
431
- get id() {
432
- return GetFeaturesInAreaQuery.ID;
528
+ }
529
+
530
+ /**
531
+ * A class responsible for executing filtering of geographical features
532
+ * based on a specific geographical point (latitude and longitude).
533
+ *
534
+ * @template Feature - A geographical feature that is processed by the executor.
535
+ * @template Geometry - The type of geometry associated with the feature.
536
+ */
537
+ class FilterFeaturesInPointExecutor extends PostboyExecutor {
538
+ lat;
539
+ lng;
540
+ features;
541
+ static ID = 'dcbb156d-def3-45b4-91af-84d1483d8941';
542
+ /**
543
+ * Constructs a new instance with the specified latitude, longitude, and features.
544
+ *
545
+ * @param {number} lat - The latitude coordinate.
546
+ * @param {number} lng - The longitude coordinate.
547
+ * @param {Feature<Geometry>[]} features - The array of features associated with the location.
548
+ */
549
+ constructor(lat, lng, features) {
550
+ super();
551
+ this.lat = lat;
552
+ this.lng = lng;
553
+ this.features = features;
433
554
  }
434
555
  }
435
556
 
557
+ /**
558
+ * A class that extends the PostboyExecutor to filter geographical features within a specified area.
559
+ * This class is designed to process a list of input features and determine which of them are located inside the provided area geometry.
560
+ *
561
+ * Parameters:
562
+ * - `area`: A Geometry object defining the area to filter geographical features.
563
+ * - `features`: An array of geographical features, represented as `Feature<Geometry>` objects, to be filtered by their presence within the specified area.
564
+ */
436
565
  class FilterFeaturesInAreaExecutor extends PostboyExecutor {
437
566
  area;
438
567
  features;
439
- static ID = '36bb2d94-8028-4512-90dd-2386af3fc67c';
568
+ static ID = '4d26e1e3-e60f-4e49-804b-5b3eadc2adce';
440
569
  constructor(area, features) {
441
570
  super();
442
571
  this.area = area;
443
572
  this.features = features;
444
573
  }
445
- get id() {
446
- return FilterFeaturesInAreaExecutor.ID;
574
+ }
575
+
576
+ /**
577
+ * An executor responsible for calculating the area of a given polygon.
578
+ *
579
+ * Use this class to manage and execute area-calculation logic for a polygon.
580
+ *
581
+ * @return {number} - the spherical area (in square meters)
582
+ */
583
+ class CalculateAreaExecutor extends PostboyExecutor {
584
+ polygon;
585
+ static ID = '82347b8c-7635-45ec-85ef-75aaf43bc34c';
586
+ constructor(polygon) {
587
+ super();
588
+ this.polygon = polygon;
447
589
  }
448
590
  }
449
591
 
450
592
  /**
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.
593
+ * A message that allows to get the current state of the map.
594
+ * If the map's state is not defined yet, the executor would return null
595
+ * @returns {MapPosition | null}
453
596
  */
454
- class GetFeaturesInPointQuery extends PostboyCallbackMessage {
455
- lat;
456
- lng;
597
+ class GetMapPositionExecutor extends PostboyExecutor {
598
+ static ID = '52c95689-d09b-4082-ba58-9183ea96a213';
599
+ constructor() {
600
+ super();
601
+ }
602
+ }
603
+
604
+ /**
605
+ * Class representing a query to get features within a specified geographical area.
606
+ * The query optionally takes a set of layer names to ignore during the operation.
607
+ */
608
+ class GetFeaturesInAreaQuery extends PostboyCallbackMessage {
609
+ area;
457
610
  ignore;
458
- static ID = '7c051c97-bbf1-47eb-baa3-4d1eef6f281f';
459
- constructor(lat, lng, ignore = new Set()) {
611
+ static ID = '317cf427-a029-4a43-97c4-cb6b8148ff65';
612
+ /**
613
+ * Constructor to initialize the object with a Geometry instance and an optional set of strings to ignore.
614
+ *
615
+ * @param {Geometry} area - The Geometry object used to define the area.
616
+ * @param {Set<string>} [ignore] - An optional set of layer names that will be ignored. Defaults to an empty set.
617
+ */
618
+ constructor(area, ignore = new Set()) {
460
619
  super();
461
- this.lat = lat;
462
- this.lng = lng;
620
+ this.area = area;
463
621
  this.ignore = ignore;
464
622
  }
465
- get id() {
466
- return GetFeaturesInPointQuery.ID;
467
- }
468
623
  }
469
624
 
470
625
  /**
471
- * The FilterFeaturesInPointExecutor class is responsible for filtering features within a given point.
626
+ * Represents a query to retrieve features located at a specific geographical point.
627
+ * The query is defined by latitude, longitude, and an optional set of features to ignore.
472
628
  */
473
- class FilterFeaturesInPointExecutor extends PostboyExecutor {
629
+ class GetFeaturesInPointQuery extends PostboyCallbackMessage {
474
630
  lat;
475
631
  lng;
476
- features;
477
- static ID = '5b859282-5d5a-47ca-a6ad-863a66c8b82b';
478
- get id() {
479
- return FilterFeaturesInPointExecutor.ID;
480
- }
481
- constructor(lat, lng, features) {
632
+ ignore;
633
+ static ID = '99bbc56f-34a2-4064-8300-13bb3d0662c1';
634
+ /**
635
+ * Constructor for initializing a geographic coordinate object.
636
+ *
637
+ * @param {number} lat - The latitude of the location.
638
+ * @param {number} lng - The longitude of the location.
639
+ * @param {Set<string>} [ignore=new Set<string>()] - An optional set of strings to ignore during processing.
640
+ */
641
+ constructor(lat, lng, ignore = new Set()) {
482
642
  super();
483
643
  this.lat = lat;
484
644
  this.lng = lng;
485
- this.features = features;
645
+ this.ignore = ignore;
486
646
  }
487
647
  }
488
648
 
489
649
  class AddLayerCommand extends PostboyGenericMessage {
490
650
  layer;
491
- static ID = 'd93e250f-92bc-43ac-9c6a-46c521a1aaa5';
651
+ static ID = '7fe68d71-350f-47e2-b1ae-62cc333e1572';
492
652
  constructor(layer) {
493
653
  super();
494
654
  this.layer = layer;
495
655
  }
496
- get id() {
497
- return AddLayerCommand.ID;
498
- }
499
656
  }
500
657
 
501
658
  class PlaceLayerFeaturesCommand extends PostboyGenericMessage {
502
659
  layer;
503
660
  features;
504
- static ID = '8caf86bc-869b-426f-b36d-4642f6b8aab0';
661
+ static ID = '5f27a2cd-8d8a-4929-b703-8aee6dcdc21c';
505
662
  constructor(layer, features) {
506
663
  super();
507
664
  this.layer = layer;
508
665
  this.features = features;
509
666
  }
510
- get id() {
511
- return PlaceLayerFeaturesCommand.ID;
512
- }
513
667
  }
514
668
 
515
669
  class RemoveLayerCommand extends PostboyGenericMessage {
516
670
  layer;
517
- static ID = 'ab484e0e-e185-45cd-8434-12101f3c7eb1';
671
+ static ID = '1b60599c-599a-4fdb-bad2-23b12e435e1a';
518
672
  constructor(layer) {
519
673
  super();
520
674
  this.layer = layer;
521
675
  }
522
- get id() {
523
- return RemoveLayerCommand.ID;
524
- }
525
676
  }
526
677
 
527
678
  class AddTileCommand extends PostboyGenericMessage {
528
679
  layer;
529
- static ID = '25b7df28-72ce-4453-9fe6-54285a2fdc57';
680
+ static ID = 'ae29b7af-21aa-4b0a-8586-92c23779e6cb';
530
681
  constructor(layer) {
531
682
  super();
532
683
  this.layer = layer;
533
684
  }
534
- get id() {
535
- return AddTileCommand.ID;
536
- }
537
685
  }
538
686
 
539
687
  class RemoveTileCommand extends PostboyGenericMessage {
540
688
  layer;
541
- static ID = 'c36ccc0b-5638-4819-b148-2de57a59a5b7';
689
+ static ID = 'dab0f861-bb25-46da-9388-717bfaae798f';
542
690
  constructor(layer) {
543
691
  super();
544
692
  this.layer = layer;
545
693
  }
546
- get id() {
547
- return RemoveTileCommand.ID;
548
- }
549
694
  }
550
695
 
551
696
  class FitToFeaturesCommand extends PostboyGenericMessage {
552
697
  features;
553
698
  zoomAfter;
554
- static ID = '76cdc091-3793-4b6c-82f7-1e0334cf08a8';
699
+ static ID = '04d67609-0b4c-4f52-aa53-ad0a3db967dc';
555
700
  constructor(features, zoomAfter = 0) {
556
701
  super();
557
702
  this.features = features;
558
703
  this.zoomAfter = zoomAfter;
559
704
  }
560
- get id() {
561
- return FitToFeaturesCommand.ID;
562
- }
563
705
  }
564
706
 
565
707
  class GetLayerQuery extends PostboyCallbackMessage {
566
708
  name;
567
- static ID = '5c04c87b-8a93-4c2a-979e-d1e313d860ed';
709
+ static ID = 'd2683490-2aa2-4dee-855d-f752ce4d3be5';
568
710
  constructor(name) {
569
711
  super();
570
712
  this.name = name;
571
713
  }
572
- get id() {
573
- return GetLayerQuery.ID;
574
- }
575
714
  }
576
715
 
577
716
  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
- }
717
+ static ID = '9094e160-8df7-4868-883a-3436724106dd';
585
718
  }
586
719
 
587
720
  class DrawingGenerationService {
@@ -634,28 +767,22 @@ class GenerateDrawExecutor extends PostboyExecutor {
634
767
  layer;
635
768
  style;
636
769
  type;
637
- static ID = 'f01c99ba-0953-4ab5-82f9-04e6fbb678c1';
770
+ static ID = '5d5f0737-ff70-461e-9a2e-bf6166c914cb';
638
771
  constructor(layer, style, type) {
639
772
  super();
640
773
  this.layer = layer;
641
774
  this.style = style;
642
775
  this.type = type;
643
776
  }
644
- get id() {
645
- return GenerateDrawExecutor.ID;
646
- }
647
777
  }
648
778
 
649
779
  class GenerateZoomControlExecutor extends PostboyExecutor {
650
780
  settings;
651
- static ID = 'ff16a833-c68e-4b1a-bc23-c0d16b002810';
781
+ static ID = 'c59f4fc3-ccf6-4cb3-a38b-3a8c249114a2';
652
782
  constructor(settings) {
653
783
  super();
654
784
  this.settings = settings;
655
785
  }
656
- get id() {
657
- return GenerateZoomControlExecutor.ID;
658
- }
659
786
  }
660
787
 
661
788
  class ZoomControlFactory {
@@ -673,7 +800,11 @@ class ZoomControlFactory {
673
800
  class MapPostboyService extends PostboyService {
674
801
  constructor() {
675
802
  super();
676
- this.addLocker({ locker: StartDrawingCommand.ID, unlocker: DrawingFinishedEvent.ID, locking: [MapClickEvent.ID] });
803
+ this.addLocker({
804
+ locker: StartDrawingCommand.name,
805
+ unlocker: DrawingFinishedEvent.name,
806
+ locking: [MapClickEvent.name],
807
+ });
677
808
  }
678
809
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapPostboyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
679
810
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapPostboyService });
@@ -701,29 +832,29 @@ class MapManagementService {
701
832
  this.observeFeaturesInPoint();
702
833
  }
703
834
  observeRemoveTile() {
704
- this.postboy.subscribe(RemoveTileCommand.ID).subscribe((c) => {
835
+ this.postboy.sub(RemoveTileCommand).subscribe((c) => {
705
836
  if (!this.map)
706
837
  return;
707
838
  this.map.removeLayer(c.layer);
708
839
  });
709
840
  }
710
841
  observeLayerQuery() {
711
- this.postboy.subscribe(GetLayerQuery.ID).subscribe((ev) => ev.finish(this.layers.take(ev.name)));
842
+ this.postboy.sub(GetLayerQuery).subscribe((ev) => ev.finish(this.layers.take(ev.name)));
712
843
  }
713
844
  observeAddTile() {
714
- this.postboy.subscribe(AddTileCommand.ID).subscribe((c) => {
845
+ this.postboy.sub(AddTileCommand).subscribe((c) => {
715
846
  if (!this.map)
716
847
  return;
717
848
  this.map.addLayer(c.layer);
718
849
  });
719
850
  }
720
851
  observeMapRender() {
721
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
852
+ this.postboy.sub(MapRenderedEvent).subscribe((m) => {
722
853
  this.map = m.map;
723
854
  });
724
855
  }
725
856
  observeAddLayer() {
726
- this.postboy.subscribe(AddLayerCommand.ID).subscribe((c) => {
857
+ this.postboy.sub(AddLayerCommand).subscribe((c) => {
727
858
  if (!this.map)
728
859
  return;
729
860
  this.layers.put(c.layer.get('name'), c.layer);
@@ -731,7 +862,7 @@ class MapManagementService {
731
862
  });
732
863
  }
733
864
  observePlaceFeatures() {
734
- this.postboy.subscribe(PlaceLayerFeaturesCommand.ID).subscribe((c) => {
865
+ this.postboy.sub(PlaceLayerFeaturesCommand).subscribe((c) => {
735
866
  if (!this.layers.has(c.layer))
736
867
  return;
737
868
  let source = this.layers.take(c.layer).getSource();
@@ -742,7 +873,7 @@ class MapManagementService {
742
873
  });
743
874
  }
744
875
  observeRemoveLayer() {
745
- this.postboy.subscribe(RemoveLayerCommand.ID).subscribe((c) => {
876
+ this.postboy.sub(RemoveLayerCommand).subscribe((c) => {
746
877
  if (!this.map)
747
878
  return;
748
879
  this.layers.rmv(c.layer.get('name'));
@@ -750,20 +881,20 @@ class MapManagementService {
750
881
  });
751
882
  }
752
883
  observeFeaturesInArea() {
753
- this.postboy.subscribe(GetFeaturesInAreaQuery.ID).subscribe((qr) => {
884
+ this.postboy.sub(GetFeaturesInAreaQuery).subscribe((qr) => {
754
885
  let result = new Dictionary();
755
886
  this.forEachLayer((l, s) => {
756
- let features = this.postboy.execute(new FilterFeaturesInAreaExecutor(qr.area, s?.getFeatures() ?? []));
887
+ let features = this.postboy.exec(new FilterFeaturesInAreaExecutor(qr.area, s?.getFeatures() ?? []));
757
888
  result.put(l.get('name'), features.map((e) => ({ id: e.getId(), ...e.get(MapConstants.FeatureInfo) })));
758
889
  }, qr.ignore);
759
890
  qr.finish(result);
760
891
  });
761
892
  }
762
893
  observeFeaturesInPoint() {
763
- this.postboy.subscribe(GetFeaturesInPointQuery.ID).subscribe((qr) => {
894
+ this.postboy.sub(GetFeaturesInPointQuery).subscribe((qr) => {
764
895
  let result = new Dictionary();
765
896
  this.forEachLayer((l, s) => {
766
- let features = this.postboy.execute(new FilterFeaturesInPointExecutor(qr.lat, qr.lng, s?.getFeatures() ?? []));
897
+ let features = this.postboy.exec(new FilterFeaturesInPointExecutor(qr.lat, qr.lng, s?.getFeatures() ?? []));
767
898
  result.put(l.get('name'), features.map((e) => ({ id: e.getId(), ...e.get(MapConstants.FeatureInfo) })));
768
899
  }, qr.ignore);
769
900
  qr.finish(result);
@@ -807,7 +938,7 @@ class MapStateService {
807
938
  }
808
939
  observeMapRendering() {
809
940
  this.postboy
810
- .subscribe(MapRenderedEvent.ID)
941
+ .sub(MapRenderedEvent)
811
942
  .pipe(first())
812
943
  .subscribe((ev) => {
813
944
  this.map = ev.map;
@@ -817,7 +948,7 @@ class MapStateService {
817
948
  });
818
949
  }
819
950
  observeCenter() {
820
- this.postboy.subscribe(SetMapCenterCommand.ID).subscribe((c) => {
951
+ this.postboy.sub(SetMapCenterCommand).subscribe((c) => {
821
952
  this.map?.getView().setCenter([c.lng, c.lat]);
822
953
  if (c.zoom)
823
954
  this.map?.getView().setZoom(c.zoom);
@@ -843,19 +974,19 @@ class MapFeatureService {
843
974
  this.observeFitToPolygons();
844
975
  }
845
976
  observeMapRender() {
846
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
977
+ this.postboy.sub(MapRenderedEvent).subscribe((m) => {
847
978
  this.map = m.map;
848
979
  if (this.fitPolygonsWaiting)
849
980
  this.postboy.fire(this.fitPolygonsWaiting);
850
981
  });
851
982
  }
852
983
  observeFitToFeatures() {
853
- this.postboy.subscribe(FitToFeaturesCommand.ID).subscribe((cmd) => {
984
+ this.postboy.sub(FitToFeaturesCommand).subscribe((cmd) => {
854
985
  this.fitToGeometries(cmd.features.map((f) => f.getGeometry()), cmd.zoomAfter);
855
986
  });
856
987
  }
857
988
  observeFitToPolygons() {
858
- this.postboy.subscribe(FitToPolygonsCommand.ID).subscribe((cmd) => {
989
+ this.postboy.sub(FitToPolygonsCommand).subscribe((cmd) => {
859
990
  if (!this.map) {
860
991
  this.fitPolygonsWaiting = cmd;
861
992
  return;
@@ -906,7 +1037,7 @@ class MapClickService {
906
1037
  return model;
907
1038
  }
908
1039
  observeMapRender() {
909
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
1040
+ this.postboy.sub(MapRenderedEvent).subscribe((m) => {
910
1041
  this.map = m.map;
911
1042
  this.map?.on('singleclick', (e) => {
912
1043
  this.postboy.fire(this.onClick(e));
@@ -941,30 +1072,26 @@ class DrawingService {
941
1072
  this.observeMapRender();
942
1073
  }
943
1074
  observeSelectArea() {
944
- this.postboy.subscribe(DrawSelectionAreaCommand.ID).subscribe((ev) => {
945
- const drawingCommand = new StartDrawingCommand(ev.type, ev.style);
946
- drawingCommand.result.subscribe((r) => {
1075
+ this.postboy.sub(DrawSelectionAreaCommand).subscribe((ev) => {
1076
+ this.postboy.fireCallback(new StartDrawingCommand(ev.type, ev.style), (r) => {
947
1077
  if (!r) {
948
1078
  ev.finish(new Dictionary());
949
1079
  return;
950
1080
  }
951
1081
  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);
1082
+ this.postboy.fireCallback(new GetFeaturesInAreaQuery(area, ev.ignore), (result) => ev.finish(result));
955
1083
  });
956
- this.postboy.fire(drawingCommand);
957
1084
  });
958
1085
  }
959
1086
  observeDrawing() {
960
- this.postboy.subscribe(StartDrawingCommand.ID).subscribe((ev) => {
1087
+ this.postboy.sub(StartDrawingCommand).subscribe((ev) => {
961
1088
  this.draw((l) => {
962
1089
  if (!l || !this.map) {
963
1090
  this.clearInteraction(l);
964
1091
  return;
965
1092
  }
966
1093
  const cancelSub = this.observeCancelation(ev, l);
967
- this.drawInteraction = this.postboy.execute(new GenerateDrawExecutor(l, ev.style, ev.type));
1094
+ this.drawInteraction = this.postboy.exec(new GenerateDrawExecutor(l, ev.style, ev.type));
968
1095
  this.map?.addInteraction(this.drawInteraction);
969
1096
  this.drawInteraction.on('drawend', (evt) => {
970
1097
  cancelSub.unsubscribe();
@@ -980,18 +1107,16 @@ class DrawingService {
980
1107
  this.clearInteraction(layer);
981
1108
  }
982
1109
  observeMapRender() {
983
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
1110
+ this.postboy.sub(MapRenderedEvent).subscribe((m) => {
984
1111
  this.map = m.map;
985
1112
  });
986
1113
  }
987
1114
  draw(action) {
988
- const query = new GetLayerQuery(MapConstants.DrawingLayerId);
989
- query.result.subscribe((l) => action(l));
990
- this.postboy.fire(query);
1115
+ this.postboy.fireCallback(new GetLayerQuery(MapConstants.DrawingLayerId), (l) => action(l));
991
1116
  }
992
1117
  observeCancelation(ev, layer) {
993
1118
  return this.postboy
994
- .subscribe(CancelDrawingCommand.ID)
1119
+ .sub(CancelDrawingCommand)
995
1120
  .pipe(first())
996
1121
  .subscribe(() => {
997
1122
  ev.finish(null);
@@ -1025,7 +1150,7 @@ class FeatureModificationService {
1025
1150
  this.observeMapRender();
1026
1151
  }
1027
1152
  observeModification() {
1028
- this.postboy.subscribe(ModifyFeatureCommand.ID).subscribe((ev) => {
1153
+ this.postboy.sub(ModifyFeatureCommand).subscribe((ev) => {
1029
1154
  this.defineLayer((l) => {
1030
1155
  if (!l || !this.map) {
1031
1156
  this.clearInteraction(l);
@@ -1071,18 +1196,16 @@ class FeatureModificationService {
1071
1196
  : new WKT().writeFeature(command.model.feature));
1072
1197
  }
1073
1198
  observeMapRender() {
1074
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
1199
+ this.postboy.sub(MapRenderedEvent).subscribe((m) => {
1075
1200
  this.map = m.map;
1076
1201
  });
1077
1202
  }
1078
1203
  defineLayer(action) {
1079
- const query = new GetLayerQuery(MapConstants.DrawingLayerId);
1080
- query.result.subscribe((l) => action(l));
1081
- this.postboy.fire(query);
1204
+ this.postboy.fireCallback(new GetLayerQuery(MapConstants.DrawingLayerId), (l) => action(l));
1082
1205
  }
1083
1206
  observeCancelation(ev, layer) {
1084
1207
  return this.postboy
1085
- .subscribe(CancelFeatureModificationCommand.ID)
1208
+ .sub(CancelFeatureModificationCommand)
1086
1209
  .pipe(first())
1087
1210
  .subscribe(() => {
1088
1211
  ev.finish(null);
@@ -1113,7 +1236,7 @@ class ControlsService {
1113
1236
  }
1114
1237
  observeMapRender() {
1115
1238
  this.postboy
1116
- .subscribe(MapRenderedEvent.ID)
1239
+ .sub(MapRenderedEvent)
1117
1240
  .pipe(first())
1118
1241
  .subscribe((m) => {
1119
1242
  this.map = m.map;
@@ -1122,12 +1245,10 @@ class ControlsService {
1122
1245
  });
1123
1246
  }
1124
1247
  observeAdding() {
1125
- this.postboy.subscribe(AddControlCommand.ID).subscribe((c) => this.map?.addControl(c.item));
1248
+ this.postboy.sub(AddControlCommand).subscribe((c) => this.map?.addControl(c.item));
1126
1249
  }
1127
1250
  observeRemoving() {
1128
- this.postboy
1129
- .subscribe(RemoveControlCommand.ID)
1130
- .subscribe((c) => this.map?.removeControl(c.item));
1251
+ this.postboy.sub(RemoveControlCommand).subscribe((c) => this.map?.removeControl(c.item));
1131
1252
  }
1132
1253
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ControlsService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
1133
1254
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ControlsService });
@@ -1144,38 +1265,38 @@ class MessageRegistratorService extends PostboyAbstractRegistrator {
1144
1265
  this.registerServices([management, state, interaction, mapFeature, drawing, featureModification, controls]);
1145
1266
  }
1146
1267
  _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);
1268
+ this.recordReplay(MapRenderedEvent);
1269
+ this.recordReplay(PlaceLayerFeaturesCommand);
1270
+ this.recordReplay(RemoveControlCommand);
1271
+ this.recordReplay(AddControlCommand);
1272
+ this.recordReplay(SetMapCenterCommand);
1273
+ this.recordSubject(AddLayerCommand);
1274
+ this.recordSubject(RemoveLayerCommand);
1275
+ this.recordSubject(AddTileCommand);
1276
+ this.recordSubject(RemoveTileCommand);
1277
+ this.recordSubject(MapClickEvent);
1278
+ this.recordSubject(CloseTooltipCommand);
1279
+ this.recordSubject(FitToFeaturesCommand);
1280
+ this.recordSubject(FitToPolygonsCommand);
1281
+ this.recordSubject(MapMoveEndEvent);
1282
+ this.recordSubject(CancelDrawingCommand);
1283
+ this.recordSubject(StartDrawingCommand);
1284
+ this.recordSubject(GetLayerQuery);
1285
+ this.recordSubject(DrawingFinishedEvent);
1286
+ this.recordSubject(GetFeaturesInAreaQuery);
1287
+ this.recordSubject(DrawSelectionAreaCommand);
1288
+ this.recordSubject(CancelFeatureModificationCommand);
1289
+ this.recordSubject(ModifyFeatureCommand);
1290
+ this.recordSubject(GetFeaturesInPointQuery);
1170
1291
  this.setExecutors();
1171
1292
  }
1172
1293
  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());
1294
+ this.recordExecutor(FilterFeaturesInAreaExecutor, (e) => FeatureService.filterFeaturesInArea(e));
1295
+ this.recordExecutor(FilterFeaturesInPointExecutor, (e) => FeatureService.filterFeaturesInPoint(e));
1296
+ this.recordExecutor(CalculateAreaExecutor, (e) => FeatureService.calculateArea(e.polygon?.feature?.getGeometry()));
1297
+ this.recordExecutor(GenerateDrawExecutor, (e) => DrawingGenerationService.getDraw(e));
1298
+ this.recordExecutor(GenerateZoomControlExecutor, (e) => ZoomControlFactory.build(e.settings));
1299
+ this.recordExecutor(GetMapPositionExecutor, () => this.state.getMapPosition());
1179
1300
  }
1180
1301
  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
1302
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MessageRegistratorService });
@@ -1404,7 +1525,7 @@ class TileLayerComponent extends DestructibleComponent {
1404
1525
  }
1405
1526
  ngOnInit() {
1406
1527
  this.postboy
1407
- .subscribe(MapRenderedEvent.ID)
1528
+ .sub(MapRenderedEvent)
1408
1529
  .pipe(filter((m) => !!m), first())
1409
1530
  .subscribe((m) => this.initLayer());
1410
1531
  }
@@ -1633,7 +1754,7 @@ class FeatureLayerComponent extends DestructibleComponent {
1633
1754
  }
1634
1755
  ngOnInit() {
1635
1756
  this.postboy
1636
- .subscribe(MapRenderedEvent.ID)
1757
+ .sub(MapRenderedEvent)
1637
1758
  .pipe(filter((m) => !!m), first())
1638
1759
  .subscribe((m) => this.initLayer());
1639
1760
  }
@@ -1814,14 +1935,14 @@ class ClusterLayerManager {
1814
1935
  }
1815
1936
  observeMapMovement() {
1816
1937
  combineLatest([
1817
- this.postboy.subscribe(MapMoveEndEvent.ID).pipe(auditTime(250)),
1818
- this.postboy.subscribe(MapRenderedEvent.ID),
1938
+ this.postboy.sub(MapMoveEndEvent).pipe(auditTime(250)),
1939
+ this.postboy.sub(MapRenderedEvent),
1819
1940
  ]).subscribe(([movement, renderEvent]) => {
1820
1941
  this.checkClusterNecessity(renderEvent.map);
1821
1942
  });
1822
1943
  }
1823
1944
  observeClick() {
1824
- this.postboy.subscribe(MapClickEvent.ID).subscribe((m) => {
1945
+ this.postboy.sub(MapClickEvent).subscribe((m) => {
1825
1946
  if ((m.features[this.settings.name]?.length ?? 0) > 1) {
1826
1947
  this.postboy.fire(new FitToFeaturesCommand(m.features[this.settings.name], -1));
1827
1948
  }
@@ -1910,7 +2031,7 @@ class ClusterLayerComponent extends DestructibleComponent {
1910
2031
  }
1911
2032
  ngOnInit() {
1912
2033
  this.postboy
1913
- .subscribe(MapRenderedEvent.ID)
2034
+ .sub(MapRenderedEvent)
1914
2035
  .pipe(filter((m) => !!m), first())
1915
2036
  .subscribe((m) => this.initLayer());
1916
2037
  }
@@ -2059,7 +2180,7 @@ class MarkersComponent extends DestructibleComponent {
2059
2180
  }
2060
2181
  ngOnInit() {
2061
2182
  this.postboy
2062
- .subscribe(MapRenderedEvent.ID)
2183
+ .sub(MapRenderedEvent)
2063
2184
  .pipe(filter((m) => !!m), first())
2064
2185
  .subscribe(() => this.putMarkers());
2065
2186
  }
@@ -2150,18 +2271,18 @@ class TooltipComponent extends DestructibleComponent {
2150
2271
  };
2151
2272
  };
2152
2273
  observeMapClick() {
2153
- return this.postboy.subscribe(MapClickEvent.ID).subscribe((ev) => {
2274
+ return this.postboy.sub(MapClickEvent).subscribe((ev) => {
2154
2275
  this._settings.show(ev) ? this.addOverlay(ev.coordinates) : this.removeOverlay();
2155
2276
  });
2156
2277
  }
2157
2278
  observeClose() {
2158
2279
  return this.postboy
2159
- .subscribe(CloseTooltipCommand.ID)
2280
+ .sub(CloseTooltipCommand)
2160
2281
  .pipe(filter((ev) => ev.tooltipId === this._settings.id))
2161
2282
  .subscribe(() => this.removeOverlay());
2162
2283
  }
2163
2284
  observeMapRender() {
2164
- return this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
2285
+ return this.postboy.sub(MapRenderedEvent).subscribe((m) => {
2165
2286
  this.map = m.map;
2166
2287
  });
2167
2288
  }
@@ -2206,7 +2327,7 @@ class PolygonsComponent extends DestructibleComponent {
2206
2327
  }
2207
2328
  ngOnInit() {
2208
2329
  this.postboy
2209
- .subscribe(MapRenderedEvent.ID)
2330
+ .sub(MapRenderedEvent)
2210
2331
  .pipe(filter((m) => !!m), first())
2211
2332
  .subscribe(() => this.putPolygons());
2212
2333
  }
@@ -2377,7 +2498,7 @@ class MapControlZoomComponent extends DestructibleComponent {
2377
2498
  }
2378
2499
  ngOnInit() {
2379
2500
  this.postboy
2380
- .subscribe(MapRenderedEvent.ID)
2501
+ .sub(MapRenderedEvent)
2381
2502
  .pipe(filter((m) => !!m), first())
2382
2503
  .subscribe((m) => {
2383
2504
  this.map = m.map;
@@ -2390,7 +2511,7 @@ class MapControlZoomComponent extends DestructibleComponent {
2390
2511
  setControl() {
2391
2512
  if (!this.map)
2392
2513
  return;
2393
- this.control = this.postboy.execute(new GenerateZoomControlExecutor(this._settings));
2514
+ this.control = this.postboy.exec(new GenerateZoomControlExecutor(this._settings));
2394
2515
  this.map.addControl(this.control);
2395
2516
  }
2396
2517
  eliminate = () => !!this.map && !!this.control && this.map.removeControl(this.control);