@artstesh/maps 4.1.14 → 4.1.15

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 (180) hide show
  1. package/dist/esm2020/map/map-plate/controls/map-control-zoom/map-control-zoom.component.mjs +3 -3
  2. package/dist/esm2020/map/map-plate/features/markers/markers.component.mjs +2 -2
  3. package/dist/esm2020/map/map-plate/features/polygons/polygons.component.mjs +2 -2
  4. package/dist/esm2020/map/map-plate/layers/cluster-layer/cluster-layer.component.mjs +2 -2
  5. package/dist/esm2020/map/map-plate/layers/cluster-layer/cluster-layer.manager.mjs +4 -4
  6. package/dist/esm2020/map/map-plate/layers/feature-layer/feature-layer.component.mjs +2 -2
  7. package/dist/esm2020/map/map-plate/layers/tile-layer/tile-layer.component.mjs +2 -2
  8. package/dist/esm2020/map/map-plate/tooltips/tooltip/tooltip.component.mjs +4 -4
  9. package/dist/esm2020/map/messages/commands/add-control.command.mjs +9 -5
  10. package/dist/esm2020/map/messages/commands/add-layer.command.mjs +1 -5
  11. package/dist/esm2020/map/messages/commands/add-tile.command.mjs +1 -5
  12. package/dist/esm2020/map/messages/commands/cancel-drawing.command.mjs +4 -5
  13. package/dist/esm2020/map/messages/commands/cancel-feature-modification.command.mjs +4 -5
  14. package/dist/esm2020/map/messages/commands/close-tooltip.command.mjs +9 -5
  15. package/dist/esm2020/map/messages/commands/draw-selection-area.command.mjs +13 -5
  16. package/dist/esm2020/map/messages/commands/fit-to-features.command.mjs +1 -5
  17. package/dist/esm2020/map/messages/commands/fit-to-polygons.command.mjs +11 -5
  18. package/dist/esm2020/map/messages/commands/modify-feature.command.mjs +14 -5
  19. package/dist/esm2020/map/messages/commands/place-layer-features.command.mjs +1 -5
  20. package/dist/esm2020/map/messages/commands/remove-control.command.mjs +14 -5
  21. package/dist/esm2020/map/messages/commands/remove-layer.command.mjs +1 -5
  22. package/dist/esm2020/map/messages/commands/remove-tile.command.mjs +1 -5
  23. package/dist/esm2020/map/messages/commands/set-map-center.command.mjs +1 -5
  24. package/dist/esm2020/map/messages/commands/start-drawing.command.mjs +11 -5
  25. package/dist/esm2020/map/messages/events/drawing-finished.event.mjs +1 -8
  26. package/dist/esm2020/map/messages/events/map-click.event.mjs +14 -5
  27. package/dist/esm2020/map/messages/events/map-move-end.event.mjs +7 -5
  28. package/dist/esm2020/map/messages/events/map-rendered.event.mjs +9 -5
  29. package/dist/esm2020/map/messages/executors/calculate-area.executor.mjs +8 -5
  30. package/dist/esm2020/map/messages/executors/filter-features-in-area.executor.mjs +9 -5
  31. package/dist/esm2020/map/messages/executors/filter-features-in-point.executor.mjs +13 -6
  32. package/dist/esm2020/map/messages/executors/generate-draw.executor.mjs +1 -5
  33. package/dist/esm2020/map/messages/executors/generate-zoom-control.executor.mjs +1 -5
  34. package/dist/esm2020/map/messages/executors/get-map-position.executor.mjs +1 -4
  35. package/dist/esm2020/map/messages/index.mjs +8 -8
  36. package/dist/esm2020/map/messages/queries/get-features-in-area.query.mjs +11 -5
  37. package/dist/esm2020/map/messages/queries/get-features-in-point.query.mjs +8 -5
  38. package/dist/esm2020/map/messages/queries/get-layer.query.mjs +1 -5
  39. package/dist/esm2020/map/models/drawing-type.enum.mjs +14 -1
  40. package/dist/esm2020/map/models/feature-format.enum.mjs +9 -1
  41. package/dist/esm2020/map/models/map-position.model.mjs +1 -1
  42. package/dist/esm2020/map/models/map-settings.mjs +47 -1
  43. package/dist/esm2020/map/services/controls/controls.service.mjs +4 -6
  44. package/dist/esm2020/map/services/drawing/drawing.service.mjs +9 -15
  45. package/dist/esm2020/map/services/drawing/feature-modification.service.mjs +5 -7
  46. package/dist/esm2020/map/services/map-click.service.mjs +2 -2
  47. package/dist/esm2020/map/services/map-feature.service.mjs +4 -4
  48. package/dist/esm2020/map/services/map-management.service.mjs +12 -12
  49. package/dist/esm2020/map/services/map-postboy.service.mjs +6 -2
  50. package/dist/esm2020/map/services/map-state.service.mjs +3 -3
  51. package/dist/esm2020/map/services/message-registrator.service.mjs +30 -30
  52. package/dist/esm2020/src/map/map-plate/controls/map-control-zoom/map-control-zoom.component.mjs +3 -3
  53. package/dist/esm2020/src/map/map-plate/features/markers/markers.component.mjs +2 -2
  54. package/dist/esm2020/src/map/map-plate/features/polygons/polygons.component.mjs +2 -2
  55. package/dist/esm2020/src/map/map-plate/layers/cluster-layer/cluster-layer.component.mjs +2 -2
  56. package/dist/esm2020/src/map/map-plate/layers/cluster-layer/cluster-layer.manager.mjs +4 -4
  57. package/dist/esm2020/src/map/map-plate/layers/feature-layer/feature-layer.component.mjs +2 -2
  58. package/dist/esm2020/src/map/map-plate/layers/tile-layer/tile-layer.component.mjs +2 -2
  59. package/dist/esm2020/src/map/map-plate/tooltips/tooltip/tooltip.component.mjs +4 -4
  60. package/dist/esm2020/src/map/messages/commands/add-control.command.mjs +9 -5
  61. package/dist/esm2020/src/map/messages/commands/add-layer.command.mjs +1 -5
  62. package/dist/esm2020/src/map/messages/commands/add-tile.command.mjs +1 -5
  63. package/dist/esm2020/src/map/messages/commands/cancel-drawing.command.mjs +4 -5
  64. package/dist/esm2020/src/map/messages/commands/cancel-feature-modification.command.mjs +4 -5
  65. package/dist/esm2020/src/map/messages/commands/close-tooltip.command.mjs +9 -5
  66. package/dist/esm2020/src/map/messages/commands/draw-selection-area.command.mjs +13 -5
  67. package/dist/esm2020/src/map/messages/commands/fit-to-features.command.mjs +1 -5
  68. package/dist/esm2020/src/map/messages/commands/fit-to-polygons.command.mjs +11 -5
  69. package/dist/esm2020/src/map/messages/commands/modify-feature.command.mjs +14 -5
  70. package/dist/esm2020/src/map/messages/commands/place-layer-features.command.mjs +1 -5
  71. package/dist/esm2020/src/map/messages/commands/remove-control.command.mjs +14 -5
  72. package/dist/esm2020/src/map/messages/commands/remove-layer.command.mjs +1 -5
  73. package/dist/esm2020/src/map/messages/commands/remove-tile.command.mjs +1 -5
  74. package/dist/esm2020/src/map/messages/commands/set-map-center.command.mjs +1 -5
  75. package/dist/esm2020/src/map/messages/commands/start-drawing.command.mjs +11 -5
  76. package/dist/esm2020/src/map/messages/events/drawing-finished.event.mjs +1 -8
  77. package/dist/esm2020/src/map/messages/events/map-click.event.mjs +14 -5
  78. package/dist/esm2020/src/map/messages/events/map-move-end.event.mjs +7 -5
  79. package/dist/esm2020/src/map/messages/events/map-rendered.event.mjs +9 -5
  80. package/dist/esm2020/src/map/messages/executors/calculate-area.executor.mjs +8 -5
  81. package/dist/esm2020/src/map/messages/executors/filter-features-in-area.executor.mjs +9 -5
  82. package/dist/esm2020/src/map/messages/executors/filter-features-in-point.executor.mjs +13 -6
  83. package/dist/esm2020/src/map/messages/executors/generate-draw.executor.mjs +1 -5
  84. package/dist/esm2020/src/map/messages/executors/generate-zoom-control.executor.mjs +1 -5
  85. package/dist/esm2020/src/map/messages/executors/get-map-position.executor.mjs +1 -4
  86. package/dist/esm2020/src/map/messages/index.mjs +8 -8
  87. package/dist/esm2020/src/map/messages/queries/get-features-in-area.query.mjs +11 -5
  88. package/dist/esm2020/src/map/messages/queries/get-features-in-point.query.mjs +8 -5
  89. package/dist/esm2020/src/map/messages/queries/get-layer.query.mjs +1 -5
  90. package/dist/esm2020/src/map/models/drawing-type.enum.mjs +14 -1
  91. package/dist/esm2020/src/map/models/feature-format.enum.mjs +9 -1
  92. package/dist/esm2020/src/map/models/map-position.model.mjs +1 -1
  93. package/dist/esm2020/src/map/models/map-settings.mjs +47 -1
  94. package/dist/esm2020/src/map/services/controls/controls.service.mjs +4 -6
  95. package/dist/esm2020/src/map/services/drawing/drawing.service.mjs +9 -15
  96. package/dist/esm2020/src/map/services/drawing/feature-modification.service.mjs +5 -7
  97. package/dist/esm2020/src/map/services/map-click.service.mjs +2 -2
  98. package/dist/esm2020/src/map/services/map-feature.service.mjs +4 -4
  99. package/dist/esm2020/src/map/services/map-management.service.mjs +12 -12
  100. package/dist/esm2020/src/map/services/map-postboy.service.mjs +6 -2
  101. package/dist/esm2020/src/map/services/map-state.service.mjs +3 -3
  102. package/dist/esm2020/src/map/services/message-registrator.service.mjs +30 -30
  103. package/dist/fesm2015/maps-components-src-map.mjs +368 -275
  104. package/dist/fesm2015/maps-components-src-map.mjs.map +1 -1
  105. package/dist/fesm2015/maps-components.mjs +368 -275
  106. package/dist/fesm2015/maps-components.mjs.map +1 -1
  107. package/dist/fesm2020/maps-components-src-map.mjs +368 -275
  108. package/dist/fesm2020/maps-components-src-map.mjs.map +1 -1
  109. package/dist/fesm2020/maps-components.mjs +368 -275
  110. package/dist/fesm2020/maps-components.mjs.map +1 -1
  111. package/dist/map/messages/commands/add-control.command.d.ts +8 -2
  112. package/dist/map/messages/commands/add-layer.command.d.ts +0 -2
  113. package/dist/map/messages/commands/add-tile.command.d.ts +0 -2
  114. package/dist/map/messages/commands/cancel-drawing.command.d.ts +3 -2
  115. package/dist/map/messages/commands/cancel-feature-modification.command.d.ts +3 -2
  116. package/dist/map/messages/commands/close-tooltip.command.d.ts +8 -2
  117. package/dist/map/messages/commands/draw-selection-area.command.d.ts +12 -2
  118. package/dist/map/messages/commands/fit-to-features.command.d.ts +0 -2
  119. package/dist/map/messages/commands/fit-to-polygons.command.d.ts +10 -2
  120. package/dist/map/messages/commands/modify-feature.command.d.ts +13 -2
  121. package/dist/map/messages/commands/place-layer-features.command.d.ts +0 -2
  122. package/dist/map/messages/commands/remove-control.command.d.ts +13 -2
  123. package/dist/map/messages/commands/remove-layer.command.d.ts +0 -2
  124. package/dist/map/messages/commands/remove-tile.command.d.ts +0 -2
  125. package/dist/map/messages/commands/set-map-center.command.d.ts +0 -2
  126. package/dist/map/messages/commands/start-drawing.command.d.ts +10 -2
  127. package/dist/map/messages/events/drawing-finished.event.d.ts +0 -3
  128. package/dist/map/messages/events/map-click.event.d.ts +13 -2
  129. package/dist/map/messages/events/map-move-end.event.d.ts +6 -2
  130. package/dist/map/messages/events/map-rendered.event.d.ts +8 -2
  131. package/dist/map/messages/executors/calculate-area.executor.d.ts +7 -2
  132. package/dist/map/messages/executors/filter-features-in-area.executor.d.ts +8 -2
  133. package/dist/map/messages/executors/filter-features-in-point.executor.d.ts +12 -3
  134. package/dist/map/messages/executors/generate-draw.executor.d.ts +0 -2
  135. package/dist/map/messages/executors/generate-zoom-control.executor.d.ts +0 -2
  136. package/dist/map/messages/executors/get-map-position.executor.d.ts +0 -1
  137. package/dist/map/messages/index.d.ts +7 -7
  138. package/dist/map/messages/queries/get-features-in-area.query.d.ts +10 -2
  139. package/dist/map/messages/queries/get-features-in-point.query.d.ts +7 -2
  140. package/dist/map/messages/queries/get-layer.query.d.ts +0 -2
  141. package/dist/map/models/drawing-type.enum.d.ts +13 -0
  142. package/dist/map/models/feature-format.enum.d.ts +8 -0
  143. package/dist/map/models/map-position.model.d.ts +12 -0
  144. package/dist/map/models/map-settings.d.ts +46 -0
  145. package/dist/package.json +1 -1
  146. package/dist/src/map/messages/commands/add-control.command.d.ts +8 -2
  147. package/dist/src/map/messages/commands/add-layer.command.d.ts +0 -2
  148. package/dist/src/map/messages/commands/add-tile.command.d.ts +0 -2
  149. package/dist/src/map/messages/commands/cancel-drawing.command.d.ts +3 -2
  150. package/dist/src/map/messages/commands/cancel-feature-modification.command.d.ts +3 -2
  151. package/dist/src/map/messages/commands/close-tooltip.command.d.ts +8 -2
  152. package/dist/src/map/messages/commands/draw-selection-area.command.d.ts +12 -2
  153. package/dist/src/map/messages/commands/fit-to-features.command.d.ts +0 -2
  154. package/dist/src/map/messages/commands/fit-to-polygons.command.d.ts +10 -2
  155. package/dist/src/map/messages/commands/modify-feature.command.d.ts +13 -2
  156. package/dist/src/map/messages/commands/place-layer-features.command.d.ts +0 -2
  157. package/dist/src/map/messages/commands/remove-control.command.d.ts +13 -2
  158. package/dist/src/map/messages/commands/remove-layer.command.d.ts +0 -2
  159. package/dist/src/map/messages/commands/remove-tile.command.d.ts +0 -2
  160. package/dist/src/map/messages/commands/set-map-center.command.d.ts +0 -2
  161. package/dist/src/map/messages/commands/start-drawing.command.d.ts +10 -2
  162. package/dist/src/map/messages/events/drawing-finished.event.d.ts +0 -3
  163. package/dist/src/map/messages/events/map-click.event.d.ts +13 -2
  164. package/dist/src/map/messages/events/map-move-end.event.d.ts +6 -2
  165. package/dist/src/map/messages/events/map-rendered.event.d.ts +8 -2
  166. package/dist/src/map/messages/executors/calculate-area.executor.d.ts +7 -2
  167. package/dist/src/map/messages/executors/filter-features-in-area.executor.d.ts +8 -2
  168. package/dist/src/map/messages/executors/filter-features-in-point.executor.d.ts +12 -3
  169. package/dist/src/map/messages/executors/generate-draw.executor.d.ts +0 -2
  170. package/dist/src/map/messages/executors/generate-zoom-control.executor.d.ts +0 -2
  171. package/dist/src/map/messages/executors/get-map-position.executor.d.ts +0 -1
  172. package/dist/src/map/messages/index.d.ts +7 -7
  173. package/dist/src/map/messages/queries/get-features-in-area.query.d.ts +10 -2
  174. package/dist/src/map/messages/queries/get-features-in-point.query.d.ts +7 -2
  175. package/dist/src/map/messages/queries/get-layer.query.d.ts +0 -2
  176. package/dist/src/map/models/drawing-type.enum.d.ts +13 -0
  177. package/dist/src/map/models/feature-format.enum.d.ts +8 -0
  178. package/dist/src/map/models/map-position.model.d.ts +12 -0
  179. package/dist/src/map/models/map-settings.d.ts +46 -0
  180. package/package.json +13 -13
@@ -65,6 +65,10 @@ MapLyrsLabel.lyrs = {
65
65
  [MapLyrs.Terrain]: 'p',
66
66
  };
67
67
 
68
+ /**
69
+ * Represents the configurable settings for a map instance, providing
70
+ * options for center coordinates, zoom levels, map layers, and language.
71
+ */
68
72
  class MapSettings {
69
73
  constructor() {
70
74
  this.center = [0, 0];
@@ -84,24 +88,66 @@ class MapSettings {
84
88
  result.language = model.language;
85
89
  return result;
86
90
  }
91
+ /**
92
+ * Sets the center for the map settings.
93
+ *
94
+ * @param {number[]} center - A two-element array representing the latitude and longitude of the map's center.
95
+ * @return {MapSettings} A new MapSettings object with the updated center.
96
+ */
87
97
  setCenter(center) {
88
98
  return MapSettings.copy({ ...this, center });
89
99
  }
100
+ /**
101
+ * Sets the maximum zoom level for the map.
102
+ *
103
+ * @param {number} maxZoom - The maximum zoom level to be set.
104
+ * @return {MapSettings} A new instance of MapSettings with the updated maximum zoom level.
105
+ */
90
106
  setMaxZoom(maxZoom) {
91
107
  return MapSettings.copy({ ...this, maxZoom });
92
108
  }
109
+ /**
110
+ * Sets the minimum zoom level for the map settings.
111
+ *
112
+ * @param {number} minZoom The minimum zoom level to be set. Must be a valid numeric value.
113
+ * @return {MapSettings} A new MapSettings object with the updated minimum zoom level.
114
+ */
93
115
  setMinZoom(minZoom) {
94
116
  return MapSettings.copy({ ...this, minZoom });
95
117
  }
118
+ /**
119
+ * Adjusts the zoom level of the map by setting the specified value.
120
+ *
121
+ * @param {number} zoom - The desired zoom level to be set.
122
+ * @return {MapSettings} A new MapSettings instance with the updated zoom level.
123
+ */
96
124
  setZoom(zoom) {
97
125
  return MapSettings.copy({ ...this, zoom });
98
126
  }
127
+ /**
128
+ * Sets the layers in the map settings with the provided layers.
129
+ *
130
+ * @param {MapLyrs} lyrs - The layers to be set in the map settings.
131
+ * @return {MapSettings} A new instance of MapSettings with the updated layers.
132
+ */
99
133
  setLyrs(lyrs) {
100
134
  return MapSettings.copy({ ...this, lyrs });
101
135
  }
136
+ /**
137
+ * Updates the language setting for the map configuration and returns a new instance with the updated language.
138
+ *
139
+ * @param {string} language - The language to be set for the map configuration.
140
+ * @return {MapSettings} A new instance of MapSettings with the updated language.
141
+ */
102
142
  setLanguage(language) {
103
143
  return MapSettings.copy({ ...this, language });
104
144
  }
145
+ /**
146
+ * Compares the current MapSettings instance with another to determine if they are identical.
147
+ *
148
+ * @param {MapSettings} model - The MapSettings instance to compare with the current instance.
149
+ * @return {boolean} Returns true if both MapSettings instances have the same properties and values; otherwise, false.
150
+ */
105
151
  isSame(model) {
106
152
  if (this.maxZoom !== model.maxZoom)
107
153
  return false;
@@ -180,6 +226,19 @@ class PolygonModel {
180
226
  }
181
227
  }
182
228
 
229
+ /**
230
+ * Enum representing various drawing types.
231
+ *
232
+ * This enumeration is used to define the types of drawable shapes
233
+ * within a specific drawing context. Each member corresponds to
234
+ * a specific type of drawing.
235
+ *
236
+ * Members:
237
+ * - `Polygon`: Represents a polygonal shape (e.g., triangle, pentagon, etc.).
238
+ * - `Circle`: Represents a circular shape.
239
+ * - `Square`: Represents a square shape.
240
+ * - `Box`: Represents a rectangular box shape.
241
+ */
183
242
  var DrawingType;
184
243
  (function (DrawingType) {
185
244
  DrawingType[DrawingType["Polygon"] = 1] = "Polygon";
@@ -188,6 +247,14 @@ var DrawingType;
188
247
  DrawingType[DrawingType["Box"] = 4] = "Box";
189
248
  })(DrawingType || (DrawingType = {}));
190
249
 
250
+ /**
251
+ * An enumeration representing different formats for feature outputs.
252
+ * This can be used to specify the desired output format when dealing with geospatial data.
253
+ *
254
+ * Enumerators:
255
+ * - GeoJson: Represents the GeoJSON format for geospatial data.
256
+ * - WKT: Represents the Well-Known Text (WKT) format for geospatial data.
257
+ */
191
258
  var FeatureOutputFormat;
192
259
  (function (FeatureOutputFormat) {
193
260
  FeatureOutputFormat[FeatureOutputFormat["GeoJson"] = 1] = "GeoJson";
@@ -208,126 +275,129 @@ class MapControl extends Control {
208
275
  }
209
276
  }
210
277
 
211
- class MapRenderedEvent extends PostboyGenericMessage {
212
- constructor(map) {
213
- super();
214
- this.map = map;
215
- }
216
- get id() {
217
- return MapRenderedEvent.ID;
218
- }
219
- }
220
- MapRenderedEvent.ID = 'b6121807-3b89-4cd3-82cf-089d2cefdc4f';
221
-
222
- class MapClickEvent extends PostboyGenericMessage {
223
- constructor(coordinates, entities, features) {
224
- super();
225
- this.coordinates = coordinates;
226
- this.entities = entities;
227
- this.features = features;
228
- }
229
- get id() {
230
- return MapClickEvent.ID;
231
- }
232
- }
233
- MapClickEvent.ID = '323df526-8d9c-49c6-83e8-6e9a1e7762f7';
234
-
235
- class MapMoveEndEvent extends PostboyGenericMessage {
236
- constructor(position) {
278
+ /**
279
+ * Represents a command to add a custom control to a map.
280
+ */
281
+ class AddControlCommand extends PostboyGenericMessage {
282
+ /**
283
+ * Creates an instance of the class with the specified MapControl object.
284
+ *
285
+ * @param {MapControl} item - The MapControl object to be associated with the instance.
286
+ */
287
+ constructor(item) {
237
288
  super();
238
- this.position = position;
239
- }
240
- get id() {
241
- return MapMoveEndEvent.ID;
289
+ this.item = item;
242
290
  }
243
- }
244
- MapMoveEndEvent.ID = 'f21f783e-b5af-4489-9fec-8027fd07a8ad';
291
+ }
245
292
 
293
+ /**
294
+ * A command class that represents the action to close a tooltip.
295
+ */
246
296
  class CloseTooltipCommand extends PostboyGenericMessage {
297
+ /**
298
+ * Creates an instance of the class with the specified tooltip ID.
299
+ *
300
+ * @param {string} tooltipId - The unique identifier for the tooltip.
301
+ */
247
302
  constructor(tooltipId) {
248
303
  super();
249
304
  this.tooltipId = tooltipId;
250
305
  }
251
- get id() {
252
- return CloseTooltipCommand.ID;
253
- }
254
- }
255
- CloseTooltipCommand.ID = '4896d52c-e34f-4994-bcfd-32832d12dbe4';
306
+ }
256
307
 
308
+ /**
309
+ * Represents a command to start a drawing operation.
310
+ */
257
311
  class StartDrawingCommand extends PostboyCallbackMessage {
312
+ /**
313
+ * Constructor for creating an instance of the class that represents a drawing feature with specific type, style, and output format.
314
+ *
315
+ * @param {DrawingType} type - The type of the drawing to be created.
316
+ * @param {Style} style - The style defining visual appearance of the drawing.
317
+ * @param {FeatureOutputFormat} [format=FeatureOutputFormat.GeoJson] - The format of the feature output. Defaults to GeoJson.
318
+ */
258
319
  constructor(type, style, format = FeatureOutputFormat.GeoJson) {
259
320
  super();
260
321
  this.type = type;
261
322
  this.style = style;
262
323
  this.format = format;
263
324
  }
264
- get id() {
265
- return StartDrawingCommand.ID;
266
- }
267
- }
268
- StartDrawingCommand.ID = 'da904f4b-a1c8-4db7-a6af-14d9ee18ec8c';
325
+ }
269
326
 
327
+ /**
328
+ * Represents a command to cancel a drawing action.
329
+ */
270
330
  class CancelDrawingCommand extends PostboyGenericMessage {
271
- get id() {
272
- return CancelDrawingCommand.ID;
273
- }
274
- }
275
- CancelDrawingCommand.ID = '7d38d983-feba-4176-a66b-18175e5ecd6b';
331
+ }
276
332
 
333
+ /**
334
+ * Class representing a command to draw a selection area with a specific type and style.
335
+ *
336
+ * @return {Dictionary<IIdentified[]>} - a collection of features inside the selected area, grouped by a layer's name
337
+ */
277
338
  class DrawSelectionAreaCommand extends PostboyCallbackMessage {
339
+ /**
340
+ * Constructs a new instance with the specified type, style, and optional set of ignored items.
341
+ *
342
+ * @param {DrawingType} type - The type of drawing to be created.
343
+ * @param {Style} style - The style information for the drawing.
344
+ * @param {Set<string>} [ignore=new Set<string>()] - Optional set of items to be ignored.
345
+ */
278
346
  constructor(type, style, ignore = new Set()) {
279
347
  super();
280
348
  this.type = type;
281
349
  this.style = style;
282
350
  this.ignore = ignore;
283
351
  }
284
- get id() {
285
- return DrawSelectionAreaCommand.ID;
286
- }
287
- }
288
- DrawSelectionAreaCommand.ID = '573d8a0d-f25b-42b7-9ad7-0ac6d86ac362';
352
+ }
289
353
 
354
+ /**
355
+ * Represents a command to modify a feature with a specific style and output format
356
+ * for a polygonal model.
357
+ *
358
+ * @return {string | null} a string representation of the modified feature in the appropriate format
359
+ */
290
360
  class ModifyFeatureCommand extends PostboyCallbackMessage {
361
+ /**
362
+ * Constructs an instance of the class.
363
+ *
364
+ * @param {PolygonModel} model - The polygon model to be used.
365
+ * @param {Style} style - The style configuration for the polygon.
366
+ * @param {FeatureOutputFormat} [format=FeatureOutputFormat.GeoJson] - The output format of the features. Default is GeoJson.
367
+ */
291
368
  constructor(model, style, format = FeatureOutputFormat.GeoJson) {
292
369
  super();
293
370
  this.model = model;
294
371
  this.style = style;
295
372
  this.format = format;
296
373
  }
297
- get id() {
298
- return ModifyFeatureCommand.ID;
299
- }
300
- }
301
- ModifyFeatureCommand.ID = 'ead85caa-24c6-4844-a68c-2cea91774c8c';
374
+ }
302
375
 
376
+ /**
377
+ * Represents a command to cancel a feature modification.
378
+ */
303
379
  class CancelFeatureModificationCommand extends PostboyGenericMessage {
304
- get id() {
305
- return CancelFeatureModificationCommand.ID;
306
- }
307
- }
308
- CancelFeatureModificationCommand.ID = '9c9fb40f-ea95-4704-8177-0e9ecabf36fa';
309
-
310
- class AddControlCommand extends PostboyGenericMessage {
311
- constructor(item) {
312
- super();
313
- this.item = item;
314
- }
315
- get id() {
316
- return AddControlCommand.ID;
317
- }
318
- }
319
- AddControlCommand.ID = '8e1c06eb-b395-4fe1-929c-ebf0805eeb49';
380
+ }
320
381
 
382
+ /**
383
+ * Represents a command to remove a map control from the map.
384
+ *
385
+ * The command is identified by a unique static ID, and it requires a MapControl item
386
+ * to specify the control to be removed.
387
+ *
388
+ * @extends PostboyGenericMessage
389
+ */
321
390
  class RemoveControlCommand extends PostboyGenericMessage {
391
+ /**
392
+ * Constructs an instance of the class.
393
+ *
394
+ * @param {MapControl} item - The map control instance to be removed.
395
+ */
322
396
  constructor(item) {
323
397
  super();
324
398
  this.item = item;
325
399
  }
326
- get id() {
327
- return RemoveControlCommand.ID;
328
- }
329
- }
330
- RemoveControlCommand.ID = '361641e0-804a-4930-8c27-0cea6330dbfc';
400
+ }
331
401
 
332
402
  /**
333
403
  * Forces map to move to a specific point
@@ -345,34 +415,128 @@ class SetMapCenterCommand extends PostboyGenericMessage {
345
415
  this.lng = lng;
346
416
  this.zoom = zoom;
347
417
  }
348
- get id() {
349
- return SetMapCenterCommand.ID;
418
+ }
419
+
420
+ /**
421
+ * FitToPolygonsCommand is a command used to fit a given set of polygon features
422
+ * to the viewable area, optionally applying a zoom transformation afterwards.
423
+ */
424
+ class FitToPolygonsCommand extends PostboyGenericMessage {
425
+ /**
426
+ * Creates an instance of the class with specified polygon features and an optional zoom level.
427
+ *
428
+ * @param {PolygonModel[]} features - An array of polygon models to fit to.
429
+ * @param {number} [zoomAfter=0] - Optional zoom level change to apply after initialization. Defaults to 0.
430
+ */
431
+ constructor(features, zoomAfter = 0) {
432
+ super();
433
+ this.features = features;
434
+ this.zoomAfter = zoomAfter;
350
435
  }
351
- }
352
- SetMapCenterCommand.ID = 'd50e89c9-6707-4f8c-ab57-65fcef232182';
436
+ }
353
437
 
354
- class CalculateAreaExecutor extends PostboyExecutor {
355
- constructor(polygon) {
438
+ /**
439
+ * Represents an event triggered when a map rendering process is completed.
440
+ */
441
+ class MapRenderedEvent extends PostboyGenericMessage {
442
+ /**
443
+ * Constructor for creating an instance of the class.
444
+ *
445
+ * @param {Map} map - The map instance to be used by the class.
446
+ */
447
+ constructor(map) {
356
448
  super();
357
- this.polygon = polygon;
449
+ this.map = map;
358
450
  }
359
- get id() {
360
- return CalculateAreaExecutor.ID;
451
+ }
452
+
453
+ /**
454
+ * Represents an event triggered by a click on a map, containing information about the
455
+ * click's location, relevant entities, and features present at the clicked position.
456
+ *
457
+ * @extends {PostboyGenericMessage}
458
+ */
459
+ class MapClickEvent extends PostboyGenericMessage {
460
+ /**
461
+ * Creates an instance of this class with the provided coordinates, entities, and features.
462
+ *
463
+ * @param {number[]} coordinates - An array representing the coordinates.
464
+ * @param {{ [layer: string]: IIdentified[] }} entities - A mapping of layer names to arrays of IIdentified entities.
465
+ * @param {{ [layer: string]: Feature<Geometry>[] }} features - A mapping of layer names to arrays of features with geometry.
466
+ */
467
+ constructor(coordinates, entities, features) {
468
+ super();
469
+ this.coordinates = coordinates;
470
+ this.entities = entities;
471
+ this.features = features;
361
472
  }
362
- }
363
- CalculateAreaExecutor.ID = '172ecf46-86b5-4f46-a5f1-96ba2cbb1694';
473
+ }
364
474
 
365
- class FitToPolygonsCommand extends PostboyGenericMessage {
366
- constructor(features, zoomAfter = 0) {
475
+ /**
476
+ * Represents an event that is triggered when the movement of a map ends.
477
+ * This class is used to capture the final position of a map after a movement operation.
478
+ *
479
+ * @property {MapPosition | null} position - The final position of the map after movement ends. Can be null.
480
+ */
481
+ class MapMoveEndEvent extends PostboyGenericMessage {
482
+ constructor(position) {
367
483
  super();
484
+ this.position = position;
485
+ }
486
+ }
487
+
488
+ /**
489
+ * A class responsible for executing filtering of geographical features
490
+ * based on a specific geographical point (latitude and longitude).
491
+ *
492
+ * @template Feature - A geographical feature that is processed by the executor.
493
+ * @template Geometry - The type of geometry associated with the feature.
494
+ */
495
+ class FilterFeaturesInPointExecutor extends PostboyExecutor {
496
+ /**
497
+ * Constructs a new instance with the specified latitude, longitude, and features.
498
+ *
499
+ * @param {number} lat - The latitude coordinate.
500
+ * @param {number} lng - The longitude coordinate.
501
+ * @param {Feature<Geometry>[]} features - The array of features associated with the location.
502
+ */
503
+ constructor(lat, lng, features) {
504
+ super();
505
+ this.lat = lat;
506
+ this.lng = lng;
368
507
  this.features = features;
369
- this.zoomAfter = zoomAfter;
370
508
  }
371
- get id() {
372
- return FitToPolygonsCommand.ID;
509
+ }
510
+
511
+ /**
512
+ * A class that extends the PostboyExecutor to filter geographical features within a specified area.
513
+ * This class is designed to process a list of input features and determine which of them are located inside the provided area geometry.
514
+ *
515
+ * Parameters:
516
+ * - `area`: A Geometry object defining the area to filter geographical features.
517
+ * - `features`: An array of geographical features, represented as `Feature<Geometry>` objects, to be filtered by their presence within the specified area.
518
+ */
519
+ class FilterFeaturesInAreaExecutor extends PostboyExecutor {
520
+ constructor(area, features) {
521
+ super();
522
+ this.area = area;
523
+ this.features = features;
373
524
  }
374
- }
375
- FitToPolygonsCommand.ID = 'a9e42b23-ffaf-4c46-8370-e0432cd14d60';
525
+ }
526
+
527
+ /**
528
+ * An executor responsible for calculating the area of a given polygon.
529
+ *
530
+ * Use this class to manage and execute area-calculation logic for a polygon.
531
+ *
532
+ * @return {number} - the spherical area (in square meters)
533
+ */
534
+ class CalculateAreaExecutor extends PostboyExecutor {
535
+ constructor(polygon) {
536
+ super();
537
+ this.polygon = polygon;
538
+ }
539
+ }
376
540
 
377
541
  /**
378
542
  * A message that allows to get the current state of the map.
@@ -380,82 +544,56 @@ FitToPolygonsCommand.ID = 'a9e42b23-ffaf-4c46-8370-e0432cd14d60';
380
544
  * @returns {MapPosition | null}
381
545
  */
382
546
  class GetMapPositionExecutor extends PostboyExecutor {
383
- get id() {
384
- return GetMapPositionExecutor.ID;
385
- }
386
547
  constructor() {
387
548
  super();
388
549
  }
389
550
  }
390
551
  GetMapPositionExecutor.ID = '52c95689-d09b-4082-ba58-9183ea96a213';
391
552
 
553
+ /**
554
+ * Class representing a query to get features within a specified geographical area.
555
+ * The query optionally takes a set of layer names to ignore during the operation.
556
+ */
392
557
  class GetFeaturesInAreaQuery extends PostboyCallbackMessage {
558
+ /**
559
+ * Constructor to initialize the object with a Geometry instance and an optional set of strings to ignore.
560
+ *
561
+ * @param {Geometry} area - The Geometry object used to define the area.
562
+ * @param {Set<string>} [ignore] - An optional set of layer names that will be ignored. Defaults to an empty set.
563
+ */
393
564
  constructor(area, ignore = new Set()) {
394
565
  super();
395
566
  this.area = area;
396
567
  this.ignore = ignore;
397
568
  }
398
- get id() {
399
- return GetFeaturesInAreaQuery.ID;
400
- }
401
- }
402
- GetFeaturesInAreaQuery.ID = 'efcf4271-a07a-40e0-9f02-d4dade40b8ac';
403
-
404
- class FilterFeaturesInAreaExecutor extends PostboyExecutor {
405
- constructor(area, features) {
406
- super();
407
- this.area = area;
408
- this.features = features;
409
- }
410
- get id() {
411
- return FilterFeaturesInAreaExecutor.ID;
412
- }
413
- }
414
- FilterFeaturesInAreaExecutor.ID = '36bb2d94-8028-4512-90dd-2386af3fc67c';
569
+ }
415
570
 
416
571
  /**
417
572
  * Represents a query to retrieve features located at a specific geographical point.
418
573
  * The query is defined by latitude, longitude, and an optional set of features to ignore.
419
574
  */
420
575
  class GetFeaturesInPointQuery extends PostboyCallbackMessage {
576
+ /**
577
+ * Constructor for initializing a geographic coordinate object.
578
+ *
579
+ * @param {number} lat - The latitude of the location.
580
+ * @param {number} lng - The longitude of the location.
581
+ * @param {Set<string>} [ignore=new Set<string>()] - An optional set of strings to ignore during processing.
582
+ */
421
583
  constructor(lat, lng, ignore = new Set()) {
422
584
  super();
423
585
  this.lat = lat;
424
586
  this.lng = lng;
425
587
  this.ignore = ignore;
426
588
  }
427
- get id() {
428
- return GetFeaturesInPointQuery.ID;
429
- }
430
- }
431
- GetFeaturesInPointQuery.ID = '7c051c97-bbf1-47eb-baa3-4d1eef6f281f';
432
-
433
- /**
434
- * The FilterFeaturesInPointExecutor class is responsible for filtering features within a given point.
435
- */
436
- class FilterFeaturesInPointExecutor extends PostboyExecutor {
437
- get id() {
438
- return FilterFeaturesInPointExecutor.ID;
439
- }
440
- constructor(lat, lng, features) {
441
- super();
442
- this.lat = lat;
443
- this.lng = lng;
444
- this.features = features;
445
- }
446
- }
447
- FilterFeaturesInPointExecutor.ID = '5b859282-5d5a-47ca-a6ad-863a66c8b82b';
589
+ }
448
590
 
449
591
  class AddLayerCommand extends PostboyGenericMessage {
450
592
  constructor(layer) {
451
593
  super();
452
594
  this.layer = layer;
453
595
  }
454
- get id() {
455
- return AddLayerCommand.ID;
456
- }
457
- }
458
- AddLayerCommand.ID = 'd93e250f-92bc-43ac-9c6a-46c521a1aaa5';
596
+ }
459
597
 
460
598
  class PlaceLayerFeaturesCommand extends PostboyGenericMessage {
461
599
  constructor(layer, features) {
@@ -463,44 +601,28 @@ class PlaceLayerFeaturesCommand extends PostboyGenericMessage {
463
601
  this.layer = layer;
464
602
  this.features = features;
465
603
  }
466
- get id() {
467
- return PlaceLayerFeaturesCommand.ID;
468
- }
469
- }
470
- PlaceLayerFeaturesCommand.ID = '8caf86bc-869b-426f-b36d-4642f6b8aab0';
604
+ }
471
605
 
472
606
  class RemoveLayerCommand extends PostboyGenericMessage {
473
607
  constructor(layer) {
474
608
  super();
475
609
  this.layer = layer;
476
610
  }
477
- get id() {
478
- return RemoveLayerCommand.ID;
479
- }
480
- }
481
- RemoveLayerCommand.ID = 'ab484e0e-e185-45cd-8434-12101f3c7eb1';
611
+ }
482
612
 
483
613
  class AddTileCommand extends PostboyGenericMessage {
484
614
  constructor(layer) {
485
615
  super();
486
616
  this.layer = layer;
487
617
  }
488
- get id() {
489
- return AddTileCommand.ID;
490
- }
491
- }
492
- AddTileCommand.ID = '25b7df28-72ce-4453-9fe6-54285a2fdc57';
618
+ }
493
619
 
494
620
  class RemoveTileCommand extends PostboyGenericMessage {
495
621
  constructor(layer) {
496
622
  super();
497
623
  this.layer = layer;
498
624
  }
499
- get id() {
500
- return RemoveTileCommand.ID;
501
- }
502
- }
503
- RemoveTileCommand.ID = 'c36ccc0b-5638-4819-b148-2de57a59a5b7';
625
+ }
504
626
 
505
627
  class FitToFeaturesCommand extends PostboyGenericMessage {
506
628
  constructor(features, zoomAfter = 0) {
@@ -508,32 +630,17 @@ class FitToFeaturesCommand extends PostboyGenericMessage {
508
630
  this.features = features;
509
631
  this.zoomAfter = zoomAfter;
510
632
  }
511
- get id() {
512
- return FitToFeaturesCommand.ID;
513
- }
514
- }
515
- FitToFeaturesCommand.ID = '76cdc091-3793-4b6c-82f7-1e0334cf08a8';
633
+ }
516
634
 
517
635
  class GetLayerQuery extends PostboyCallbackMessage {
518
636
  constructor(name) {
519
637
  super();
520
638
  this.name = name;
521
639
  }
522
- get id() {
523
- return GetLayerQuery.ID;
524
- }
525
- }
526
- GetLayerQuery.ID = '5c04c87b-8a93-4c2a-979e-d1e313d860ed';
640
+ }
527
641
 
528
642
  class DrawingFinishedEvent extends PostboyGenericMessage {
529
- constructor() {
530
- super();
531
- }
532
- get id() {
533
- return DrawingFinishedEvent.ID;
534
- }
535
- }
536
- DrawingFinishedEvent.ID = 'c724b68e-b4eb-4783-90f1-a8e31973fd36';
643
+ }
537
644
 
538
645
  class DrawingGenerationService {
539
646
  static getDraw(ev) {
@@ -588,22 +695,14 @@ class GenerateDrawExecutor extends PostboyExecutor {
588
695
  this.style = style;
589
696
  this.type = type;
590
697
  }
591
- get id() {
592
- return GenerateDrawExecutor.ID;
593
- }
594
- }
595
- GenerateDrawExecutor.ID = 'f01c99ba-0953-4ab5-82f9-04e6fbb678c1';
698
+ }
596
699
 
597
700
  class GenerateZoomControlExecutor extends PostboyExecutor {
598
701
  constructor(settings) {
599
702
  super();
600
703
  this.settings = settings;
601
704
  }
602
- get id() {
603
- return GenerateZoomControlExecutor.ID;
604
- }
605
- }
606
- GenerateZoomControlExecutor.ID = 'ff16a833-c68e-4b1a-bc23-c0d16b002810';
705
+ }
607
706
 
608
707
  class ZoomControlFactory {
609
708
  static build(settings) {
@@ -620,7 +719,11 @@ class ZoomControlFactory {
620
719
  class MapPostboyService extends PostboyService {
621
720
  constructor() {
622
721
  super();
623
- this.addLocker({ locker: StartDrawingCommand.ID, unlocker: DrawingFinishedEvent.ID, locking: [MapClickEvent.ID] });
722
+ this.addLocker({
723
+ locker: StartDrawingCommand.name,
724
+ unlocker: DrawingFinishedEvent.name,
725
+ locking: [MapClickEvent.name],
726
+ });
624
727
  }
625
728
  }
626
729
  MapPostboyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MapPostboyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
@@ -646,29 +749,29 @@ class MapManagementService {
646
749
  this.observeFeaturesInPoint();
647
750
  }
648
751
  observeRemoveTile() {
649
- this.postboy.subscribe(RemoveTileCommand.ID).subscribe((c) => {
752
+ this.postboy.sub(RemoveTileCommand).subscribe((c) => {
650
753
  if (!this.map)
651
754
  return;
652
755
  this.map.removeLayer(c.layer);
653
756
  });
654
757
  }
655
758
  observeLayerQuery() {
656
- this.postboy.subscribe(GetLayerQuery.ID).subscribe((ev) => ev.finish(this.layers.take(ev.name)));
759
+ this.postboy.sub(GetLayerQuery).subscribe((ev) => ev.finish(this.layers.take(ev.name)));
657
760
  }
658
761
  observeAddTile() {
659
- this.postboy.subscribe(AddTileCommand.ID).subscribe((c) => {
762
+ this.postboy.sub(AddTileCommand).subscribe((c) => {
660
763
  if (!this.map)
661
764
  return;
662
765
  this.map.addLayer(c.layer);
663
766
  });
664
767
  }
665
768
  observeMapRender() {
666
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
769
+ this.postboy.sub(MapRenderedEvent).subscribe((m) => {
667
770
  this.map = m.map;
668
771
  });
669
772
  }
670
773
  observeAddLayer() {
671
- this.postboy.subscribe(AddLayerCommand.ID).subscribe((c) => {
774
+ this.postboy.sub(AddLayerCommand).subscribe((c) => {
672
775
  if (!this.map)
673
776
  return;
674
777
  this.layers.put(c.layer.get('name'), c.layer);
@@ -676,7 +779,7 @@ class MapManagementService {
676
779
  });
677
780
  }
678
781
  observePlaceFeatures() {
679
- this.postboy.subscribe(PlaceLayerFeaturesCommand.ID).subscribe((c) => {
782
+ this.postboy.sub(PlaceLayerFeaturesCommand).subscribe((c) => {
680
783
  if (!this.layers.has(c.layer))
681
784
  return;
682
785
  let source = this.layers.take(c.layer).getSource();
@@ -687,7 +790,7 @@ class MapManagementService {
687
790
  });
688
791
  }
689
792
  observeRemoveLayer() {
690
- this.postboy.subscribe(RemoveLayerCommand.ID).subscribe((c) => {
793
+ this.postboy.sub(RemoveLayerCommand).subscribe((c) => {
691
794
  if (!this.map)
692
795
  return;
693
796
  this.layers.rmv(c.layer.get('name'));
@@ -695,20 +798,20 @@ class MapManagementService {
695
798
  });
696
799
  }
697
800
  observeFeaturesInArea() {
698
- this.postboy.subscribe(GetFeaturesInAreaQuery.ID).subscribe((qr) => {
801
+ this.postboy.sub(GetFeaturesInAreaQuery).subscribe((qr) => {
699
802
  let result = new Dictionary();
700
803
  this.forEachLayer((l, s) => {
701
- let features = this.postboy.execute(new FilterFeaturesInAreaExecutor(qr.area, s?.getFeatures() ?? []));
804
+ let features = this.postboy.exec(new FilterFeaturesInAreaExecutor(qr.area, s?.getFeatures() ?? []));
702
805
  result.put(l.get('name'), features.map((e) => ({ id: e.getId(), ...e.get(MapConstants.FeatureInfo) })));
703
806
  }, qr.ignore);
704
807
  qr.finish(result);
705
808
  });
706
809
  }
707
810
  observeFeaturesInPoint() {
708
- this.postboy.subscribe(GetFeaturesInPointQuery.ID).subscribe((qr) => {
811
+ this.postboy.sub(GetFeaturesInPointQuery).subscribe((qr) => {
709
812
  let result = new Dictionary();
710
813
  this.forEachLayer((l, s) => {
711
- let features = this.postboy.execute(new FilterFeaturesInPointExecutor(qr.lat, qr.lng, s?.getFeatures() ?? []));
814
+ let features = this.postboy.exec(new FilterFeaturesInPointExecutor(qr.lat, qr.lng, s?.getFeatures() ?? []));
712
815
  result.put(l.get('name'), features.map((e) => ({ id: e.getId(), ...e.get(MapConstants.FeatureInfo) })));
713
816
  }, qr.ignore);
714
817
  qr.finish(result);
@@ -750,7 +853,7 @@ class MapStateService {
750
853
  }
751
854
  observeMapRendering() {
752
855
  this.postboy
753
- .subscribe(MapRenderedEvent.ID)
856
+ .sub(MapRenderedEvent)
754
857
  .pipe(first())
755
858
  .subscribe((ev) => {
756
859
  this.map = ev.map;
@@ -760,7 +863,7 @@ class MapStateService {
760
863
  });
761
864
  }
762
865
  observeCenter() {
763
- this.postboy.subscribe(SetMapCenterCommand.ID).subscribe((c) => {
866
+ this.postboy.sub(SetMapCenterCommand).subscribe((c) => {
764
867
  this.map?.getView().setCenter([c.lng, c.lat]);
765
868
  if (c.zoom)
766
869
  this.map?.getView().setZoom(c.zoom);
@@ -783,19 +886,19 @@ class MapFeatureService {
783
886
  this.observeFitToPolygons();
784
887
  }
785
888
  observeMapRender() {
786
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
889
+ this.postboy.sub(MapRenderedEvent).subscribe((m) => {
787
890
  this.map = m.map;
788
891
  if (this.fitPolygonsWaiting)
789
892
  this.postboy.fire(this.fitPolygonsWaiting);
790
893
  });
791
894
  }
792
895
  observeFitToFeatures() {
793
- this.postboy.subscribe(FitToFeaturesCommand.ID).subscribe((cmd) => {
896
+ this.postboy.sub(FitToFeaturesCommand).subscribe((cmd) => {
794
897
  this.fitToGeometries(cmd.features.map((f) => f.getGeometry()), cmd.zoomAfter);
795
898
  });
796
899
  }
797
900
  observeFitToPolygons() {
798
- this.postboy.subscribe(FitToPolygonsCommand.ID).subscribe((cmd) => {
901
+ this.postboy.sub(FitToPolygonsCommand).subscribe((cmd) => {
799
902
  if (!this.map) {
800
903
  this.fitPolygonsWaiting = cmd;
801
904
  return;
@@ -844,7 +947,7 @@ class MapClickService {
844
947
  return model;
845
948
  }
846
949
  observeMapRender() {
847
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
950
+ this.postboy.sub(MapRenderedEvent).subscribe((m) => {
848
951
  this.map = m.map;
849
952
  this.map?.on('singleclick', (e) => {
850
953
  this.postboy.fire(this.onClick(e));
@@ -876,30 +979,26 @@ class DrawingService {
876
979
  this.observeMapRender();
877
980
  }
878
981
  observeSelectArea() {
879
- this.postboy.subscribe(DrawSelectionAreaCommand.ID).subscribe((ev) => {
880
- const drawingCommand = new StartDrawingCommand(ev.type, ev.style);
881
- drawingCommand.result.subscribe((r) => {
982
+ this.postboy.sub(DrawSelectionAreaCommand).subscribe((ev) => {
983
+ this.postboy.fireCallback(new StartDrawingCommand(ev.type, ev.style), (r) => {
882
984
  if (!r) {
883
985
  ev.finish(new Dictionary());
884
986
  return;
885
987
  }
886
988
  const area = PolygonModel.fromGeoJson(1, r).feature.getGeometry();
887
- const getFeaturesCommand = new GetFeaturesInAreaQuery(area, ev.ignore);
888
- getFeaturesCommand.result.subscribe((result) => ev.finish(result));
889
- this.postboy.fire(getFeaturesCommand);
989
+ this.postboy.fireCallback(new GetFeaturesInAreaQuery(area, ev.ignore), (result) => ev.finish(result));
890
990
  });
891
- this.postboy.fire(drawingCommand);
892
991
  });
893
992
  }
894
993
  observeDrawing() {
895
- this.postboy.subscribe(StartDrawingCommand.ID).subscribe((ev) => {
994
+ this.postboy.sub(StartDrawingCommand).subscribe((ev) => {
896
995
  this.draw((l) => {
897
996
  if (!l || !this.map) {
898
997
  this.clearInteraction(l);
899
998
  return;
900
999
  }
901
1000
  const cancelSub = this.observeCancelation(ev, l);
902
- this.drawInteraction = this.postboy.execute(new GenerateDrawExecutor(l, ev.style, ev.type));
1001
+ this.drawInteraction = this.postboy.exec(new GenerateDrawExecutor(l, ev.style, ev.type));
903
1002
  this.map?.addInteraction(this.drawInteraction);
904
1003
  this.drawInteraction.on('drawend', (evt) => {
905
1004
  cancelSub.unsubscribe();
@@ -915,18 +1014,16 @@ class DrawingService {
915
1014
  this.clearInteraction(layer);
916
1015
  }
917
1016
  observeMapRender() {
918
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
1017
+ this.postboy.sub(MapRenderedEvent).subscribe((m) => {
919
1018
  this.map = m.map;
920
1019
  });
921
1020
  }
922
1021
  draw(action) {
923
- const query = new GetLayerQuery(MapConstants.DrawingLayerId);
924
- query.result.subscribe((l) => action(l));
925
- this.postboy.fire(query);
1022
+ this.postboy.fireCallback(new GetLayerQuery(MapConstants.DrawingLayerId), (l) => action(l));
926
1023
  }
927
1024
  observeCancelation(ev, layer) {
928
1025
  return this.postboy
929
- .subscribe(CancelDrawingCommand.ID)
1026
+ .sub(CancelDrawingCommand)
930
1027
  .pipe(first())
931
1028
  .subscribe(() => {
932
1029
  ev.finish(null);
@@ -956,7 +1053,7 @@ class FeatureModificationService {
956
1053
  this.observeMapRender();
957
1054
  }
958
1055
  observeModification() {
959
- this.postboy.subscribe(ModifyFeatureCommand.ID).subscribe((ev) => {
1056
+ this.postboy.sub(ModifyFeatureCommand).subscribe((ev) => {
960
1057
  this.defineLayer((l) => {
961
1058
  if (!l || !this.map) {
962
1059
  this.clearInteraction(l);
@@ -1002,18 +1099,16 @@ class FeatureModificationService {
1002
1099
  : new WKT().writeFeature(command.model.feature));
1003
1100
  }
1004
1101
  observeMapRender() {
1005
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
1102
+ this.postboy.sub(MapRenderedEvent).subscribe((m) => {
1006
1103
  this.map = m.map;
1007
1104
  });
1008
1105
  }
1009
1106
  defineLayer(action) {
1010
- const query = new GetLayerQuery(MapConstants.DrawingLayerId);
1011
- query.result.subscribe((l) => action(l));
1012
- this.postboy.fire(query);
1107
+ this.postboy.fireCallback(new GetLayerQuery(MapConstants.DrawingLayerId), (l) => action(l));
1013
1108
  }
1014
1109
  observeCancelation(ev, layer) {
1015
1110
  return this.postboy
1016
- .subscribe(CancelFeatureModificationCommand.ID)
1111
+ .sub(CancelFeatureModificationCommand)
1017
1112
  .pipe(first())
1018
1113
  .subscribe(() => {
1019
1114
  ev.finish(null);
@@ -1042,7 +1137,7 @@ class ControlsService {
1042
1137
  }
1043
1138
  observeMapRender() {
1044
1139
  this.postboy
1045
- .subscribe(MapRenderedEvent.ID)
1140
+ .sub(MapRenderedEvent)
1046
1141
  .pipe(first())
1047
1142
  .subscribe((m) => {
1048
1143
  this.map = m.map;
@@ -1051,12 +1146,10 @@ class ControlsService {
1051
1146
  });
1052
1147
  }
1053
1148
  observeAdding() {
1054
- this.postboy.subscribe(AddControlCommand.ID).subscribe((c) => this.map?.addControl(c.item));
1149
+ this.postboy.sub(AddControlCommand).subscribe((c) => this.map?.addControl(c.item));
1055
1150
  }
1056
1151
  observeRemoving() {
1057
- this.postboy
1058
- .subscribe(RemoveControlCommand.ID)
1059
- .subscribe((c) => this.map?.removeControl(c.item));
1152
+ this.postboy.sub(RemoveControlCommand).subscribe((c) => this.map?.removeControl(c.item));
1060
1153
  }
1061
1154
  }
1062
1155
  ControlsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ControlsService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
@@ -1072,38 +1165,38 @@ class MessageRegistratorService extends PostboyAbstractRegistrator {
1072
1165
  this.registerServices([management, state, interaction, mapFeature, drawing, featureModification, controls]);
1073
1166
  }
1074
1167
  _up() {
1075
- this.registerReplay(MapRenderedEvent.ID);
1076
- this.registerReplay(PlaceLayerFeaturesCommand.ID);
1077
- this.registerReplay(RemoveControlCommand.ID);
1078
- this.registerReplay(AddControlCommand.ID);
1079
- this.registerReplay(SetMapCenterCommand.ID);
1080
- this.registerSubject(AddLayerCommand.ID);
1081
- this.registerSubject(RemoveLayerCommand.ID);
1082
- this.registerSubject(AddTileCommand.ID);
1083
- this.registerSubject(RemoveTileCommand.ID);
1084
- this.registerSubject(MapClickEvent.ID);
1085
- this.registerSubject(CloseTooltipCommand.ID);
1086
- this.registerSubject(FitToFeaturesCommand.ID);
1087
- this.registerSubject(FitToPolygonsCommand.ID);
1088
- this.registerSubject(MapMoveEndEvent.ID);
1089
- this.registerSubject(CancelDrawingCommand.ID);
1090
- this.registerSubject(StartDrawingCommand.ID);
1091
- this.registerSubject(GetLayerQuery.ID);
1092
- this.registerSubject(DrawingFinishedEvent.ID);
1093
- this.registerSubject(GetFeaturesInAreaQuery.ID);
1094
- this.registerSubject(DrawSelectionAreaCommand.ID);
1095
- this.registerSubject(CancelFeatureModificationCommand.ID);
1096
- this.registerSubject(ModifyFeatureCommand.ID);
1097
- this.registerSubject(GetFeaturesInPointQuery.ID);
1168
+ this.recordReplay(MapRenderedEvent);
1169
+ this.recordReplay(PlaceLayerFeaturesCommand);
1170
+ this.recordReplay(RemoveControlCommand);
1171
+ this.recordReplay(AddControlCommand);
1172
+ this.recordReplay(SetMapCenterCommand);
1173
+ this.recordSubject(AddLayerCommand);
1174
+ this.recordSubject(RemoveLayerCommand);
1175
+ this.recordSubject(AddTileCommand);
1176
+ this.recordSubject(RemoveTileCommand);
1177
+ this.recordSubject(MapClickEvent);
1178
+ this.recordSubject(CloseTooltipCommand);
1179
+ this.recordSubject(FitToFeaturesCommand);
1180
+ this.recordSubject(FitToPolygonsCommand);
1181
+ this.recordSubject(MapMoveEndEvent);
1182
+ this.recordSubject(CancelDrawingCommand);
1183
+ this.recordSubject(StartDrawingCommand);
1184
+ this.recordSubject(GetLayerQuery);
1185
+ this.recordSubject(DrawingFinishedEvent);
1186
+ this.recordSubject(GetFeaturesInAreaQuery);
1187
+ this.recordSubject(DrawSelectionAreaCommand);
1188
+ this.recordSubject(CancelFeatureModificationCommand);
1189
+ this.recordSubject(ModifyFeatureCommand);
1190
+ this.recordSubject(GetFeaturesInPointQuery);
1098
1191
  this.setExecutors();
1099
1192
  }
1100
1193
  setExecutors() {
1101
- this.registerExecutor(FilterFeaturesInAreaExecutor.ID, (e) => FeatureService.filterFeaturesInArea(e));
1102
- this.registerExecutor(FilterFeaturesInPointExecutor.ID, (e) => FeatureService.filterFeaturesInPoint(e));
1103
- this.registerExecutor(CalculateAreaExecutor.ID, (e) => FeatureService.calculateArea(e.polygon?.feature?.getGeometry()));
1104
- this.registerExecutor(GenerateDrawExecutor.ID, (e) => DrawingGenerationService.getDraw(e));
1105
- this.registerExecutor(GenerateZoomControlExecutor.ID, (e) => ZoomControlFactory.build(e.settings));
1106
- this.registerExecutor(GetMapPositionExecutor.ID, () => this.state.getMapPosition());
1194
+ this.recordExecutor(FilterFeaturesInAreaExecutor, (e) => FeatureService.filterFeaturesInArea(e));
1195
+ this.recordExecutor(FilterFeaturesInPointExecutor, (e) => FeatureService.filterFeaturesInPoint(e));
1196
+ this.recordExecutor(CalculateAreaExecutor, (e) => FeatureService.calculateArea(e.polygon?.feature?.getGeometry()));
1197
+ this.recordExecutor(GenerateDrawExecutor, (e) => DrawingGenerationService.getDraw(e));
1198
+ this.recordExecutor(GenerateZoomControlExecutor, (e) => ZoomControlFactory.build(e.settings));
1199
+ this.recordExecutor(GetMapPositionExecutor, () => this.state.getMapPosition());
1107
1200
  }
1108
1201
  }
1109
1202
  MessageRegistratorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", 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 });
@@ -1332,7 +1425,7 @@ class TileLayerComponent extends DestructibleComponent {
1332
1425
  }
1333
1426
  ngOnInit() {
1334
1427
  this.postboy
1335
- .subscribe(MapRenderedEvent.ID)
1428
+ .sub(MapRenderedEvent)
1336
1429
  .pipe(filter((m) => !!m), first())
1337
1430
  .subscribe((m) => this.initLayer());
1338
1431
  }
@@ -1555,7 +1648,7 @@ class FeatureLayerComponent extends DestructibleComponent {
1555
1648
  }
1556
1649
  ngOnInit() {
1557
1650
  this.postboy
1558
- .subscribe(MapRenderedEvent.ID)
1651
+ .sub(MapRenderedEvent)
1559
1652
  .pipe(filter((m) => !!m), first())
1560
1653
  .subscribe((m) => this.initLayer());
1561
1654
  }
@@ -1733,14 +1826,14 @@ class ClusterLayerManager {
1733
1826
  }
1734
1827
  observeMapMovement() {
1735
1828
  combineLatest([
1736
- this.postboy.subscribe(MapMoveEndEvent.ID).pipe(auditTime(250)),
1737
- this.postboy.subscribe(MapRenderedEvent.ID),
1829
+ this.postboy.sub(MapMoveEndEvent).pipe(auditTime(250)),
1830
+ this.postboy.sub(MapRenderedEvent),
1738
1831
  ]).subscribe(([movement, renderEvent]) => {
1739
1832
  this.checkClusterNecessity(renderEvent.map);
1740
1833
  });
1741
1834
  }
1742
1835
  observeClick() {
1743
- this.postboy.subscribe(MapClickEvent.ID).subscribe((m) => {
1836
+ this.postboy.sub(MapClickEvent).subscribe((m) => {
1744
1837
  if ((m.features[this.settings.name]?.length ?? 0) > 1) {
1745
1838
  this.postboy.fire(new FitToFeaturesCommand(m.features[this.settings.name], -1));
1746
1839
  }
@@ -1828,7 +1921,7 @@ class ClusterLayerComponent extends DestructibleComponent {
1828
1921
  }
1829
1922
  ngOnInit() {
1830
1923
  this.postboy
1831
- .subscribe(MapRenderedEvent.ID)
1924
+ .sub(MapRenderedEvent)
1832
1925
  .pipe(filter((m) => !!m), first())
1833
1926
  .subscribe((m) => this.initLayer());
1834
1927
  }
@@ -1969,7 +2062,7 @@ class MarkersComponent extends DestructibleComponent {
1969
2062
  }
1970
2063
  ngOnInit() {
1971
2064
  this.postboy
1972
- .subscribe(MapRenderedEvent.ID)
2065
+ .sub(MapRenderedEvent)
1973
2066
  .pipe(filter((m) => !!m), first())
1974
2067
  .subscribe(() => this.putMarkers());
1975
2068
  }
@@ -2058,18 +2151,18 @@ class TooltipComponent extends DestructibleComponent {
2058
2151
  this.detector.detectChanges();
2059
2152
  }
2060
2153
  observeMapClick() {
2061
- return this.postboy.subscribe(MapClickEvent.ID).subscribe((ev) => {
2154
+ return this.postboy.sub(MapClickEvent).subscribe((ev) => {
2062
2155
  this._settings.show(ev) ? this.addOverlay(ev.coordinates) : this.removeOverlay();
2063
2156
  });
2064
2157
  }
2065
2158
  observeClose() {
2066
2159
  return this.postboy
2067
- .subscribe(CloseTooltipCommand.ID)
2160
+ .sub(CloseTooltipCommand)
2068
2161
  .pipe(filter((ev) => ev.tooltipId === this._settings.id))
2069
2162
  .subscribe(() => this.removeOverlay());
2070
2163
  }
2071
2164
  observeMapRender() {
2072
- return this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
2165
+ return this.postboy.sub(MapRenderedEvent).subscribe((m) => {
2073
2166
  this.map = m.map;
2074
2167
  });
2075
2168
  }
@@ -2109,7 +2202,7 @@ class PolygonsComponent extends DestructibleComponent {
2109
2202
  }
2110
2203
  ngOnInit() {
2111
2204
  this.postboy
2112
- .subscribe(MapRenderedEvent.ID)
2205
+ .sub(MapRenderedEvent)
2113
2206
  .pipe(filter((m) => !!m), first())
2114
2207
  .subscribe(() => this.putPolygons());
2115
2208
  }
@@ -2283,7 +2376,7 @@ class MapControlZoomComponent extends DestructibleComponent {
2283
2376
  }
2284
2377
  ngOnInit() {
2285
2378
  this.postboy
2286
- .subscribe(MapRenderedEvent.ID)
2379
+ .sub(MapRenderedEvent)
2287
2380
  .pipe(filter((m) => !!m), first())
2288
2381
  .subscribe((m) => {
2289
2382
  this.map = m.map;
@@ -2293,7 +2386,7 @@ class MapControlZoomComponent extends DestructibleComponent {
2293
2386
  setControl() {
2294
2387
  if (!this.map)
2295
2388
  return;
2296
- this.control = this.postboy.execute(new GenerateZoomControlExecutor(this._settings));
2389
+ this.control = this.postboy.exec(new GenerateZoomControlExecutor(this._settings));
2297
2390
  this.map.addControl(this.control);
2298
2391
  }
2299
2392
  }