@artstesh/maps 1.1.13 → 1.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/dist/bundles/maps-components-src-map.umd.js +392 -412
  2. package/dist/bundles/maps-components-src-map.umd.js.map +1 -1
  3. package/dist/bundles/maps-components.umd.js +392 -412
  4. package/dist/bundles/maps-components.umd.js.map +1 -1
  5. package/dist/esm2015/map/map-plate/controls/map-control-zoom/map-control-zoom.component.js +3 -3
  6. package/dist/esm2015/map/map-plate/features/markers/markers.component.js +2 -2
  7. package/dist/esm2015/map/map-plate/features/polygons/polygons.component.js +2 -2
  8. package/dist/esm2015/map/map-plate/layers/cluster-layer/cluster-layer.component.js +2 -2
  9. package/dist/esm2015/map/map-plate/layers/cluster-layer/cluster-layer.manager.js +4 -4
  10. package/dist/esm2015/map/map-plate/layers/feature-layer/feature-layer.component.js +2 -2
  11. package/dist/esm2015/map/map-plate/layers/tile-layer/tile-layer.component.js +2 -2
  12. package/dist/esm2015/map/map-plate/tooltips/tooltip/tooltip.component.js +4 -4
  13. package/dist/esm2015/map/messages/commands/add-control.command.js +9 -5
  14. package/dist/esm2015/map/messages/commands/add-layer.command.js +1 -5
  15. package/dist/esm2015/map/messages/commands/add-tile.command.js +1 -5
  16. package/dist/esm2015/map/messages/commands/cancel-drawing.command.js +4 -5
  17. package/dist/esm2015/map/messages/commands/cancel-feature-modification.command.js +4 -5
  18. package/dist/esm2015/map/messages/commands/close-tooltip.command.js +9 -5
  19. package/dist/esm2015/map/messages/commands/draw-selection-area.command.js +13 -5
  20. package/dist/esm2015/map/messages/commands/fit-to-features.command.js +1 -5
  21. package/dist/esm2015/map/messages/commands/fit-to-polygons.command.js +11 -5
  22. package/dist/esm2015/map/messages/commands/modify-feature.command.js +14 -5
  23. package/dist/esm2015/map/messages/commands/place-layer-features.command.js +1 -5
  24. package/dist/esm2015/map/messages/commands/remove-control.command.js +14 -5
  25. package/dist/esm2015/map/messages/commands/remove-layer.command.js +1 -5
  26. package/dist/esm2015/map/messages/commands/remove-tile.command.js +1 -5
  27. package/dist/esm2015/map/messages/commands/set-map-center.command.js +1 -5
  28. package/dist/esm2015/map/messages/commands/start-drawing.command.js +11 -5
  29. package/dist/esm2015/map/messages/events/drawing-finished.event.js +1 -8
  30. package/dist/esm2015/map/messages/events/map-click.event.js +14 -5
  31. package/dist/esm2015/map/messages/events/map-move-end.event.js +7 -5
  32. package/dist/esm2015/map/messages/events/map-rendered.event.js +9 -5
  33. package/dist/esm2015/map/messages/executors/calculate-area.executor.js +8 -5
  34. package/dist/esm2015/map/messages/executors/filter-features-in-area.executor.js +9 -5
  35. package/dist/esm2015/map/messages/executors/filter-features-in-point.executor.js +13 -6
  36. package/dist/esm2015/map/messages/executors/generate-draw.executor.js +1 -5
  37. package/dist/esm2015/map/messages/executors/generate-zoom-control.executor.js +1 -5
  38. package/dist/esm2015/map/messages/executors/get-map-position.executor.js +1 -4
  39. package/dist/esm2015/map/messages/index.js +8 -8
  40. package/dist/esm2015/map/messages/queries/get-features-in-area.query.js +11 -5
  41. package/dist/esm2015/map/messages/queries/get-features-in-point.query.js +8 -5
  42. package/dist/esm2015/map/messages/queries/get-layer.query.js +1 -5
  43. package/dist/esm2015/map/models/drawing-type.enum.js +14 -1
  44. package/dist/esm2015/map/models/feature-format.enum.js +9 -1
  45. package/dist/esm2015/map/models/map-position.model.js +1 -1
  46. package/dist/esm2015/map/models/map-settings.js +47 -1
  47. package/dist/esm2015/map/services/controls/controls.service.js +4 -6
  48. package/dist/esm2015/map/services/drawing/drawing.service.js +9 -15
  49. package/dist/esm2015/map/services/drawing/feature-modification.service.js +5 -7
  50. package/dist/esm2015/map/services/map-click.service.js +2 -2
  51. package/dist/esm2015/map/services/map-feature.service.js +4 -4
  52. package/dist/esm2015/map/services/map-management.service.js +12 -12
  53. package/dist/esm2015/map/services/map-postboy.service.js +6 -2
  54. package/dist/esm2015/map/services/map-state.service.js +3 -3
  55. package/dist/esm2015/map/services/message-registrator.service.js +30 -30
  56. package/dist/esm2015/src/map/map-plate/controls/map-control-zoom/map-control-zoom.component.js +3 -3
  57. package/dist/esm2015/src/map/map-plate/features/markers/markers.component.js +2 -2
  58. package/dist/esm2015/src/map/map-plate/features/polygons/polygons.component.js +2 -2
  59. package/dist/esm2015/src/map/map-plate/layers/cluster-layer/cluster-layer.component.js +2 -2
  60. package/dist/esm2015/src/map/map-plate/layers/cluster-layer/cluster-layer.manager.js +4 -4
  61. package/dist/esm2015/src/map/map-plate/layers/feature-layer/feature-layer.component.js +2 -2
  62. package/dist/esm2015/src/map/map-plate/layers/tile-layer/tile-layer.component.js +2 -2
  63. package/dist/esm2015/src/map/map-plate/tooltips/tooltip/tooltip.component.js +4 -4
  64. package/dist/esm2015/src/map/messages/commands/add-control.command.js +9 -5
  65. package/dist/esm2015/src/map/messages/commands/add-layer.command.js +1 -5
  66. package/dist/esm2015/src/map/messages/commands/add-tile.command.js +1 -5
  67. package/dist/esm2015/src/map/messages/commands/cancel-drawing.command.js +4 -5
  68. package/dist/esm2015/src/map/messages/commands/cancel-feature-modification.command.js +4 -5
  69. package/dist/esm2015/src/map/messages/commands/close-tooltip.command.js +9 -5
  70. package/dist/esm2015/src/map/messages/commands/draw-selection-area.command.js +13 -5
  71. package/dist/esm2015/src/map/messages/commands/fit-to-features.command.js +1 -5
  72. package/dist/esm2015/src/map/messages/commands/fit-to-polygons.command.js +11 -5
  73. package/dist/esm2015/src/map/messages/commands/modify-feature.command.js +14 -5
  74. package/dist/esm2015/src/map/messages/commands/place-layer-features.command.js +1 -5
  75. package/dist/esm2015/src/map/messages/commands/remove-control.command.js +14 -5
  76. package/dist/esm2015/src/map/messages/commands/remove-layer.command.js +1 -5
  77. package/dist/esm2015/src/map/messages/commands/remove-tile.command.js +1 -5
  78. package/dist/esm2015/src/map/messages/commands/set-map-center.command.js +1 -5
  79. package/dist/esm2015/src/map/messages/commands/start-drawing.command.js +11 -5
  80. package/dist/esm2015/src/map/messages/events/drawing-finished.event.js +1 -8
  81. package/dist/esm2015/src/map/messages/events/map-click.event.js +14 -5
  82. package/dist/esm2015/src/map/messages/events/map-move-end.event.js +7 -5
  83. package/dist/esm2015/src/map/messages/events/map-rendered.event.js +9 -5
  84. package/dist/esm2015/src/map/messages/executors/calculate-area.executor.js +8 -5
  85. package/dist/esm2015/src/map/messages/executors/filter-features-in-area.executor.js +9 -5
  86. package/dist/esm2015/src/map/messages/executors/filter-features-in-point.executor.js +13 -6
  87. package/dist/esm2015/src/map/messages/executors/generate-draw.executor.js +1 -5
  88. package/dist/esm2015/src/map/messages/executors/generate-zoom-control.executor.js +1 -5
  89. package/dist/esm2015/src/map/messages/executors/get-map-position.executor.js +1 -4
  90. package/dist/esm2015/src/map/messages/index.js +8 -8
  91. package/dist/esm2015/src/map/messages/queries/get-features-in-area.query.js +11 -5
  92. package/dist/esm2015/src/map/messages/queries/get-features-in-point.query.js +8 -5
  93. package/dist/esm2015/src/map/messages/queries/get-layer.query.js +1 -5
  94. package/dist/esm2015/src/map/models/drawing-type.enum.js +14 -1
  95. package/dist/esm2015/src/map/models/feature-format.enum.js +9 -1
  96. package/dist/esm2015/src/map/models/map-position.model.js +1 -1
  97. package/dist/esm2015/src/map/models/map-settings.js +47 -1
  98. package/dist/esm2015/src/map/services/controls/controls.service.js +4 -6
  99. package/dist/esm2015/src/map/services/drawing/drawing.service.js +9 -15
  100. package/dist/esm2015/src/map/services/drawing/feature-modification.service.js +5 -7
  101. package/dist/esm2015/src/map/services/map-click.service.js +2 -2
  102. package/dist/esm2015/src/map/services/map-feature.service.js +4 -4
  103. package/dist/esm2015/src/map/services/map-management.service.js +12 -12
  104. package/dist/esm2015/src/map/services/map-postboy.service.js +6 -2
  105. package/dist/esm2015/src/map/services/map-state.service.js +3 -3
  106. package/dist/esm2015/src/map/services/message-registrator.service.js +30 -30
  107. package/dist/fesm2015/maps-components-src-map.js +368 -275
  108. package/dist/fesm2015/maps-components-src-map.js.map +1 -1
  109. package/dist/fesm2015/maps-components.js +368 -275
  110. package/dist/fesm2015/maps-components.js.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 +14 -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(Object.assign(Object.assign({}, 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(Object.assign(Object.assign({}, 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(Object.assign(Object.assign({}, 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(Object.assign(Object.assign({}, 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(Object.assign(Object.assign({}, 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(Object.assign(Object.assign({}, 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;
@@ -181,6 +227,19 @@ class PolygonModel {
181
227
  }
182
228
  }
183
229
 
230
+ /**
231
+ * Enum representing various drawing types.
232
+ *
233
+ * This enumeration is used to define the types of drawable shapes
234
+ * within a specific drawing context. Each member corresponds to
235
+ * a specific type of drawing.
236
+ *
237
+ * Members:
238
+ * - `Polygon`: Represents a polygonal shape (e.g., triangle, pentagon, etc.).
239
+ * - `Circle`: Represents a circular shape.
240
+ * - `Square`: Represents a square shape.
241
+ * - `Box`: Represents a rectangular box shape.
242
+ */
184
243
  var DrawingType;
185
244
  (function (DrawingType) {
186
245
  DrawingType[DrawingType["Polygon"] = 1] = "Polygon";
@@ -189,6 +248,14 @@ var DrawingType;
189
248
  DrawingType[DrawingType["Box"] = 4] = "Box";
190
249
  })(DrawingType || (DrawingType = {}));
191
250
 
251
+ /**
252
+ * An enumeration representing different formats for feature outputs.
253
+ * This can be used to specify the desired output format when dealing with geospatial data.
254
+ *
255
+ * Enumerators:
256
+ * - GeoJson: Represents the GeoJSON format for geospatial data.
257
+ * - WKT: Represents the Well-Known Text (WKT) format for geospatial data.
258
+ */
192
259
  var FeatureOutputFormat;
193
260
  (function (FeatureOutputFormat) {
194
261
  FeatureOutputFormat[FeatureOutputFormat["GeoJson"] = 1] = "GeoJson";
@@ -209,126 +276,129 @@ class MapControl extends Control {
209
276
  }
210
277
  }
211
278
 
212
- class MapRenderedEvent extends PostboyGenericMessage {
213
- constructor(map) {
214
- super();
215
- this.map = map;
216
- }
217
- get id() {
218
- return MapRenderedEvent.ID;
219
- }
220
- }
221
- MapRenderedEvent.ID = 'b6121807-3b89-4cd3-82cf-089d2cefdc4f';
222
-
223
- class MapClickEvent extends PostboyGenericMessage {
224
- constructor(coordinates, entities, features) {
225
- super();
226
- this.coordinates = coordinates;
227
- this.entities = entities;
228
- this.features = features;
229
- }
230
- get id() {
231
- return MapClickEvent.ID;
232
- }
233
- }
234
- MapClickEvent.ID = '323df526-8d9c-49c6-83e8-6e9a1e7762f7';
235
-
236
- class MapMoveEndEvent extends PostboyGenericMessage {
237
- constructor(position) {
279
+ /**
280
+ * Represents a command to add a custom control to a map.
281
+ */
282
+ class AddControlCommand extends PostboyGenericMessage {
283
+ /**
284
+ * Creates an instance of the class with the specified MapControl object.
285
+ *
286
+ * @param {MapControl} item - The MapControl object to be associated with the instance.
287
+ */
288
+ constructor(item) {
238
289
  super();
239
- this.position = position;
240
- }
241
- get id() {
242
- return MapMoveEndEvent.ID;
290
+ this.item = item;
243
291
  }
244
- }
245
- MapMoveEndEvent.ID = 'f21f783e-b5af-4489-9fec-8027fd07a8ad';
292
+ }
246
293
 
294
+ /**
295
+ * A command class that represents the action to close a tooltip.
296
+ */
247
297
  class CloseTooltipCommand extends PostboyGenericMessage {
298
+ /**
299
+ * Creates an instance of the class with the specified tooltip ID.
300
+ *
301
+ * @param {string} tooltipId - The unique identifier for the tooltip.
302
+ */
248
303
  constructor(tooltipId) {
249
304
  super();
250
305
  this.tooltipId = tooltipId;
251
306
  }
252
- get id() {
253
- return CloseTooltipCommand.ID;
254
- }
255
- }
256
- CloseTooltipCommand.ID = '4896d52c-e34f-4994-bcfd-32832d12dbe4';
307
+ }
257
308
 
309
+ /**
310
+ * Represents a command to start a drawing operation.
311
+ */
258
312
  class StartDrawingCommand extends PostboyCallbackMessage {
313
+ /**
314
+ * Constructor for creating an instance of the class that represents a drawing feature with specific type, style, and output format.
315
+ *
316
+ * @param {DrawingType} type - The type of the drawing to be created.
317
+ * @param {Style} style - The style defining visual appearance of the drawing.
318
+ * @param {FeatureOutputFormat} [format=FeatureOutputFormat.GeoJson] - The format of the feature output. Defaults to GeoJson.
319
+ */
259
320
  constructor(type, style, format = FeatureOutputFormat.GeoJson) {
260
321
  super();
261
322
  this.type = type;
262
323
  this.style = style;
263
324
  this.format = format;
264
325
  }
265
- get id() {
266
- return StartDrawingCommand.ID;
267
- }
268
- }
269
- StartDrawingCommand.ID = 'da904f4b-a1c8-4db7-a6af-14d9ee18ec8c';
326
+ }
270
327
 
328
+ /**
329
+ * Represents a command to cancel a drawing action.
330
+ */
271
331
  class CancelDrawingCommand extends PostboyGenericMessage {
272
- get id() {
273
- return CancelDrawingCommand.ID;
274
- }
275
- }
276
- CancelDrawingCommand.ID = '7d38d983-feba-4176-a66b-18175e5ecd6b';
332
+ }
277
333
 
334
+ /**
335
+ * Class representing a command to draw a selection area with a specific type and style.
336
+ *
337
+ * @return {Dictionary<IIdentified[]>} - a collection of features inside the selected area, grouped by a layer's name
338
+ */
278
339
  class DrawSelectionAreaCommand extends PostboyCallbackMessage {
340
+ /**
341
+ * Constructs a new instance with the specified type, style, and optional set of ignored items.
342
+ *
343
+ * @param {DrawingType} type - The type of drawing to be created.
344
+ * @param {Style} style - The style information for the drawing.
345
+ * @param {Set<string>} [ignore=new Set<string>()] - Optional set of items to be ignored.
346
+ */
279
347
  constructor(type, style, ignore = new Set()) {
280
348
  super();
281
349
  this.type = type;
282
350
  this.style = style;
283
351
  this.ignore = ignore;
284
352
  }
285
- get id() {
286
- return DrawSelectionAreaCommand.ID;
287
- }
288
- }
289
- DrawSelectionAreaCommand.ID = '573d8a0d-f25b-42b7-9ad7-0ac6d86ac362';
353
+ }
290
354
 
355
+ /**
356
+ * Represents a command to modify a feature with a specific style and output format
357
+ * for a polygonal model.
358
+ *
359
+ * @return {string | null} a string representation of the modified feature in the appropriate format
360
+ */
291
361
  class ModifyFeatureCommand extends PostboyCallbackMessage {
362
+ /**
363
+ * Constructs an instance of the class.
364
+ *
365
+ * @param {PolygonModel} model - The polygon model to be used.
366
+ * @param {Style} style - The style configuration for the polygon.
367
+ * @param {FeatureOutputFormat} [format=FeatureOutputFormat.GeoJson] - The output format of the features. Default is GeoJson.
368
+ */
292
369
  constructor(model, style, format = FeatureOutputFormat.GeoJson) {
293
370
  super();
294
371
  this.model = model;
295
372
  this.style = style;
296
373
  this.format = format;
297
374
  }
298
- get id() {
299
- return ModifyFeatureCommand.ID;
300
- }
301
- }
302
- ModifyFeatureCommand.ID = 'ead85caa-24c6-4844-a68c-2cea91774c8c';
375
+ }
303
376
 
377
+ /**
378
+ * Represents a command to cancel a feature modification.
379
+ */
304
380
  class CancelFeatureModificationCommand extends PostboyGenericMessage {
305
- get id() {
306
- return CancelFeatureModificationCommand.ID;
307
- }
308
- }
309
- CancelFeatureModificationCommand.ID = '9c9fb40f-ea95-4704-8177-0e9ecabf36fa';
310
-
311
- class AddControlCommand extends PostboyGenericMessage {
312
- constructor(item) {
313
- super();
314
- this.item = item;
315
- }
316
- get id() {
317
- return AddControlCommand.ID;
318
- }
319
- }
320
- AddControlCommand.ID = '8e1c06eb-b395-4fe1-929c-ebf0805eeb49';
381
+ }
321
382
 
383
+ /**
384
+ * Represents a command to remove a map control from the map.
385
+ *
386
+ * The command is identified by a unique static ID, and it requires a MapControl item
387
+ * to specify the control to be removed.
388
+ *
389
+ * @extends PostboyGenericMessage
390
+ */
322
391
  class RemoveControlCommand extends PostboyGenericMessage {
392
+ /**
393
+ * Constructs an instance of the class.
394
+ *
395
+ * @param {MapControl} item - The map control instance to be removed.
396
+ */
323
397
  constructor(item) {
324
398
  super();
325
399
  this.item = item;
326
400
  }
327
- get id() {
328
- return RemoveControlCommand.ID;
329
- }
330
- }
331
- RemoveControlCommand.ID = '361641e0-804a-4930-8c27-0cea6330dbfc';
401
+ }
332
402
 
333
403
  /**
334
404
  * Forces map to move to a specific point
@@ -346,34 +416,128 @@ class SetMapCenterCommand extends PostboyGenericMessage {
346
416
  this.lng = lng;
347
417
  this.zoom = zoom;
348
418
  }
349
- get id() {
350
- return SetMapCenterCommand.ID;
419
+ }
420
+
421
+ /**
422
+ * FitToPolygonsCommand is a command used to fit a given set of polygon features
423
+ * to the viewable area, optionally applying a zoom transformation afterwards.
424
+ */
425
+ class FitToPolygonsCommand extends PostboyGenericMessage {
426
+ /**
427
+ * Creates an instance of the class with specified polygon features and an optional zoom level.
428
+ *
429
+ * @param {PolygonModel[]} features - An array of polygon models to fit to.
430
+ * @param {number} [zoomAfter=0] - Optional zoom level change to apply after initialization. Defaults to 0.
431
+ */
432
+ constructor(features, zoomAfter = 0) {
433
+ super();
434
+ this.features = features;
435
+ this.zoomAfter = zoomAfter;
351
436
  }
352
- }
353
- SetMapCenterCommand.ID = 'd50e89c9-6707-4f8c-ab57-65fcef232182';
437
+ }
354
438
 
355
- class CalculateAreaExecutor extends PostboyExecutor {
356
- constructor(polygon) {
439
+ /**
440
+ * Represents an event triggered when a map rendering process is completed.
441
+ */
442
+ class MapRenderedEvent extends PostboyGenericMessage {
443
+ /**
444
+ * Constructor for creating an instance of the class.
445
+ *
446
+ * @param {Map} map - The map instance to be used by the class.
447
+ */
448
+ constructor(map) {
357
449
  super();
358
- this.polygon = polygon;
450
+ this.map = map;
359
451
  }
360
- get id() {
361
- return CalculateAreaExecutor.ID;
452
+ }
453
+
454
+ /**
455
+ * Represents an event triggered by a click on a map, containing information about the
456
+ * click's location, relevant entities, and features present at the clicked position.
457
+ *
458
+ * @extends {PostboyGenericMessage}
459
+ */
460
+ class MapClickEvent extends PostboyGenericMessage {
461
+ /**
462
+ * Creates an instance of this class with the provided coordinates, entities, and features.
463
+ *
464
+ * @param {number[]} coordinates - An array representing the coordinates.
465
+ * @param {{ [layer: string]: IIdentified[] }} entities - A mapping of layer names to arrays of IIdentified entities.
466
+ * @param {{ [layer: string]: Feature<Geometry>[] }} features - A mapping of layer names to arrays of features with geometry.
467
+ */
468
+ constructor(coordinates, entities, features) {
469
+ super();
470
+ this.coordinates = coordinates;
471
+ this.entities = entities;
472
+ this.features = features;
362
473
  }
363
- }
364
- CalculateAreaExecutor.ID = '172ecf46-86b5-4f46-a5f1-96ba2cbb1694';
474
+ }
365
475
 
366
- class FitToPolygonsCommand extends PostboyGenericMessage {
367
- constructor(features, zoomAfter = 0) {
476
+ /**
477
+ * Represents an event that is triggered when the movement of a map ends.
478
+ * This class is used to capture the final position of a map after a movement operation.
479
+ *
480
+ * @property {MapPosition | null} position - The final position of the map after movement ends. Can be null.
481
+ */
482
+ class MapMoveEndEvent extends PostboyGenericMessage {
483
+ constructor(position) {
368
484
  super();
485
+ this.position = position;
486
+ }
487
+ }
488
+
489
+ /**
490
+ * A class responsible for executing filtering of geographical features
491
+ * based on a specific geographical point (latitude and longitude).
492
+ *
493
+ * @template Feature - A geographical feature that is processed by the executor.
494
+ * @template Geometry - The type of geometry associated with the feature.
495
+ */
496
+ class FilterFeaturesInPointExecutor extends PostboyExecutor {
497
+ /**
498
+ * Constructs a new instance with the specified latitude, longitude, and features.
499
+ *
500
+ * @param {number} lat - The latitude coordinate.
501
+ * @param {number} lng - The longitude coordinate.
502
+ * @param {Feature<Geometry>[]} features - The array of features associated with the location.
503
+ */
504
+ constructor(lat, lng, features) {
505
+ super();
506
+ this.lat = lat;
507
+ this.lng = lng;
369
508
  this.features = features;
370
- this.zoomAfter = zoomAfter;
371
509
  }
372
- get id() {
373
- return FitToPolygonsCommand.ID;
510
+ }
511
+
512
+ /**
513
+ * A class that extends the PostboyExecutor to filter geographical features within a specified area.
514
+ * This class is designed to process a list of input features and determine which of them are located inside the provided area geometry.
515
+ *
516
+ * Parameters:
517
+ * - `area`: A Geometry object defining the area to filter geographical features.
518
+ * - `features`: An array of geographical features, represented as `Feature<Geometry>` objects, to be filtered by their presence within the specified area.
519
+ */
520
+ class FilterFeaturesInAreaExecutor extends PostboyExecutor {
521
+ constructor(area, features) {
522
+ super();
523
+ this.area = area;
524
+ this.features = features;
374
525
  }
375
- }
376
- FitToPolygonsCommand.ID = 'a9e42b23-ffaf-4c46-8370-e0432cd14d60';
526
+ }
527
+
528
+ /**
529
+ * An executor responsible for calculating the area of a given polygon.
530
+ *
531
+ * Use this class to manage and execute area-calculation logic for a polygon.
532
+ *
533
+ * @return {number} - the spherical area (in square meters)
534
+ */
535
+ class CalculateAreaExecutor extends PostboyExecutor {
536
+ constructor(polygon) {
537
+ super();
538
+ this.polygon = polygon;
539
+ }
540
+ }
377
541
 
378
542
  /**
379
543
  * A message that allows to get the current state of the map.
@@ -384,79 +548,53 @@ class GetMapPositionExecutor extends PostboyExecutor {
384
548
  constructor() {
385
549
  super();
386
550
  }
387
- get id() {
388
- return GetMapPositionExecutor.ID;
389
- }
390
551
  }
391
552
  GetMapPositionExecutor.ID = '52c95689-d09b-4082-ba58-9183ea96a213';
392
553
 
554
+ /**
555
+ * Class representing a query to get features within a specified geographical area.
556
+ * The query optionally takes a set of layer names to ignore during the operation.
557
+ */
393
558
  class GetFeaturesInAreaQuery extends PostboyCallbackMessage {
559
+ /**
560
+ * Constructor to initialize the object with a Geometry instance and an optional set of strings to ignore.
561
+ *
562
+ * @param {Geometry} area - The Geometry object used to define the area.
563
+ * @param {Set<string>} [ignore] - An optional set of layer names that will be ignored. Defaults to an empty set.
564
+ */
394
565
  constructor(area, ignore = new Set()) {
395
566
  super();
396
567
  this.area = area;
397
568
  this.ignore = ignore;
398
569
  }
399
- get id() {
400
- return GetFeaturesInAreaQuery.ID;
401
- }
402
- }
403
- GetFeaturesInAreaQuery.ID = 'efcf4271-a07a-40e0-9f02-d4dade40b8ac';
404
-
405
- class FilterFeaturesInAreaExecutor extends PostboyExecutor {
406
- constructor(area, features) {
407
- super();
408
- this.area = area;
409
- this.features = features;
410
- }
411
- get id() {
412
- return FilterFeaturesInAreaExecutor.ID;
413
- }
414
- }
415
- FilterFeaturesInAreaExecutor.ID = '36bb2d94-8028-4512-90dd-2386af3fc67c';
570
+ }
416
571
 
417
572
  /**
418
573
  * Represents a query to retrieve features located at a specific geographical point.
419
574
  * The query is defined by latitude, longitude, and an optional set of features to ignore.
420
575
  */
421
576
  class GetFeaturesInPointQuery extends PostboyCallbackMessage {
577
+ /**
578
+ * Constructor for initializing a geographic coordinate object.
579
+ *
580
+ * @param {number} lat - The latitude of the location.
581
+ * @param {number} lng - The longitude of the location.
582
+ * @param {Set<string>} [ignore=new Set<string>()] - An optional set of strings to ignore during processing.
583
+ */
422
584
  constructor(lat, lng, ignore = new Set()) {
423
585
  super();
424
586
  this.lat = lat;
425
587
  this.lng = lng;
426
588
  this.ignore = ignore;
427
589
  }
428
- get id() {
429
- return GetFeaturesInPointQuery.ID;
430
- }
431
- }
432
- GetFeaturesInPointQuery.ID = '7c051c97-bbf1-47eb-baa3-4d1eef6f281f';
433
-
434
- /**
435
- * The FilterFeaturesInPointExecutor class is responsible for filtering features within a given point.
436
- */
437
- class FilterFeaturesInPointExecutor extends PostboyExecutor {
438
- constructor(lat, lng, features) {
439
- super();
440
- this.lat = lat;
441
- this.lng = lng;
442
- this.features = features;
443
- }
444
- get id() {
445
- return FilterFeaturesInPointExecutor.ID;
446
- }
447
- }
448
- FilterFeaturesInPointExecutor.ID = '5b859282-5d5a-47ca-a6ad-863a66c8b82b';
590
+ }
449
591
 
450
592
  class AddLayerCommand extends PostboyGenericMessage {
451
593
  constructor(layer) {
452
594
  super();
453
595
  this.layer = layer;
454
596
  }
455
- get id() {
456
- return AddLayerCommand.ID;
457
- }
458
- }
459
- AddLayerCommand.ID = 'd93e250f-92bc-43ac-9c6a-46c521a1aaa5';
597
+ }
460
598
 
461
599
  class PlaceLayerFeaturesCommand extends PostboyGenericMessage {
462
600
  constructor(layer, features) {
@@ -464,44 +602,28 @@ class PlaceLayerFeaturesCommand extends PostboyGenericMessage {
464
602
  this.layer = layer;
465
603
  this.features = features;
466
604
  }
467
- get id() {
468
- return PlaceLayerFeaturesCommand.ID;
469
- }
470
- }
471
- PlaceLayerFeaturesCommand.ID = '8caf86bc-869b-426f-b36d-4642f6b8aab0';
605
+ }
472
606
 
473
607
  class RemoveLayerCommand extends PostboyGenericMessage {
474
608
  constructor(layer) {
475
609
  super();
476
610
  this.layer = layer;
477
611
  }
478
- get id() {
479
- return RemoveLayerCommand.ID;
480
- }
481
- }
482
- RemoveLayerCommand.ID = 'ab484e0e-e185-45cd-8434-12101f3c7eb1';
612
+ }
483
613
 
484
614
  class AddTileCommand extends PostboyGenericMessage {
485
615
  constructor(layer) {
486
616
  super();
487
617
  this.layer = layer;
488
618
  }
489
- get id() {
490
- return AddTileCommand.ID;
491
- }
492
- }
493
- AddTileCommand.ID = '25b7df28-72ce-4453-9fe6-54285a2fdc57';
619
+ }
494
620
 
495
621
  class RemoveTileCommand extends PostboyGenericMessage {
496
622
  constructor(layer) {
497
623
  super();
498
624
  this.layer = layer;
499
625
  }
500
- get id() {
501
- return RemoveTileCommand.ID;
502
- }
503
- }
504
- RemoveTileCommand.ID = 'c36ccc0b-5638-4819-b148-2de57a59a5b7';
626
+ }
505
627
 
506
628
  class FitToFeaturesCommand extends PostboyGenericMessage {
507
629
  constructor(features, zoomAfter = 0) {
@@ -509,32 +631,17 @@ class FitToFeaturesCommand extends PostboyGenericMessage {
509
631
  this.features = features;
510
632
  this.zoomAfter = zoomAfter;
511
633
  }
512
- get id() {
513
- return FitToFeaturesCommand.ID;
514
- }
515
- }
516
- FitToFeaturesCommand.ID = '76cdc091-3793-4b6c-82f7-1e0334cf08a8';
634
+ }
517
635
 
518
636
  class GetLayerQuery extends PostboyCallbackMessage {
519
637
  constructor(name) {
520
638
  super();
521
639
  this.name = name;
522
640
  }
523
- get id() {
524
- return GetLayerQuery.ID;
525
- }
526
- }
527
- GetLayerQuery.ID = '5c04c87b-8a93-4c2a-979e-d1e313d860ed';
641
+ }
528
642
 
529
643
  class DrawingFinishedEvent extends PostboyGenericMessage {
530
- constructor() {
531
- super();
532
- }
533
- get id() {
534
- return DrawingFinishedEvent.ID;
535
- }
536
- }
537
- DrawingFinishedEvent.ID = 'c724b68e-b4eb-4783-90f1-a8e31973fd36';
644
+ }
538
645
 
539
646
  class DrawingGenerationService {
540
647
  static getDraw(ev) {
@@ -589,22 +696,14 @@ class GenerateDrawExecutor extends PostboyExecutor {
589
696
  this.style = style;
590
697
  this.type = type;
591
698
  }
592
- get id() {
593
- return GenerateDrawExecutor.ID;
594
- }
595
- }
596
- GenerateDrawExecutor.ID = 'f01c99ba-0953-4ab5-82f9-04e6fbb678c1';
699
+ }
597
700
 
598
701
  class GenerateZoomControlExecutor extends PostboyExecutor {
599
702
  constructor(settings) {
600
703
  super();
601
704
  this.settings = settings;
602
705
  }
603
- get id() {
604
- return GenerateZoomControlExecutor.ID;
605
- }
606
- }
607
- GenerateZoomControlExecutor.ID = 'ff16a833-c68e-4b1a-bc23-c0d16b002810';
706
+ }
608
707
 
609
708
  class ZoomControlFactory {
610
709
  static build(settings) {
@@ -621,7 +720,11 @@ class ZoomControlFactory {
621
720
  class MapPostboyService extends PostboyService {
622
721
  constructor() {
623
722
  super();
624
- this.addLocker({ locker: StartDrawingCommand.ID, unlocker: DrawingFinishedEvent.ID, locking: [MapClickEvent.ID] });
723
+ this.addLocker({
724
+ locker: StartDrawingCommand.name,
725
+ unlocker: DrawingFinishedEvent.name,
726
+ locking: [MapClickEvent.name],
727
+ });
625
728
  }
626
729
  }
627
730
  MapPostboyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapPostboyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
@@ -647,29 +750,29 @@ class MapManagementService {
647
750
  this.observeFeaturesInPoint();
648
751
  }
649
752
  observeRemoveTile() {
650
- this.postboy.subscribe(RemoveTileCommand.ID).subscribe((c) => {
753
+ this.postboy.sub(RemoveTileCommand).subscribe((c) => {
651
754
  if (!this.map)
652
755
  return;
653
756
  this.map.removeLayer(c.layer);
654
757
  });
655
758
  }
656
759
  observeLayerQuery() {
657
- this.postboy.subscribe(GetLayerQuery.ID).subscribe((ev) => ev.finish(this.layers.take(ev.name)));
760
+ this.postboy.sub(GetLayerQuery).subscribe((ev) => ev.finish(this.layers.take(ev.name)));
658
761
  }
659
762
  observeAddTile() {
660
- this.postboy.subscribe(AddTileCommand.ID).subscribe((c) => {
763
+ this.postboy.sub(AddTileCommand).subscribe((c) => {
661
764
  if (!this.map)
662
765
  return;
663
766
  this.map.addLayer(c.layer);
664
767
  });
665
768
  }
666
769
  observeMapRender() {
667
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
770
+ this.postboy.sub(MapRenderedEvent).subscribe((m) => {
668
771
  this.map = m.map;
669
772
  });
670
773
  }
671
774
  observeAddLayer() {
672
- this.postboy.subscribe(AddLayerCommand.ID).subscribe((c) => {
775
+ this.postboy.sub(AddLayerCommand).subscribe((c) => {
673
776
  if (!this.map)
674
777
  return;
675
778
  this.layers.put(c.layer.get('name'), c.layer);
@@ -677,7 +780,7 @@ class MapManagementService {
677
780
  });
678
781
  }
679
782
  observePlaceFeatures() {
680
- this.postboy.subscribe(PlaceLayerFeaturesCommand.ID).subscribe((c) => {
783
+ this.postboy.sub(PlaceLayerFeaturesCommand).subscribe((c) => {
681
784
  var _a, _b;
682
785
  if (!this.layers.has(c.layer))
683
786
  return;
@@ -689,7 +792,7 @@ class MapManagementService {
689
792
  });
690
793
  }
691
794
  observeRemoveLayer() {
692
- this.postboy.subscribe(RemoveLayerCommand.ID).subscribe((c) => {
795
+ this.postboy.sub(RemoveLayerCommand).subscribe((c) => {
693
796
  if (!this.map)
694
797
  return;
695
798
  this.layers.rmv(c.layer.get('name'));
@@ -697,22 +800,22 @@ class MapManagementService {
697
800
  });
698
801
  }
699
802
  observeFeaturesInArea() {
700
- this.postboy.subscribe(GetFeaturesInAreaQuery.ID).subscribe((qr) => {
803
+ this.postboy.sub(GetFeaturesInAreaQuery).subscribe((qr) => {
701
804
  let result = new Dictionary();
702
805
  this.forEachLayer((l, s) => {
703
806
  var _a;
704
- let features = this.postboy.execute(new FilterFeaturesInAreaExecutor(qr.area, (_a = s === null || s === void 0 ? void 0 : s.getFeatures()) !== null && _a !== void 0 ? _a : []));
807
+ let features = this.postboy.exec(new FilterFeaturesInAreaExecutor(qr.area, (_a = s === null || s === void 0 ? void 0 : s.getFeatures()) !== null && _a !== void 0 ? _a : []));
705
808
  result.put(l.get('name'), features.map((e) => (Object.assign({ id: e.getId() }, e.get(MapConstants.FeatureInfo)))));
706
809
  }, qr.ignore);
707
810
  qr.finish(result);
708
811
  });
709
812
  }
710
813
  observeFeaturesInPoint() {
711
- this.postboy.subscribe(GetFeaturesInPointQuery.ID).subscribe((qr) => {
814
+ this.postboy.sub(GetFeaturesInPointQuery).subscribe((qr) => {
712
815
  let result = new Dictionary();
713
816
  this.forEachLayer((l, s) => {
714
817
  var _a;
715
- let features = this.postboy.execute(new FilterFeaturesInPointExecutor(qr.lat, qr.lng, (_a = s === null || s === void 0 ? void 0 : s.getFeatures()) !== null && _a !== void 0 ? _a : []));
818
+ let features = this.postboy.exec(new FilterFeaturesInPointExecutor(qr.lat, qr.lng, (_a = s === null || s === void 0 ? void 0 : s.getFeatures()) !== null && _a !== void 0 ? _a : []));
716
819
  result.put(l.get('name'), features.map((e) => (Object.assign({ id: e.getId() }, e.get(MapConstants.FeatureInfo)))));
717
820
  }, qr.ignore);
718
821
  qr.finish(result);
@@ -755,7 +858,7 @@ class MapStateService {
755
858
  }
756
859
  observeMapRendering() {
757
860
  this.postboy
758
- .subscribe(MapRenderedEvent.ID)
861
+ .sub(MapRenderedEvent)
759
862
  .pipe(first())
760
863
  .subscribe((ev) => {
761
864
  var _a;
@@ -766,7 +869,7 @@ class MapStateService {
766
869
  });
767
870
  }
768
871
  observeCenter() {
769
- this.postboy.subscribe(SetMapCenterCommand.ID).subscribe((c) => {
872
+ this.postboy.sub(SetMapCenterCommand).subscribe((c) => {
770
873
  var _a, _b;
771
874
  (_a = this.map) === null || _a === void 0 ? void 0 : _a.getView().setCenter([c.lng, c.lat]);
772
875
  if (c.zoom)
@@ -790,19 +893,19 @@ class MapFeatureService {
790
893
  this.observeFitToPolygons();
791
894
  }
792
895
  observeMapRender() {
793
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
896
+ this.postboy.sub(MapRenderedEvent).subscribe((m) => {
794
897
  this.map = m.map;
795
898
  if (this.fitPolygonsWaiting)
796
899
  this.postboy.fire(this.fitPolygonsWaiting);
797
900
  });
798
901
  }
799
902
  observeFitToFeatures() {
800
- this.postboy.subscribe(FitToFeaturesCommand.ID).subscribe((cmd) => {
903
+ this.postboy.sub(FitToFeaturesCommand).subscribe((cmd) => {
801
904
  this.fitToGeometries(cmd.features.map((f) => f.getGeometry()), cmd.zoomAfter);
802
905
  });
803
906
  }
804
907
  observeFitToPolygons() {
805
- this.postboy.subscribe(FitToPolygonsCommand.ID).subscribe((cmd) => {
908
+ this.postboy.sub(FitToPolygonsCommand).subscribe((cmd) => {
806
909
  if (!this.map) {
807
910
  this.fitPolygonsWaiting = cmd;
808
911
  return;
@@ -852,7 +955,7 @@ class MapClickService {
852
955
  return model;
853
956
  }
854
957
  observeMapRender() {
855
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
958
+ this.postboy.sub(MapRenderedEvent).subscribe((m) => {
856
959
  var _a;
857
960
  this.map = m.map;
858
961
  (_a = this.map) === null || _a === void 0 ? void 0 : _a.on('singleclick', (e) => {
@@ -885,23 +988,19 @@ class DrawingService {
885
988
  this.observeMapRender();
886
989
  }
887
990
  observeSelectArea() {
888
- this.postboy.subscribe(DrawSelectionAreaCommand.ID).subscribe((ev) => {
889
- const drawingCommand = new StartDrawingCommand(ev.type, ev.style);
890
- drawingCommand.result.subscribe((r) => {
991
+ this.postboy.sub(DrawSelectionAreaCommand).subscribe((ev) => {
992
+ this.postboy.fireCallback(new StartDrawingCommand(ev.type, ev.style), (r) => {
891
993
  if (!r) {
892
994
  ev.finish(new Dictionary());
893
995
  return;
894
996
  }
895
997
  const area = PolygonModel.fromGeoJson(1, r).feature.getGeometry();
896
- const getFeaturesCommand = new GetFeaturesInAreaQuery(area, ev.ignore);
897
- getFeaturesCommand.result.subscribe((result) => ev.finish(result));
898
- this.postboy.fire(getFeaturesCommand);
998
+ this.postboy.fireCallback(new GetFeaturesInAreaQuery(area, ev.ignore), (result) => ev.finish(result));
899
999
  });
900
- this.postboy.fire(drawingCommand);
901
1000
  });
902
1001
  }
903
1002
  observeDrawing() {
904
- this.postboy.subscribe(StartDrawingCommand.ID).subscribe((ev) => {
1003
+ this.postboy.sub(StartDrawingCommand).subscribe((ev) => {
905
1004
  this.draw((l) => {
906
1005
  var _a;
907
1006
  if (!l || !this.map) {
@@ -909,7 +1008,7 @@ class DrawingService {
909
1008
  return;
910
1009
  }
911
1010
  const cancelSub = this.observeCancelation(ev, l);
912
- this.drawInteraction = this.postboy.execute(new GenerateDrawExecutor(l, ev.style, ev.type));
1011
+ this.drawInteraction = this.postboy.exec(new GenerateDrawExecutor(l, ev.style, ev.type));
913
1012
  (_a = this.map) === null || _a === void 0 ? void 0 : _a.addInteraction(this.drawInteraction);
914
1013
  this.drawInteraction.on('drawend', (evt) => {
915
1014
  cancelSub.unsubscribe();
@@ -925,18 +1024,16 @@ class DrawingService {
925
1024
  this.clearInteraction(layer);
926
1025
  }
927
1026
  observeMapRender() {
928
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
1027
+ this.postboy.sub(MapRenderedEvent).subscribe((m) => {
929
1028
  this.map = m.map;
930
1029
  });
931
1030
  }
932
1031
  draw(action) {
933
- const query = new GetLayerQuery(MapConstants.DrawingLayerId);
934
- query.result.subscribe((l) => action(l));
935
- this.postboy.fire(query);
1032
+ this.postboy.fireCallback(new GetLayerQuery(MapConstants.DrawingLayerId), (l) => action(l));
936
1033
  }
937
1034
  observeCancelation(ev, layer) {
938
1035
  return this.postboy
939
- .subscribe(CancelDrawingCommand.ID)
1036
+ .sub(CancelDrawingCommand)
940
1037
  .pipe(first())
941
1038
  .subscribe(() => {
942
1039
  ev.finish(null);
@@ -967,7 +1064,7 @@ class FeatureModificationService {
967
1064
  this.observeMapRender();
968
1065
  }
969
1066
  observeModification() {
970
- this.postboy.subscribe(ModifyFeatureCommand.ID).subscribe((ev) => {
1067
+ this.postboy.sub(ModifyFeatureCommand).subscribe((ev) => {
971
1068
  this.defineLayer((l) => {
972
1069
  if (!l || !this.map) {
973
1070
  this.clearInteraction(l);
@@ -1017,18 +1114,16 @@ class FeatureModificationService {
1017
1114
  : new WKT().writeFeature(command.model.feature));
1018
1115
  }
1019
1116
  observeMapRender() {
1020
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
1117
+ this.postboy.sub(MapRenderedEvent).subscribe((m) => {
1021
1118
  this.map = m.map;
1022
1119
  });
1023
1120
  }
1024
1121
  defineLayer(action) {
1025
- const query = new GetLayerQuery(MapConstants.DrawingLayerId);
1026
- query.result.subscribe((l) => action(l));
1027
- this.postboy.fire(query);
1122
+ this.postboy.fireCallback(new GetLayerQuery(MapConstants.DrawingLayerId), (l) => action(l));
1028
1123
  }
1029
1124
  observeCancelation(ev, layer) {
1030
1125
  return this.postboy
1031
- .subscribe(CancelFeatureModificationCommand.ID)
1126
+ .sub(CancelFeatureModificationCommand)
1032
1127
  .pipe(first())
1033
1128
  .subscribe(() => {
1034
1129
  ev.finish(null);
@@ -1058,7 +1153,7 @@ class ControlsService {
1058
1153
  }
1059
1154
  observeMapRender() {
1060
1155
  this.postboy
1061
- .subscribe(MapRenderedEvent.ID)
1156
+ .sub(MapRenderedEvent)
1062
1157
  .pipe(first())
1063
1158
  .subscribe((m) => {
1064
1159
  this.map = m.map;
@@ -1067,12 +1162,10 @@ class ControlsService {
1067
1162
  });
1068
1163
  }
1069
1164
  observeAdding() {
1070
- this.postboy.subscribe(AddControlCommand.ID).subscribe((c) => { var _a; return (_a = this.map) === null || _a === void 0 ? void 0 : _a.addControl(c.item); });
1165
+ this.postboy.sub(AddControlCommand).subscribe((c) => { var _a; return (_a = this.map) === null || _a === void 0 ? void 0 : _a.addControl(c.item); });
1071
1166
  }
1072
1167
  observeRemoving() {
1073
- this.postboy
1074
- .subscribe(RemoveControlCommand.ID)
1075
- .subscribe((c) => { var _a; return (_a = this.map) === null || _a === void 0 ? void 0 : _a.removeControl(c.item); });
1168
+ this.postboy.sub(RemoveControlCommand).subscribe((c) => { var _a; return (_a = this.map) === null || _a === void 0 ? void 0 : _a.removeControl(c.item); });
1076
1169
  }
1077
1170
  }
1078
1171
  ControlsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ControlsService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
@@ -1088,38 +1181,38 @@ class MessageRegistratorService extends PostboyAbstractRegistrator {
1088
1181
  this.registerServices([management, state, interaction, mapFeature, drawing, featureModification, controls]);
1089
1182
  }
1090
1183
  _up() {
1091
- this.registerReplay(MapRenderedEvent.ID);
1092
- this.registerReplay(PlaceLayerFeaturesCommand.ID);
1093
- this.registerReplay(RemoveControlCommand.ID);
1094
- this.registerReplay(AddControlCommand.ID);
1095
- this.registerReplay(SetMapCenterCommand.ID);
1096
- this.registerSubject(AddLayerCommand.ID);
1097
- this.registerSubject(RemoveLayerCommand.ID);
1098
- this.registerSubject(AddTileCommand.ID);
1099
- this.registerSubject(RemoveTileCommand.ID);
1100
- this.registerSubject(MapClickEvent.ID);
1101
- this.registerSubject(CloseTooltipCommand.ID);
1102
- this.registerSubject(FitToFeaturesCommand.ID);
1103
- this.registerSubject(FitToPolygonsCommand.ID);
1104
- this.registerSubject(MapMoveEndEvent.ID);
1105
- this.registerSubject(CancelDrawingCommand.ID);
1106
- this.registerSubject(StartDrawingCommand.ID);
1107
- this.registerSubject(GetLayerQuery.ID);
1108
- this.registerSubject(DrawingFinishedEvent.ID);
1109
- this.registerSubject(GetFeaturesInAreaQuery.ID);
1110
- this.registerSubject(DrawSelectionAreaCommand.ID);
1111
- this.registerSubject(CancelFeatureModificationCommand.ID);
1112
- this.registerSubject(ModifyFeatureCommand.ID);
1113
- this.registerSubject(GetFeaturesInPointQuery.ID);
1184
+ this.recordReplay(MapRenderedEvent);
1185
+ this.recordReplay(PlaceLayerFeaturesCommand);
1186
+ this.recordReplay(RemoveControlCommand);
1187
+ this.recordReplay(AddControlCommand);
1188
+ this.recordReplay(SetMapCenterCommand);
1189
+ this.recordSubject(AddLayerCommand);
1190
+ this.recordSubject(RemoveLayerCommand);
1191
+ this.recordSubject(AddTileCommand);
1192
+ this.recordSubject(RemoveTileCommand);
1193
+ this.recordSubject(MapClickEvent);
1194
+ this.recordSubject(CloseTooltipCommand);
1195
+ this.recordSubject(FitToFeaturesCommand);
1196
+ this.recordSubject(FitToPolygonsCommand);
1197
+ this.recordSubject(MapMoveEndEvent);
1198
+ this.recordSubject(CancelDrawingCommand);
1199
+ this.recordSubject(StartDrawingCommand);
1200
+ this.recordSubject(GetLayerQuery);
1201
+ this.recordSubject(DrawingFinishedEvent);
1202
+ this.recordSubject(GetFeaturesInAreaQuery);
1203
+ this.recordSubject(DrawSelectionAreaCommand);
1204
+ this.recordSubject(CancelFeatureModificationCommand);
1205
+ this.recordSubject(ModifyFeatureCommand);
1206
+ this.recordSubject(GetFeaturesInPointQuery);
1114
1207
  this.setExecutors();
1115
1208
  }
1116
1209
  setExecutors() {
1117
- this.registerExecutor(FilterFeaturesInAreaExecutor.ID, (e) => FeatureService.filterFeaturesInArea(e));
1118
- this.registerExecutor(FilterFeaturesInPointExecutor.ID, (e) => FeatureService.filterFeaturesInPoint(e));
1119
- this.registerExecutor(CalculateAreaExecutor.ID, (e) => { var _a, _b; return FeatureService.calculateArea((_b = (_a = e.polygon) === null || _a === void 0 ? void 0 : _a.feature) === null || _b === void 0 ? void 0 : _b.getGeometry()); });
1120
- this.registerExecutor(GenerateDrawExecutor.ID, (e) => DrawingGenerationService.getDraw(e));
1121
- this.registerExecutor(GenerateZoomControlExecutor.ID, (e) => ZoomControlFactory.build(e.settings));
1122
- this.registerExecutor(GetMapPositionExecutor.ID, () => this.state.getMapPosition());
1210
+ this.recordExecutor(FilterFeaturesInAreaExecutor, (e) => FeatureService.filterFeaturesInArea(e));
1211
+ this.recordExecutor(FilterFeaturesInPointExecutor, (e) => FeatureService.filterFeaturesInPoint(e));
1212
+ this.recordExecutor(CalculateAreaExecutor, (e) => { var _a, _b; return FeatureService.calculateArea((_b = (_a = e.polygon) === null || _a === void 0 ? void 0 : _a.feature) === null || _b === void 0 ? void 0 : _b.getGeometry()); });
1213
+ this.recordExecutor(GenerateDrawExecutor, (e) => DrawingGenerationService.getDraw(e));
1214
+ this.recordExecutor(GenerateZoomControlExecutor, (e) => ZoomControlFactory.build(e.settings));
1215
+ this.recordExecutor(GetMapPositionExecutor, () => this.state.getMapPosition());
1123
1216
  }
1124
1217
  }
1125
1218
  MessageRegistratorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", 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 });
@@ -1348,7 +1441,7 @@ class TileLayerComponent extends DestructibleComponent {
1348
1441
  }
1349
1442
  ngOnInit() {
1350
1443
  this.postboy
1351
- .subscribe(MapRenderedEvent.ID)
1444
+ .sub(MapRenderedEvent)
1352
1445
  .pipe(filter((m) => !!m), first())
1353
1446
  .subscribe((m) => this.initLayer());
1354
1447
  }
@@ -1582,7 +1675,7 @@ class FeatureLayerComponent extends DestructibleComponent {
1582
1675
  }
1583
1676
  ngOnInit() {
1584
1677
  this.postboy
1585
- .subscribe(MapRenderedEvent.ID)
1678
+ .sub(MapRenderedEvent)
1586
1679
  .pipe(filter((m) => !!m), first())
1587
1680
  .subscribe((m) => this.initLayer());
1588
1681
  }
@@ -1765,14 +1858,14 @@ class ClusterLayerManager {
1765
1858
  }
1766
1859
  observeMapMovement() {
1767
1860
  combineLatest([
1768
- this.postboy.subscribe(MapMoveEndEvent.ID).pipe(auditTime(250)),
1769
- this.postboy.subscribe(MapRenderedEvent.ID),
1861
+ this.postboy.sub(MapMoveEndEvent).pipe(auditTime(250)),
1862
+ this.postboy.sub(MapRenderedEvent),
1770
1863
  ]).subscribe(([movement, renderEvent]) => {
1771
1864
  this.checkClusterNecessity(renderEvent.map);
1772
1865
  });
1773
1866
  }
1774
1867
  observeClick() {
1775
- this.postboy.subscribe(MapClickEvent.ID).subscribe((m) => {
1868
+ this.postboy.sub(MapClickEvent).subscribe((m) => {
1776
1869
  var _a, _b;
1777
1870
  if (((_b = (_a = m.features[this.settings.name]) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 1) {
1778
1871
  this.postboy.fire(new FitToFeaturesCommand(m.features[this.settings.name], -1));
@@ -1863,7 +1956,7 @@ class ClusterLayerComponent extends DestructibleComponent {
1863
1956
  }
1864
1957
  ngOnInit() {
1865
1958
  this.postboy
1866
- .subscribe(MapRenderedEvent.ID)
1959
+ .sub(MapRenderedEvent)
1867
1960
  .pipe(filter((m) => !!m), first())
1868
1961
  .subscribe((m) => this.initLayer());
1869
1962
  }
@@ -2016,7 +2109,7 @@ class MarkersComponent extends DestructibleComponent {
2016
2109
  }
2017
2110
  ngOnInit() {
2018
2111
  this.postboy
2019
- .subscribe(MapRenderedEvent.ID)
2112
+ .sub(MapRenderedEvent)
2020
2113
  .pipe(filter((m) => !!m), first())
2021
2114
  .subscribe(() => this.putMarkers());
2022
2115
  }
@@ -2113,18 +2206,18 @@ class TooltipComponent extends DestructibleComponent {
2113
2206
  this.detector.detectChanges();
2114
2207
  }
2115
2208
  observeMapClick() {
2116
- return this.postboy.subscribe(MapClickEvent.ID).subscribe((ev) => {
2209
+ return this.postboy.sub(MapClickEvent).subscribe((ev) => {
2117
2210
  this._settings.show(ev) ? this.addOverlay(ev.coordinates) : this.removeOverlay();
2118
2211
  });
2119
2212
  }
2120
2213
  observeClose() {
2121
2214
  return this.postboy
2122
- .subscribe(CloseTooltipCommand.ID)
2215
+ .sub(CloseTooltipCommand)
2123
2216
  .pipe(filter((ev) => ev.tooltipId === this._settings.id))
2124
2217
  .subscribe(() => this.removeOverlay());
2125
2218
  }
2126
2219
  observeMapRender() {
2127
- return this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
2220
+ return this.postboy.sub(MapRenderedEvent).subscribe((m) => {
2128
2221
  this.map = m.map;
2129
2222
  });
2130
2223
  }
@@ -2169,7 +2262,7 @@ class PolygonsComponent extends DestructibleComponent {
2169
2262
  }
2170
2263
  ngOnInit() {
2171
2264
  this.postboy
2172
- .subscribe(MapRenderedEvent.ID)
2265
+ .sub(MapRenderedEvent)
2173
2266
  .pipe(filter((m) => !!m), first())
2174
2267
  .subscribe(() => this.putPolygons());
2175
2268
  }
@@ -2348,7 +2441,7 @@ class MapControlZoomComponent extends DestructibleComponent {
2348
2441
  }
2349
2442
  ngOnInit() {
2350
2443
  this.postboy
2351
- .subscribe(MapRenderedEvent.ID)
2444
+ .sub(MapRenderedEvent)
2352
2445
  .pipe(filter((m) => !!m), first())
2353
2446
  .subscribe((m) => {
2354
2447
  this.map = m.map;
@@ -2358,7 +2451,7 @@ class MapControlZoomComponent extends DestructibleComponent {
2358
2451
  setControl() {
2359
2452
  if (!this.map)
2360
2453
  return;
2361
- this.control = this.postboy.execute(new GenerateZoomControlExecutor(this._settings));
2454
+ this.control = this.postboy.exec(new GenerateZoomControlExecutor(this._settings));
2362
2455
  this.map.addControl(this.control);
2363
2456
  }
2364
2457
  }