@artstesh/maps 5.1.6 → 6.0.1

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 (342) hide show
  1. package/README.md +13 -13
  2. package/dist/README.md +24 -24
  3. package/dist/esm2022/map/common/destructible.component.mjs +18 -18
  4. package/dist/esm2022/map/common/id.generator.mjs +14 -14
  5. package/dist/esm2022/map/helpers/index.mjs +4 -4
  6. package/dist/esm2022/map/helpers/marker-style.helper.mjs +28 -28
  7. package/dist/esm2022/map/helpers/polygon-style.helper.mjs +32 -32
  8. package/dist/esm2022/map/helpers/stringify-feature.helper.mjs +58 -58
  9. package/dist/esm2022/map/helpers/text-style.helper.mjs +13 -13
  10. package/dist/esm2022/map/map-plate/controls/index.mjs +2 -2
  11. package/dist/esm2022/map/map-plate/controls/map-control-zoom/map-control-zoom.component.mjs +52 -52
  12. package/dist/esm2022/map/map-plate/controls/map-control-zoom/zoom-control.factory.mjs +12 -12
  13. package/dist/esm2022/map/map-plate/controls/map-control-zoom/zoom-control.settings.mjs +44 -44
  14. package/dist/esm2022/map/map-plate/features/index.mjs +2 -2
  15. package/dist/esm2022/map/map-plate/features/markers/markers.component.mjs +42 -42
  16. package/dist/esm2022/map/map-plate/features/polygons/polygons.component.mjs +42 -42
  17. package/dist/esm2022/map/map-plate/layers/cluster-layer/cluster-layer-factory.service.mjs +59 -59
  18. package/dist/esm2022/map/map-plate/layers/cluster-layer/cluster-layer.component.mjs +52 -52
  19. package/dist/esm2022/map/map-plate/layers/cluster-layer/cluster-layer.manager.mjs +38 -38
  20. package/dist/esm2022/map/map-plate/layers/cluster-layer/cluster-layer.settings.mjs +66 -66
  21. package/dist/esm2022/map/map-plate/layers/feature-layer/feature-layer.component.mjs +52 -52
  22. package/dist/esm2022/map/map-plate/layers/feature-layer/feature-layer.factory.mjs +28 -28
  23. package/dist/esm2022/map/map-plate/layers/feature-layer/feature-layer.settings.mjs +91 -91
  24. package/dist/esm2022/map/map-plate/layers/index.mjs +7 -7
  25. package/dist/esm2022/map/map-plate/layers/osm-tile-layer/osm-tile-layer.component.mjs +57 -57
  26. package/dist/esm2022/map/map-plate/layers/tile-layer/tile-layer.component.mjs +52 -52
  27. package/dist/esm2022/map/map-plate/layers/tile-layer/tile-layer.factory.mjs +50 -50
  28. package/dist/esm2022/map/map-plate/layers/tile-layer/tile-layer.settings.mjs +44 -44
  29. package/dist/esm2022/map/map-plate/map-plate.component.mjs +102 -102
  30. package/dist/esm2022/map/map-plate/map-plate.factory.service.mjs +27 -27
  31. package/dist/esm2022/map/map-plate/tooltips/index.mjs +2 -2
  32. package/dist/esm2022/map/map-plate/tooltips/tooltip/tooltip.component.mjs +81 -81
  33. package/dist/esm2022/map/map-plate/tooltips/tooltip/tooltip.settings.mjs +30 -30
  34. package/dist/esm2022/map/map.module.mjs +63 -63
  35. package/dist/esm2022/map/messages/commands/add-control.command.mjs +12 -12
  36. package/dist/esm2022/map/messages/commands/add-layer.command.mjs +12 -12
  37. package/dist/esm2022/map/messages/commands/add-tile.command.mjs +12 -12
  38. package/dist/esm2022/map/messages/commands/cancel-drawing.command.mjs +7 -7
  39. package/dist/esm2022/map/messages/commands/cancel-feature-modification.command.mjs +7 -7
  40. package/dist/esm2022/map/messages/commands/close-tooltip.command.mjs +12 -12
  41. package/dist/esm2022/map/messages/commands/draw-selection-area.command.mjs +17 -17
  42. package/dist/esm2022/map/messages/commands/fit-to-features.command.mjs +14 -14
  43. package/dist/esm2022/map/messages/commands/fit-to-polygons.command.mjs +15 -0
  44. package/dist/esm2022/map/messages/commands/modify-feature.command.mjs +17 -17
  45. package/dist/esm2022/map/messages/commands/place-layer-features.command.mjs +14 -14
  46. package/dist/esm2022/map/messages/commands/remove-control.command.mjs +12 -12
  47. package/dist/esm2022/map/messages/commands/remove-layer.command.mjs +12 -12
  48. package/dist/esm2022/map/messages/commands/remove-tile.command.mjs +12 -12
  49. package/dist/esm2022/map/messages/commands/set-map-center.command.mjs +25 -25
  50. package/dist/esm2022/map/messages/commands/start-drawing.command.mjs +17 -17
  51. package/dist/esm2022/map/messages/events/drawing-finished.event.mjs +10 -10
  52. package/dist/esm2022/map/messages/events/map-click.event.mjs +16 -16
  53. package/dist/esm2022/map/messages/events/map-move-end.event.mjs +14 -14
  54. package/dist/esm2022/map/messages/events/map-rendered.event.mjs +12 -12
  55. package/dist/esm2022/map/messages/executors/calculate-area.executor.mjs +12 -12
  56. package/dist/esm2022/map/messages/executors/filter-features-in-area.executor.mjs +14 -14
  57. package/dist/esm2022/map/messages/executors/generate-draw.executor.mjs +16 -16
  58. package/dist/esm2022/map/messages/executors/generate-zoom-control.executor.mjs +12 -12
  59. package/dist/esm2022/map/messages/index.mjs +15 -14
  60. package/dist/esm2022/map/messages/queries/get-features-in-area.query.mjs +15 -15
  61. package/dist/esm2022/map/messages/queries/get-layer.query.mjs +12 -12
  62. package/dist/esm2022/map/models/drawing-type.enum.mjs +7 -7
  63. package/dist/esm2022/map/models/feature-format.enum.mjs +5 -5
  64. package/dist/esm2022/map/models/i-identified.mjs +1 -1
  65. package/dist/esm2022/map/models/index.mjs +8 -9
  66. package/dist/esm2022/map/models/map-control.mjs +14 -14
  67. package/dist/esm2022/map/models/map-lyrs.enum.mjs +18 -18
  68. package/dist/esm2022/map/models/map-settings.mjs +50 -50
  69. package/dist/esm2022/map/models/map.constants.mjs +4 -4
  70. package/dist/esm2022/map/models/marker-model.mjs +28 -28
  71. package/dist/esm2022/map/models/polygon.model.mjs +32 -32
  72. package/dist/esm2022/map/public-api.mjs +15 -15
  73. package/dist/esm2022/map/services/controls/controls.service.mjs +39 -39
  74. package/dist/esm2022/map/services/drawing/drawing-generation.service.mjs +25 -25
  75. package/dist/esm2022/map/services/drawing/drawing.service.mjs +101 -100
  76. package/dist/esm2022/map/services/drawing/feature-modification.service.mjs +103 -103
  77. package/dist/esm2022/map/services/feature.service.mjs +21 -21
  78. package/dist/esm2022/map/services/map-click.service.mjs +55 -55
  79. package/dist/esm2022/map/services/map-feature.service.mjs +55 -41
  80. package/dist/esm2022/map/services/map-management.service.mjs +103 -103
  81. package/dist/esm2022/map/services/map-postboy.service.mjs +18 -18
  82. package/dist/esm2022/map/services/map-state.service.mjs +43 -43
  83. package/dist/esm2022/map/services/message-registrator.service.mjs +82 -81
  84. package/dist/esm2022/maps-components.mjs +4 -4
  85. package/dist/esm2022/public-api.mjs +4 -4
  86. package/dist/esm2022/src/map/common/destructible.component.mjs +18 -18
  87. package/dist/esm2022/src/map/common/id.generator.mjs +14 -14
  88. package/dist/esm2022/src/map/helpers/index.mjs +4 -4
  89. package/dist/esm2022/src/map/helpers/marker-style.helper.mjs +28 -28
  90. package/dist/esm2022/src/map/helpers/polygon-style.helper.mjs +32 -32
  91. package/dist/esm2022/src/map/helpers/stringify-feature.helper.mjs +58 -58
  92. package/dist/esm2022/src/map/helpers/text-style.helper.mjs +13 -13
  93. package/dist/esm2022/src/map/map-plate/controls/index.mjs +2 -2
  94. package/dist/esm2022/src/map/map-plate/controls/map-control-zoom/map-control-zoom.component.mjs +52 -52
  95. package/dist/esm2022/src/map/map-plate/controls/map-control-zoom/zoom-control.factory.mjs +12 -12
  96. package/dist/esm2022/src/map/map-plate/controls/map-control-zoom/zoom-control.settings.mjs +44 -44
  97. package/dist/esm2022/src/map/map-plate/features/index.mjs +2 -2
  98. package/dist/esm2022/src/map/map-plate/features/markers/markers.component.mjs +42 -42
  99. package/dist/esm2022/src/map/map-plate/features/polygons/polygons.component.mjs +42 -42
  100. package/dist/esm2022/src/map/map-plate/layers/cluster-layer/cluster-layer-factory.service.mjs +59 -59
  101. package/dist/esm2022/src/map/map-plate/layers/cluster-layer/cluster-layer.component.mjs +52 -52
  102. package/dist/esm2022/src/map/map-plate/layers/cluster-layer/cluster-layer.manager.mjs +38 -38
  103. package/dist/esm2022/src/map/map-plate/layers/cluster-layer/cluster-layer.settings.mjs +66 -66
  104. package/dist/esm2022/src/map/map-plate/layers/feature-layer/feature-layer.component.mjs +52 -52
  105. package/dist/esm2022/src/map/map-plate/layers/feature-layer/feature-layer.factory.mjs +28 -28
  106. package/dist/esm2022/src/map/map-plate/layers/feature-layer/feature-layer.settings.mjs +91 -91
  107. package/dist/esm2022/src/map/map-plate/layers/index.mjs +7 -7
  108. package/dist/esm2022/src/map/map-plate/layers/osm-tile-layer/osm-tile-layer.component.mjs +57 -57
  109. package/dist/esm2022/src/map/map-plate/layers/tile-layer/tile-layer.component.mjs +52 -52
  110. package/dist/esm2022/src/map/map-plate/layers/tile-layer/tile-layer.factory.mjs +50 -50
  111. package/dist/esm2022/src/map/map-plate/layers/tile-layer/tile-layer.settings.mjs +44 -44
  112. package/dist/esm2022/src/map/map-plate/map-plate.component.mjs +102 -102
  113. package/dist/esm2022/src/map/map-plate/map-plate.factory.service.mjs +27 -27
  114. package/dist/esm2022/src/map/map-plate/tooltips/index.mjs +2 -2
  115. package/dist/esm2022/src/map/map-plate/tooltips/tooltip/tooltip.component.mjs +81 -81
  116. package/dist/esm2022/src/map/map-plate/tooltips/tooltip/tooltip.settings.mjs +30 -30
  117. package/dist/esm2022/src/map/map.module.mjs +63 -63
  118. package/dist/esm2022/src/map/maps-components-src-map.mjs +4 -4
  119. package/dist/esm2022/src/map/messages/commands/add-control.command.mjs +12 -12
  120. package/dist/esm2022/src/map/messages/commands/add-layer.command.mjs +12 -12
  121. package/dist/esm2022/src/map/messages/commands/add-tile.command.mjs +12 -12
  122. package/dist/esm2022/src/map/messages/commands/cancel-drawing.command.mjs +7 -7
  123. package/dist/esm2022/src/map/messages/commands/cancel-feature-modification.command.mjs +7 -7
  124. package/dist/esm2022/src/map/messages/commands/close-tooltip.command.mjs +12 -12
  125. package/dist/esm2022/src/map/messages/commands/draw-selection-area.command.mjs +17 -17
  126. package/dist/esm2022/src/map/messages/commands/fit-to-features.command.mjs +14 -14
  127. package/dist/esm2022/src/map/messages/commands/fit-to-polygons.command.mjs +15 -0
  128. package/dist/esm2022/src/map/messages/commands/modify-feature.command.mjs +17 -17
  129. package/dist/esm2022/src/map/messages/commands/place-layer-features.command.mjs +14 -14
  130. package/dist/esm2022/src/map/messages/commands/remove-control.command.mjs +12 -12
  131. package/dist/esm2022/src/map/messages/commands/remove-layer.command.mjs +12 -12
  132. package/dist/esm2022/src/map/messages/commands/remove-tile.command.mjs +12 -12
  133. package/dist/esm2022/src/map/messages/commands/set-map-center.command.mjs +25 -25
  134. package/dist/esm2022/src/map/messages/commands/start-drawing.command.mjs +17 -17
  135. package/dist/esm2022/src/map/messages/events/drawing-finished.event.mjs +10 -10
  136. package/dist/esm2022/src/map/messages/events/map-click.event.mjs +16 -16
  137. package/dist/esm2022/src/map/messages/events/map-move-end.event.mjs +14 -14
  138. package/dist/esm2022/src/map/messages/events/map-rendered.event.mjs +12 -12
  139. package/dist/esm2022/src/map/messages/executors/calculate-area.executor.mjs +12 -12
  140. package/dist/esm2022/src/map/messages/executors/filter-features-in-area.executor.mjs +14 -14
  141. package/dist/esm2022/src/map/messages/executors/generate-draw.executor.mjs +16 -16
  142. package/dist/esm2022/src/map/messages/executors/generate-zoom-control.executor.mjs +12 -12
  143. package/dist/esm2022/src/map/messages/index.mjs +15 -14
  144. package/dist/esm2022/src/map/messages/queries/get-features-in-area.query.mjs +15 -15
  145. package/dist/esm2022/src/map/messages/queries/get-layer.query.mjs +12 -12
  146. package/dist/esm2022/src/map/models/drawing-type.enum.mjs +7 -7
  147. package/dist/esm2022/src/map/models/feature-format.enum.mjs +5 -5
  148. package/dist/esm2022/src/map/models/i-identified.mjs +1 -1
  149. package/dist/esm2022/src/map/models/index.mjs +8 -9
  150. package/dist/esm2022/src/map/models/map-control.mjs +14 -14
  151. package/dist/esm2022/src/map/models/map-lyrs.enum.mjs +18 -18
  152. package/dist/esm2022/src/map/models/map-settings.mjs +50 -50
  153. package/dist/esm2022/src/map/models/map.constants.mjs +4 -4
  154. package/dist/esm2022/src/map/models/marker-model.mjs +28 -28
  155. package/dist/esm2022/src/map/models/polygon.model.mjs +32 -32
  156. package/dist/esm2022/src/map/public-api.mjs +15 -15
  157. package/dist/esm2022/src/map/services/controls/controls.service.mjs +39 -39
  158. package/dist/esm2022/src/map/services/drawing/drawing-generation.service.mjs +25 -25
  159. package/dist/esm2022/src/map/services/drawing/drawing.service.mjs +101 -100
  160. package/dist/esm2022/src/map/services/drawing/feature-modification.service.mjs +103 -103
  161. package/dist/esm2022/src/map/services/feature.service.mjs +21 -21
  162. package/dist/esm2022/src/map/services/map-click.service.mjs +55 -55
  163. package/dist/esm2022/src/map/services/map-feature.service.mjs +55 -41
  164. package/dist/esm2022/src/map/services/map-management.service.mjs +103 -103
  165. package/dist/esm2022/src/map/services/map-postboy.service.mjs +18 -18
  166. package/dist/esm2022/src/map/services/map-state.service.mjs +43 -43
  167. package/dist/esm2022/src/map/services/message-registrator.service.mjs +82 -81
  168. package/dist/fesm2022/maps-components-src-map.mjs +2111 -2135
  169. package/dist/fesm2022/maps-components-src-map.mjs.map +1 -1
  170. package/dist/fesm2022/maps-components.mjs +2113 -2137
  171. package/dist/fesm2022/maps-components.mjs.map +1 -1
  172. package/dist/index.d.ts +5 -5
  173. package/dist/map/common/destructible.component.d.ts +10 -10
  174. package/dist/map/common/id.generator.d.ts +4 -4
  175. package/dist/map/helpers/index.d.ts +4 -4
  176. package/dist/map/helpers/marker-style.helper.d.ts +7 -7
  177. package/dist/map/helpers/polygon-style.helper.d.ts +5 -5
  178. package/dist/map/helpers/stringify-feature.helper.d.ts +8 -8
  179. package/dist/map/helpers/text-style.helper.d.ts +4 -4
  180. package/dist/map/map-plate/controls/index.d.ts +2 -2
  181. package/dist/map/map-plate/controls/map-control-zoom/map-control-zoom.component.d.ts +19 -19
  182. package/dist/map/map-plate/controls/map-control-zoom/zoom-control.factory.d.ts +5 -5
  183. package/dist/map/map-plate/controls/map-control-zoom/zoom-control.settings.d.ts +14 -14
  184. package/dist/map/map-plate/features/index.d.ts +2 -2
  185. package/dist/map/map-plate/features/markers/markers.component.d.ts +16 -16
  186. package/dist/map/map-plate/features/polygons/polygons.component.d.ts +16 -16
  187. package/dist/map/map-plate/layers/cluster-layer/cluster-layer-factory.service.d.ts +11 -11
  188. package/dist/map/map-plate/layers/cluster-layer/cluster-layer.component.d.ts +21 -21
  189. package/dist/map/map-plate/layers/cluster-layer/cluster-layer.manager.d.ts +13 -13
  190. package/dist/map/map-plate/layers/cluster-layer/cluster-layer.settings.d.ts +22 -22
  191. package/dist/map/map-plate/layers/feature-layer/feature-layer.component.d.ts +22 -22
  192. package/dist/map/map-plate/layers/feature-layer/feature-layer.factory.d.ts +9 -9
  193. package/dist/map/map-plate/layers/feature-layer/feature-layer.settings.d.ts +61 -61
  194. package/dist/map/map-plate/layers/index.d.ts +7 -7
  195. package/dist/map/map-plate/layers/osm-tile-layer/osm-tile-layer.component.d.ts +19 -19
  196. package/dist/map/map-plate/layers/tile-layer/tile-layer.component.d.ts +21 -21
  197. package/dist/map/map-plate/layers/tile-layer/tile-layer.factory.d.ts +11 -11
  198. package/dist/map/map-plate/layers/tile-layer/tile-layer.settings.d.ts +14 -14
  199. package/dist/map/map-plate/map-plate.component.d.ts +27 -27
  200. package/dist/map/map-plate/map-plate.factory.service.d.ts +8 -8
  201. package/dist/map/map-plate/tooltips/index.d.ts +2 -2
  202. package/dist/map/map-plate/tooltips/tooltip/tooltip.component.d.ts +26 -26
  203. package/dist/map/map-plate/tooltips/tooltip/tooltip.settings.d.ts +11 -11
  204. package/dist/map/map.module.d.ts +17 -17
  205. package/dist/map/messages/commands/add-control.command.d.ts +8 -8
  206. package/dist/map/messages/commands/add-layer.command.d.ts +10 -10
  207. package/dist/map/messages/commands/add-tile.command.d.ts +9 -9
  208. package/dist/map/messages/commands/cancel-drawing.command.d.ts +5 -5
  209. package/dist/map/messages/commands/cancel-feature-modification.command.d.ts +5 -5
  210. package/dist/map/messages/commands/close-tooltip.command.d.ts +7 -7
  211. package/dist/map/messages/commands/draw-selection-area.command.d.ts +13 -12
  212. package/dist/map/messages/commands/fit-to-features.command.d.ts +10 -10
  213. package/dist/map/messages/commands/fit-to-polygons.command.d.ts +9 -0
  214. package/dist/map/messages/commands/modify-feature.command.d.ts +11 -11
  215. package/dist/map/messages/commands/place-layer-features.command.d.ts +10 -10
  216. package/dist/map/messages/commands/remove-control.command.d.ts +8 -8
  217. package/dist/map/messages/commands/remove-layer.command.d.ts +8 -8
  218. package/dist/map/messages/commands/remove-tile.command.d.ts +9 -9
  219. package/dist/map/messages/commands/set-map-center.command.d.ts +18 -18
  220. package/dist/map/messages/commands/start-drawing.command.d.ts +11 -11
  221. package/dist/map/messages/events/drawing-finished.event.d.ts +6 -6
  222. package/dist/map/messages/events/map-click.event.d.ts +20 -20
  223. package/dist/map/messages/events/map-move-end.event.d.ts +8 -8
  224. package/dist/map/messages/events/map-rendered.event.d.ts +8 -8
  225. package/dist/map/messages/executors/calculate-area.executor.d.ts +10 -10
  226. package/dist/map/messages/executors/filter-features-in-area.executor.d.ts +10 -10
  227. package/dist/map/messages/executors/generate-draw.executor.d.ts +14 -14
  228. package/dist/map/messages/executors/generate-zoom-control.executor.d.ts +9 -9
  229. package/dist/map/messages/index.d.ts +14 -13
  230. package/dist/map/messages/queries/get-features-in-area.query.d.ts +11 -11
  231. package/dist/map/messages/queries/get-layer.query.d.ts +10 -10
  232. package/dist/map/models/drawing-type.enum.d.ts +6 -6
  233. package/dist/map/models/feature-format.enum.d.ts +4 -4
  234. package/dist/map/models/i-identified.d.ts +3 -3
  235. package/dist/map/models/index.d.ts +7 -8
  236. package/dist/map/models/map-control.d.ts +13 -13
  237. package/dist/map/models/map-lyrs.enum.d.ts +10 -10
  238. package/dist/map/models/map-settings.d.ts +17 -17
  239. package/dist/map/models/map.constants.d.ts +4 -4
  240. package/dist/map/models/marker-model.d.ts +16 -16
  241. package/dist/map/models/polygon.model.d.ts +19 -19
  242. package/dist/map/public-api.d.ts +12 -12
  243. package/dist/map/services/controls/controls.service.d.ts +14 -14
  244. package/dist/map/services/drawing/drawing-generation.service.d.ts +6 -6
  245. package/dist/map/services/drawing/drawing.service.d.ts +19 -19
  246. package/dist/map/services/drawing/feature-modification.service.d.ts +22 -22
  247. package/dist/map/services/feature.service.d.ts +9 -9
  248. package/dist/map/services/map-click.service.d.ts +16 -16
  249. package/dist/map/services/map-feature.service.d.ts +16 -14
  250. package/dist/map/services/map-management.service.d.ts +20 -20
  251. package/dist/map/services/map-postboy.service.d.ts +7 -7
  252. package/dist/map/services/map-state.service.d.ts +13 -13
  253. package/dist/map/services/message-registrator.service.d.ts +17 -17
  254. package/dist/public-api.d.ts +1 -1
  255. package/dist/src/map/common/destructible.component.d.ts +10 -10
  256. package/dist/src/map/common/id.generator.d.ts +4 -4
  257. package/dist/src/map/helpers/index.d.ts +4 -4
  258. package/dist/src/map/helpers/marker-style.helper.d.ts +7 -7
  259. package/dist/src/map/helpers/polygon-style.helper.d.ts +5 -5
  260. package/dist/src/map/helpers/stringify-feature.helper.d.ts +8 -8
  261. package/dist/src/map/helpers/text-style.helper.d.ts +4 -4
  262. package/dist/src/map/index.d.ts +5 -5
  263. package/dist/src/map/map-plate/controls/index.d.ts +2 -2
  264. package/dist/src/map/map-plate/controls/map-control-zoom/map-control-zoom.component.d.ts +19 -19
  265. package/dist/src/map/map-plate/controls/map-control-zoom/zoom-control.factory.d.ts +5 -5
  266. package/dist/src/map/map-plate/controls/map-control-zoom/zoom-control.settings.d.ts +14 -14
  267. package/dist/src/map/map-plate/features/index.d.ts +2 -2
  268. package/dist/src/map/map-plate/features/markers/markers.component.d.ts +16 -16
  269. package/dist/src/map/map-plate/features/polygons/polygons.component.d.ts +16 -16
  270. package/dist/src/map/map-plate/layers/cluster-layer/cluster-layer-factory.service.d.ts +11 -11
  271. package/dist/src/map/map-plate/layers/cluster-layer/cluster-layer.component.d.ts +21 -21
  272. package/dist/src/map/map-plate/layers/cluster-layer/cluster-layer.manager.d.ts +13 -13
  273. package/dist/src/map/map-plate/layers/cluster-layer/cluster-layer.settings.d.ts +22 -22
  274. package/dist/src/map/map-plate/layers/feature-layer/feature-layer.component.d.ts +22 -22
  275. package/dist/src/map/map-plate/layers/feature-layer/feature-layer.factory.d.ts +9 -9
  276. package/dist/src/map/map-plate/layers/feature-layer/feature-layer.settings.d.ts +61 -61
  277. package/dist/src/map/map-plate/layers/index.d.ts +7 -7
  278. package/dist/src/map/map-plate/layers/osm-tile-layer/osm-tile-layer.component.d.ts +19 -19
  279. package/dist/src/map/map-plate/layers/tile-layer/tile-layer.component.d.ts +21 -21
  280. package/dist/src/map/map-plate/layers/tile-layer/tile-layer.factory.d.ts +11 -11
  281. package/dist/src/map/map-plate/layers/tile-layer/tile-layer.settings.d.ts +14 -14
  282. package/dist/src/map/map-plate/map-plate.component.d.ts +27 -27
  283. package/dist/src/map/map-plate/map-plate.factory.service.d.ts +8 -8
  284. package/dist/src/map/map-plate/tooltips/index.d.ts +2 -2
  285. package/dist/src/map/map-plate/tooltips/tooltip/tooltip.component.d.ts +26 -26
  286. package/dist/src/map/map-plate/tooltips/tooltip/tooltip.settings.d.ts +11 -11
  287. package/dist/src/map/map.module.d.ts +17 -17
  288. package/dist/src/map/messages/commands/add-control.command.d.ts +8 -8
  289. package/dist/src/map/messages/commands/add-layer.command.d.ts +10 -10
  290. package/dist/src/map/messages/commands/add-tile.command.d.ts +9 -9
  291. package/dist/src/map/messages/commands/cancel-drawing.command.d.ts +5 -5
  292. package/dist/src/map/messages/commands/cancel-feature-modification.command.d.ts +5 -5
  293. package/dist/src/map/messages/commands/close-tooltip.command.d.ts +7 -7
  294. package/dist/src/map/messages/commands/draw-selection-area.command.d.ts +13 -12
  295. package/dist/src/map/messages/commands/fit-to-features.command.d.ts +10 -10
  296. package/dist/src/map/messages/commands/fit-to-polygons.command.d.ts +9 -0
  297. package/dist/src/map/messages/commands/modify-feature.command.d.ts +11 -11
  298. package/dist/src/map/messages/commands/place-layer-features.command.d.ts +10 -10
  299. package/dist/src/map/messages/commands/remove-control.command.d.ts +8 -8
  300. package/dist/src/map/messages/commands/remove-layer.command.d.ts +8 -8
  301. package/dist/src/map/messages/commands/remove-tile.command.d.ts +9 -9
  302. package/dist/src/map/messages/commands/set-map-center.command.d.ts +18 -18
  303. package/dist/src/map/messages/commands/start-drawing.command.d.ts +11 -11
  304. package/dist/src/map/messages/events/drawing-finished.event.d.ts +6 -6
  305. package/dist/src/map/messages/events/map-click.event.d.ts +20 -20
  306. package/dist/src/map/messages/events/map-move-end.event.d.ts +8 -8
  307. package/dist/src/map/messages/events/map-rendered.event.d.ts +8 -8
  308. package/dist/src/map/messages/executors/calculate-area.executor.d.ts +10 -10
  309. package/dist/src/map/messages/executors/filter-features-in-area.executor.d.ts +10 -10
  310. package/dist/src/map/messages/executors/generate-draw.executor.d.ts +14 -14
  311. package/dist/src/map/messages/executors/generate-zoom-control.executor.d.ts +9 -9
  312. package/dist/src/map/messages/index.d.ts +14 -13
  313. package/dist/src/map/messages/queries/get-features-in-area.query.d.ts +11 -11
  314. package/dist/src/map/messages/queries/get-layer.query.d.ts +10 -10
  315. package/dist/src/map/models/drawing-type.enum.d.ts +6 -6
  316. package/dist/src/map/models/feature-format.enum.d.ts +4 -4
  317. package/dist/src/map/models/i-identified.d.ts +3 -3
  318. package/dist/src/map/models/index.d.ts +7 -8
  319. package/dist/src/map/models/map-control.d.ts +13 -13
  320. package/dist/src/map/models/map-lyrs.enum.d.ts +10 -10
  321. package/dist/src/map/models/map-settings.d.ts +17 -17
  322. package/dist/src/map/models/map.constants.d.ts +4 -4
  323. package/dist/src/map/models/marker-model.d.ts +16 -16
  324. package/dist/src/map/models/polygon.model.d.ts +19 -19
  325. package/dist/src/map/public-api.d.ts +12 -12
  326. package/dist/src/map/services/controls/controls.service.d.ts +14 -14
  327. package/dist/src/map/services/drawing/drawing-generation.service.d.ts +6 -6
  328. package/dist/src/map/services/drawing/drawing.service.d.ts +19 -19
  329. package/dist/src/map/services/drawing/feature-modification.service.d.ts +22 -22
  330. package/dist/src/map/services/feature.service.d.ts +9 -9
  331. package/dist/src/map/services/map-click.service.d.ts +16 -16
  332. package/dist/src/map/services/map-feature.service.d.ts +16 -14
  333. package/dist/src/map/services/map-management.service.d.ts +20 -20
  334. package/dist/src/map/services/map-postboy.service.d.ts +7 -7
  335. package/dist/src/map/services/map-state.service.d.ts +13 -13
  336. package/dist/src/map/services/message-registrator.service.d.ts +17 -17
  337. package/package.json +24 -24
  338. package/dist/esm2022/map/models/dictionary.mjs +0 -54
  339. package/dist/esm2022/src/map/models/dictionary.mjs +0 -54
  340. package/dist/map/models/dictionary.d.ts +0 -17
  341. package/dist/package.json +0 -34
  342. package/dist/src/map/models/dictionary.d.ts +0 -17
@@ -12,6 +12,7 @@ import { PostboyGenericMessage, PostboyCallbackMessage, PostboyExecutor, Postboy
12
12
  import { Draw, Modify, Translate } from 'ol/interaction';
13
13
  import { createRegularPolygon, createBox } from 'ol/interaction/Draw';
14
14
  import * as Sphere from 'ol/sphere';
15
+ import { Dictionary } from '@artstesh/collections';
15
16
  import { first, filter, auditTime } from 'rxjs/operators';
16
17
  import { Vector, XYZ } from 'ol/source';
17
18
  import TileLayer from 'ol/layer/Tile';
@@ -28,2177 +29,2152 @@ import Style from 'ol/style/Style';
28
29
  import { Icon, Circle, Fill, Stroke, Text } from 'ol/style';
29
30
  import { METERS_PER_UNIT } from 'ol/proj/epsg4326';
30
31
 
31
- class DestructibleComponent {
32
- subs = [];
33
- onDestroy;
34
- ngOnDestroy() {
35
- this.subs.forEach((s) => s.unsubscribe());
36
- if (this.onDestroy)
37
- this.onDestroy();
38
- }
39
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DestructibleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
40
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DestructibleComponent, selector: "ng-component", ngImport: i0, template: '', isInline: true });
41
- }
42
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DestructibleComponent, decorators: [{
43
- type: Component,
44
- args: [{ template: '' }]
32
+ class DestructibleComponent {
33
+ subs = [];
34
+ onDestroy;
35
+ ngOnDestroy() {
36
+ this.subs.forEach((s) => s.unsubscribe());
37
+ if (this.onDestroy)
38
+ this.onDestroy();
39
+ }
40
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: DestructibleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
41
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: DestructibleComponent, selector: "ng-component", ngImport: i0, template: '', isInline: true });
42
+ }
43
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: DestructibleComponent, decorators: [{
44
+ type: Component,
45
+ args: [{ template: '' }]
45
46
  }] });
46
47
 
47
- var MapLyrs;
48
- (function (MapLyrs) {
49
- MapLyrs[MapLyrs["Hybrid"] = 1] = "Hybrid";
50
- MapLyrs[MapLyrs["Satellite"] = 2] = "Satellite";
51
- MapLyrs[MapLyrs["Streets"] = 3] = "Streets";
52
- MapLyrs[MapLyrs["Terrain"] = 4] = "Terrain";
53
- })(MapLyrs || (MapLyrs = {}));
54
- class MapLyrsLabel {
55
- static lyrs = {
56
- [MapLyrs.Hybrid]: 's,h',
57
- [MapLyrs.Satellite]: 's',
58
- [MapLyrs.Streets]: 'm',
59
- [MapLyrs.Terrain]: 'p',
60
- };
61
- static get(lyrs) {
62
- return MapLyrsLabel.lyrs[lyrs];
63
- }
64
- }
65
-
66
- class MapSettings {
67
- center = [0, 0];
68
- maxZoom = 19;
69
- minZoom = 0;
70
- zoom = 4;
71
- lyrs = MapLyrs.Hybrid;
72
- language = 'en';
73
- static copy(model) {
74
- const result = new MapSettings();
75
- result.center = model.center;
76
- result.maxZoom = model.maxZoom;
77
- result.minZoom = model.minZoom;
78
- result.zoom = model.zoom;
79
- result.lyrs = model.lyrs;
80
- result.language = model.language;
81
- return result;
82
- }
83
- setCenter(center) {
84
- return MapSettings.copy({ ...this, center });
85
- }
86
- setMaxZoom(maxZoom) {
87
- return MapSettings.copy({ ...this, maxZoom });
88
- }
89
- setMinZoom(minZoom) {
90
- return MapSettings.copy({ ...this, minZoom });
91
- }
92
- setZoom(zoom) {
93
- return MapSettings.copy({ ...this, zoom });
94
- }
95
- setLyrs(lyrs) {
96
- return MapSettings.copy({ ...this, lyrs });
97
- }
98
- setLanguage(language) {
99
- return MapSettings.copy({ ...this, language });
100
- }
101
- isSame(model) {
102
- if (this.maxZoom !== model.maxZoom)
103
- return false;
104
- if (this.minZoom !== model.minZoom)
105
- return false;
106
- if (this.zoom !== model.zoom)
107
- return false;
108
- if (this.lyrs !== model.lyrs)
109
- return false;
110
- if (this.language !== model.language)
111
- return false;
112
- return this.center.length === model.center.length && !this.center.filter((c, i) => c !== model.center[i]).length;
113
- }
114
- }
115
-
116
- class IdGenerator {
117
- static collection = 'ABCDEFGHIJKLMNOPQRSTUVWXTZ0123456789'.split('');
118
- static get() {
119
- let result = [];
120
- for (let i = 0; i < 7; i++) {
121
- result.push(IdGenerator.collection
122
- .sort(() => 0.5 - Math.random())
123
- .slice(0, 5)
124
- .join(''));
125
- }
126
- return result.join('-');
127
- }
128
- }
129
-
130
- class MapConstants {
131
- static FeatureInfo = 'f-info';
132
- static DrawingLayerId = '93a981756ec7';
133
- }
134
-
135
- class MarkerModel {
136
- lat;
137
- lng;
138
- info;
139
- id;
140
- constructor(lat, lng, id, info) {
141
- this.lat = lat;
142
- this.lng = lng;
143
- this.info = info;
144
- this.id = id == null ? IdGenerator.get() : id;
145
- this._feature = this.getFeature();
146
- }
147
- _feature;
148
- get feature() {
149
- return this._feature;
150
- }
151
- getFeature() {
152
- const feature = new Feature(new Point([this.lng, this.lat]));
153
- feature.setId(this.id);
154
- if (this.info)
155
- feature.set(MapConstants.FeatureInfo, this.info);
156
- return feature;
157
- }
158
- }
159
-
160
- class PolygonModel {
161
- info;
162
- id;
163
- lat;
164
- lng;
165
- _feature;
166
- static fromGeoJson(id, json, info) {
167
- let feature = new GeoJSON().readFeature(json);
168
- feature.setId(id);
169
- return new PolygonModel(feature, id, info);
170
- }
171
- static fromWKT(id, wkt, info) {
172
- let feature = new WKT().readFeature(wkt);
173
- feature.setId(id);
174
- return new PolygonModel(feature, id, info);
175
- }
176
- constructor(feature, id, info) {
177
- this.info = info;
178
- this.id = id == null ? IdGenerator.get() : id;
179
- this._feature = feature;
180
- if (this.info)
181
- this._feature?.set(MapConstants.FeatureInfo, this.info);
182
- [this.lng, this.lat] = getCenter(this._feature.getGeometry()?.getExtent());
183
- }
184
- get feature() {
185
- return this._feature;
186
- }
187
- }
188
-
189
- var DrawingType;
190
- (function (DrawingType) {
191
- DrawingType[DrawingType["Polygon"] = 1] = "Polygon";
192
- DrawingType[DrawingType["Circle"] = 2] = "Circle";
193
- DrawingType[DrawingType["Square"] = 3] = "Square";
194
- DrawingType[DrawingType["Box"] = 4] = "Box";
48
+ var MapLyrs;
49
+ (function (MapLyrs) {
50
+ MapLyrs[MapLyrs["Hybrid"] = 1] = "Hybrid";
51
+ MapLyrs[MapLyrs["Satellite"] = 2] = "Satellite";
52
+ MapLyrs[MapLyrs["Streets"] = 3] = "Streets";
53
+ MapLyrs[MapLyrs["Terrain"] = 4] = "Terrain";
54
+ })(MapLyrs || (MapLyrs = {}));
55
+ class MapLyrsLabel {
56
+ static lyrs = {
57
+ [MapLyrs.Hybrid]: 's,h',
58
+ [MapLyrs.Satellite]: 's',
59
+ [MapLyrs.Streets]: 'm',
60
+ [MapLyrs.Terrain]: 'p',
61
+ };
62
+ static get(lyrs) {
63
+ return MapLyrsLabel.lyrs[lyrs];
64
+ }
65
+ }
66
+
67
+ class MapSettings {
68
+ center = [0, 0];
69
+ maxZoom = 19;
70
+ minZoom = 0;
71
+ zoom = 4;
72
+ lyrs = MapLyrs.Hybrid;
73
+ language = 'en';
74
+ static copy(model) {
75
+ const result = new MapSettings();
76
+ result.center = model.center;
77
+ result.maxZoom = model.maxZoom;
78
+ result.minZoom = model.minZoom;
79
+ result.zoom = model.zoom;
80
+ result.lyrs = model.lyrs;
81
+ result.language = model.language;
82
+ return result;
83
+ }
84
+ setCenter(center) {
85
+ return MapSettings.copy({ ...this, center });
86
+ }
87
+ setMaxZoom(maxZoom) {
88
+ return MapSettings.copy({ ...this, maxZoom });
89
+ }
90
+ setMinZoom(minZoom) {
91
+ return MapSettings.copy({ ...this, minZoom });
92
+ }
93
+ setZoom(zoom) {
94
+ return MapSettings.copy({ ...this, zoom });
95
+ }
96
+ setLyrs(lyrs) {
97
+ return MapSettings.copy({ ...this, lyrs });
98
+ }
99
+ setLanguage(language) {
100
+ return MapSettings.copy({ ...this, language });
101
+ }
102
+ isSame(model) {
103
+ if (this.maxZoom !== model.maxZoom)
104
+ return false;
105
+ if (this.minZoom !== model.minZoom)
106
+ return false;
107
+ if (this.zoom !== model.zoom)
108
+ return false;
109
+ if (this.lyrs !== model.lyrs)
110
+ return false;
111
+ if (this.language !== model.language)
112
+ return false;
113
+ return this.center.length === model.center.length && !this.center.filter((c, i) => c !== model.center[i]).length;
114
+ }
115
+ }
116
+
117
+ class IdGenerator {
118
+ static collection = 'ABCDEFGHIJKLMNOPQRSTUVWXTZ0123456789'.split('');
119
+ static get() {
120
+ let result = [];
121
+ for (let i = 0; i < 7; i++) {
122
+ result.push(IdGenerator.collection
123
+ .sort(() => 0.5 - Math.random())
124
+ .slice(0, 5)
125
+ .join(''));
126
+ }
127
+ return result.join('-');
128
+ }
129
+ }
130
+
131
+ class MapConstants {
132
+ static FeatureInfo = 'f-info';
133
+ static DrawingLayerId = '93a981756ec7';
134
+ }
135
+
136
+ class MarkerModel {
137
+ lat;
138
+ lng;
139
+ info;
140
+ id;
141
+ constructor(lat, lng, id, info) {
142
+ this.lat = lat;
143
+ this.lng = lng;
144
+ this.info = info;
145
+ this.id = id == null ? IdGenerator.get() : id;
146
+ this._feature = this.getFeature();
147
+ }
148
+ _feature;
149
+ get feature() {
150
+ return this._feature;
151
+ }
152
+ getFeature() {
153
+ const feature = new Feature(new Point([this.lng, this.lat]));
154
+ feature.setId(this.id);
155
+ if (this.info)
156
+ feature.set(MapConstants.FeatureInfo, this.info);
157
+ return feature;
158
+ }
159
+ }
160
+
161
+ class PolygonModel {
162
+ info;
163
+ id;
164
+ lat;
165
+ lng;
166
+ _feature;
167
+ static fromGeoJson(id, json, info) {
168
+ let feature = new GeoJSON().readFeature(json);
169
+ feature.setId(id);
170
+ return new PolygonModel(feature, id, info);
171
+ }
172
+ static fromWKT(id, wkt, info) {
173
+ let feature = new WKT().readFeature(wkt);
174
+ feature.setId(id);
175
+ return new PolygonModel(feature, id, info);
176
+ }
177
+ constructor(feature, id, info) {
178
+ this.info = info;
179
+ this.id = id == null ? IdGenerator.get() : id;
180
+ this._feature = feature;
181
+ if (this.info)
182
+ this._feature?.set(MapConstants.FeatureInfo, this.info);
183
+ [this.lng, this.lat] = getCenter(this._feature.getGeometry()?.getExtent());
184
+ }
185
+ get feature() {
186
+ return this._feature;
187
+ }
188
+ }
189
+
190
+ var DrawingType;
191
+ (function (DrawingType) {
192
+ DrawingType[DrawingType["Polygon"] = 1] = "Polygon";
193
+ DrawingType[DrawingType["Circle"] = 2] = "Circle";
194
+ DrawingType[DrawingType["Square"] = 3] = "Square";
195
+ DrawingType[DrawingType["Box"] = 4] = "Box";
195
196
  })(DrawingType || (DrawingType = {}));
196
197
 
197
- var FeatureOutputFormat;
198
- (function (FeatureOutputFormat) {
199
- FeatureOutputFormat[FeatureOutputFormat["GeoJson"] = 1] = "GeoJson";
200
- FeatureOutputFormat[FeatureOutputFormat["WKT"] = 2] = "WKT";
198
+ var FeatureOutputFormat;
199
+ (function (FeatureOutputFormat) {
200
+ FeatureOutputFormat[FeatureOutputFormat["GeoJson"] = 1] = "GeoJson";
201
+ FeatureOutputFormat[FeatureOutputFormat["WKT"] = 2] = "WKT";
201
202
  })(FeatureOutputFormat || (FeatureOutputFormat = {}));
202
203
 
203
- class Dictionary {
204
- collection = {};
205
- _keys = new Set();
206
- get keys() {
207
- return Array.from(this._keys);
208
- }
209
- get size() {
210
- return this._keys.size;
211
- }
212
- static clone(dic, action) {
213
- return Dictionary.create(dic.collection, action);
214
- }
215
- static create(dic, action) {
216
- let keyList = Object.keys(dic);
217
- const result = new Dictionary();
218
- for (let i = 0; i < keyList.length; i++) {
219
- let key = keyList[i];
220
- result._keys.add(key);
221
- result.collection[key] = action ? action(dic[key], key) : dic[key];
222
- }
223
- return result;
224
- }
225
- find(predicate) {
226
- let result = null;
227
- this.forEach((e) => {
228
- if (result === null && predicate(e))
229
- result = e;
230
- });
231
- return result;
232
- }
233
- has = (key) => this._keys.has(key);
234
- take(key) {
235
- return this._keys.has(key) ? this.collection[key] : null;
236
- }
237
- put(key, value) {
238
- if (value == null)
239
- return;
240
- this.collection[key] = value;
241
- this._keys.add(key);
242
- }
243
- rmv(key) {
244
- if (!this._keys.has(key))
245
- return;
246
- delete this.collection[key];
247
- this._keys.delete(key);
248
- }
249
- forEach(callback) {
250
- let keys = Object.keys(this.collection);
251
- for (let i = 0; i < keys.length; i++) {
252
- callback(this.collection[keys[i]], i);
253
- }
254
- }
255
- }
256
-
257
- /**
258
- *
259
- * A control is a visible widget with a DOM element in a fixed position on the screen. They can involve user input (buttons), or be informational only; the position is determined using CSS. By default these are placed in the container with CSS class name ol-overlaycontainer-stopevent, but can use any outside DOM element.
260
- * This is the base class for controls. You can use it for simple custom controls by creating the element with listeners, creating an instance:
261
- * var myControl = new Control({element: myElement}); and then adding this to the map.
262
- * The main advantage of having this as a control rather than a simple separate DOM element is that preventing propagation is handled for you. Controls will also be objects in a module:ol/Collection~Collection, so you can use their methods.
263
- * You can also extend this base for your own control class. See examples/custom-controls for an example of how to do this.
264
- */
265
- class MapControl extends Control {
266
- constructor(options) {
267
- super(options);
268
- }
269
- }
270
-
271
- class MapRenderedEvent extends PostboyGenericMessage {
272
- map;
273
- static ID = 'b6121807-3b89-4cd3-82cf-089d2cefdc4f';
274
- constructor(map) {
275
- super();
276
- this.map = map;
277
- }
278
- get id() {
279
- return MapRenderedEvent.ID;
280
- }
281
- }
282
-
283
- class MapClickEvent extends PostboyGenericMessage {
284
- coordinates;
285
- entities;
286
- features;
287
- static ID = '323df526-8d9c-49c6-83e8-6e9a1e7762f7';
288
- constructor(coordinates, entities, features) {
289
- super();
290
- this.coordinates = coordinates;
291
- this.entities = entities;
292
- this.features = features;
293
- }
294
- get id() {
295
- return MapClickEvent.ID;
296
- }
297
- }
298
-
299
- class MapMoveEndEvent extends PostboyGenericMessage {
300
- zoom;
301
- extent;
302
- static ID = 'f21f783e-b5af-4489-9fec-8027fd07a8ad';
303
- constructor(zoom, extent) {
304
- super();
305
- this.zoom = zoom;
306
- this.extent = extent;
307
- }
308
- get id() {
309
- return MapMoveEndEvent.ID;
310
- }
311
- }
312
-
313
- class CloseTooltipCommand extends PostboyGenericMessage {
314
- tooltipId;
315
- static ID = '4896d52c-e34f-4994-bcfd-32832d12dbe4';
316
- constructor(tooltipId) {
317
- super();
318
- this.tooltipId = tooltipId;
319
- }
320
- get id() {
321
- return CloseTooltipCommand.ID;
322
- }
323
- }
324
-
325
- class StartDrawingCommand extends PostboyCallbackMessage {
326
- type;
327
- style;
328
- format;
329
- static ID = 'da904f4b-a1c8-4db7-a6af-14d9ee18ec8c';
330
- constructor(type, style, format = FeatureOutputFormat.GeoJson) {
331
- super();
332
- this.type = type;
333
- this.style = style;
334
- this.format = format;
335
- }
336
- get id() {
337
- return StartDrawingCommand.ID;
338
- }
339
- }
340
-
341
- class CancelDrawingCommand extends PostboyGenericMessage {
342
- static ID = '7d38d983-feba-4176-a66b-18175e5ecd6b';
343
- get id() {
344
- return CancelDrawingCommand.ID;
345
- }
346
- }
347
-
348
- class DrawSelectionAreaCommand extends PostboyCallbackMessage {
349
- type;
350
- style;
351
- ignore;
352
- static ID = '573d8a0d-f25b-42b7-9ad7-0ac6d86ac362';
353
- constructor(type, style, ignore = new Set()) {
354
- super();
355
- this.type = type;
356
- this.style = style;
357
- this.ignore = ignore;
358
- }
359
- get id() {
360
- return DrawSelectionAreaCommand.ID;
361
- }
362
- }
363
-
364
- class ModifyFeatureCommand extends PostboyCallbackMessage {
365
- model;
366
- style;
367
- format;
368
- static ID = 'ead85caa-24c6-4844-a68c-2cea91774c8c';
369
- constructor(model, style, format = FeatureOutputFormat.GeoJson) {
370
- super();
371
- this.model = model;
372
- this.style = style;
373
- this.format = format;
374
- }
375
- get id() {
376
- return ModifyFeatureCommand.ID;
377
- }
378
- }
379
-
380
- class CancelFeatureModificationCommand extends PostboyGenericMessage {
381
- static ID = '9c9fb40f-ea95-4704-8177-0e9ecabf36fa';
382
- get id() {
383
- return CancelFeatureModificationCommand.ID;
384
- }
385
- }
386
-
387
- class AddControlCommand extends PostboyGenericMessage {
388
- item;
389
- static ID = '8e1c06eb-b395-4fe1-929c-ebf0805eeb49';
390
- constructor(item) {
391
- super();
392
- this.item = item;
393
- }
394
- get id() {
395
- return AddControlCommand.ID;
396
- }
397
- }
398
-
399
- class RemoveControlCommand extends PostboyGenericMessage {
400
- item;
401
- static ID = '361641e0-804a-4930-8c27-0cea6330dbfc';
402
- constructor(item) {
403
- super();
404
- this.item = item;
405
- }
406
- get id() {
407
- return RemoveControlCommand.ID;
408
- }
409
- }
410
-
411
- /**
412
- * Forces map to move to a specific point
413
- */
414
- class SetMapCenterCommand extends PostboyGenericMessage {
415
- lat;
416
- lng;
417
- zoom;
418
- static ID = 'd50e89c9-6707-4f8c-ab57-65fcef232182';
419
- /**
420
- *
421
- * @param lat - the desired latitude
422
- * @param lng - the desired longitude
423
- * @param zoom - the desired zoom; doesn't change zoom if undefined
424
- */
425
- constructor(lat, lng, zoom) {
426
- super();
427
- this.lat = lat;
428
- this.lng = lng;
429
- this.zoom = zoom;
430
- }
431
- get id() {
432
- return SetMapCenterCommand.ID;
433
- }
434
- }
435
-
436
- class CalculateAreaExecutor extends PostboyExecutor {
437
- polygon;
438
- static ID = '172ecf46-86b5-4f46-a5f1-96ba2cbb1694';
439
- constructor(polygon) {
440
- super();
441
- this.polygon = polygon;
442
- }
443
- get id() {
444
- return CalculateAreaExecutor.ID;
445
- }
446
- }
447
-
448
- class AddLayerCommand extends PostboyGenericMessage {
449
- layer;
450
- static ID = 'd93e250f-92bc-43ac-9c6a-46c521a1aaa5';
451
- constructor(layer) {
452
- super();
453
- this.layer = layer;
454
- }
455
- get id() {
456
- return AddLayerCommand.ID;
457
- }
458
- }
459
-
460
- class PlaceLayerFeaturesCommand extends PostboyGenericMessage {
461
- layer;
462
- features;
463
- static ID = '8caf86bc-869b-426f-b36d-4642f6b8aab0';
464
- constructor(layer, features) {
465
- super();
466
- this.layer = layer;
467
- this.features = features;
468
- }
469
- get id() {
470
- return PlaceLayerFeaturesCommand.ID;
471
- }
472
- }
473
-
474
- class RemoveLayerCommand extends PostboyGenericMessage {
475
- layer;
476
- static ID = 'ab484e0e-e185-45cd-8434-12101f3c7eb1';
477
- constructor(layer) {
478
- super();
479
- this.layer = layer;
480
- }
481
- get id() {
482
- return RemoveLayerCommand.ID;
483
- }
484
- }
485
-
486
- class AddTileCommand extends PostboyGenericMessage {
487
- layer;
488
- static ID = '25b7df28-72ce-4453-9fe6-54285a2fdc57';
489
- constructor(layer) {
490
- super();
491
- this.layer = layer;
492
- }
493
- get id() {
494
- return AddTileCommand.ID;
495
- }
496
- }
497
-
498
- class RemoveTileCommand extends PostboyGenericMessage {
499
- layer;
500
- static ID = 'c36ccc0b-5638-4819-b148-2de57a59a5b7';
501
- constructor(layer) {
502
- super();
503
- this.layer = layer;
504
- }
505
- get id() {
506
- return RemoveTileCommand.ID;
507
- }
508
- }
509
-
510
- class FitToFeaturesCommand extends PostboyGenericMessage {
511
- features;
512
- zoomAfter;
513
- static ID = '76cdc091-3793-4b6c-82f7-1e0334cf08a8';
514
- constructor(features, zoomAfter = 0) {
515
- super();
516
- this.features = features;
517
- this.zoomAfter = zoomAfter;
518
- }
519
- get id() {
520
- return FitToFeaturesCommand.ID;
521
- }
522
- }
523
-
524
- class GetLayerQuery extends PostboyCallbackMessage {
525
- name;
526
- static ID = '5c04c87b-8a93-4c2a-979e-d1e313d860ed';
527
- constructor(name) {
528
- super();
529
- this.name = name;
530
- }
531
- get id() {
532
- return GetLayerQuery.ID;
533
- }
534
- }
535
-
536
- class DrawingFinishedEvent extends PostboyGenericMessage {
537
- static ID = 'c724b68e-b4eb-4783-90f1-a8e31973fd36';
538
- constructor() {
539
- super();
540
- }
541
- get id() {
542
- return DrawingFinishedEvent.ID;
543
- }
544
- }
545
-
546
- class DrawingGenerationService {
547
- static getDraw(ev) {
548
- return new Draw({
549
- source: ev.layer.getSource(),
550
- type: ev.type === DrawingType.Polygon ? 'Polygon' : 'Circle',
551
- style: ev.style,
552
- geometryFunction: DrawingGenerationService.geometryFunc(ev.type),
553
- });
554
- }
555
- static geometryFunc(type) {
556
- switch (type) {
557
- case DrawingType.Circle:
558
- return createRegularPolygon(32);
559
- case DrawingType.Box:
560
- return createBox();
561
- case DrawingType.Square:
562
- return createRegularPolygon(4);
563
- }
564
- return undefined;
565
- }
566
- }
567
-
568
- class FeatureService {
569
- constructor() { }
570
- static filterFeaturesInArea(query) {
571
- return query.features.filter((f) => FeatureService.booleanIntersects(query.area, f.getGeometry()));
572
- }
573
- static booleanIntersects(g1, g2) {
574
- if (g2.getType() === 'Point')
575
- return g1.intersectsCoordinate(g2.getCoordinates());
576
- if (g2.getType() === 'Circle')
577
- return g1.intersectsCoordinate(g2.getCenter());
578
- if (g2.getType() === 'Polygon')
579
- return g1.intersectsCoordinate(g2.getInteriorPoint().getCoordinates());
580
- return false;
581
- }
582
- static calculateArea(g) {
583
- if (!g)
584
- return 0;
585
- return Sphere.getArea(g, { projection: 'EPSG:4326' });
586
- }
587
- }
588
-
589
- class GetFeaturesInAreaQuery extends PostboyCallbackMessage {
590
- area;
591
- ignore;
592
- static ID = 'efcf4271-a07a-40e0-9f02-d4dade40b8ac';
593
- constructor(area, ignore = new Set()) {
594
- super();
595
- this.area = area;
596
- this.ignore = ignore;
597
- }
598
- get id() {
599
- return GetFeaturesInAreaQuery.ID;
600
- }
601
- }
602
-
603
- class FilterFeaturesInAreaExecutor extends PostboyExecutor {
604
- area;
605
- features;
606
- static ID = '36bb2d94-8028-4512-90dd-2386af3fc67c';
607
- constructor(area, features) {
608
- super();
609
- this.area = area;
610
- this.features = features;
611
- }
612
- get id() {
613
- return FilterFeaturesInAreaExecutor.ID;
614
- }
615
- }
616
-
617
- class GenerateDrawExecutor extends PostboyExecutor {
618
- layer;
619
- style;
620
- type;
621
- static ID = 'f01c99ba-0953-4ab5-82f9-04e6fbb678c1';
622
- constructor(layer, style, type) {
623
- super();
624
- this.layer = layer;
625
- this.style = style;
626
- this.type = type;
627
- }
628
- get id() {
629
- return GenerateDrawExecutor.ID;
630
- }
631
- }
632
-
633
- class GenerateZoomControlExecutor extends PostboyExecutor {
634
- settings;
635
- static ID = 'ff16a833-c68e-4b1a-bc23-c0d16b002810';
636
- constructor(settings) {
637
- super();
638
- this.settings = settings;
639
- }
640
- get id() {
641
- return GenerateZoomControlExecutor.ID;
642
- }
643
- }
644
-
645
- class ZoomControlFactory {
646
- static build(settings) {
647
- return new Zoom({
648
- zoomInTipLabel: settings.zoomInLabel,
649
- zoomOutTipLabel: settings.zoomOutLabel,
650
- zoomInClassName: settings.zoomInClass,
651
- zoomOutClassName: settings.zoomOutClass,
652
- className: settings.controlClass,
653
- });
654
- }
655
- }
656
-
657
- class MapPostboyService extends PostboyService {
658
- constructor() {
659
- super();
660
- this.addLocker({ locker: StartDrawingCommand.ID, unlocker: DrawingFinishedEvent.ID, locking: [MapClickEvent.ID] });
661
- }
662
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapPostboyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
663
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapPostboyService });
664
- }
665
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapPostboyService, decorators: [{
666
- type: Injectable
667
- }], ctorParameters: function () { return []; } });
668
-
669
- class MapManagementService {
670
- postboy;
671
- map;
672
- layers = new Dictionary();
673
- constructor(postboy) {
674
- this.postboy = postboy;
675
- }
676
- up() {
677
- this.observeMapRender();
678
- this.observeAddLayer();
679
- this.observeRemoveLayer();
680
- this.observePlaceFeatures();
681
- this.observeAddTile();
682
- this.observeRemoveTile();
683
- this.observeLayerQuery();
684
- this.observeFeaturesInArea();
685
- }
686
- observeRemoveTile() {
687
- this.postboy.subscribe(RemoveTileCommand.ID).subscribe((c) => {
688
- if (!this.map)
689
- return;
690
- this.map.removeLayer(c.layer);
691
- });
692
- }
693
- observeLayerQuery() {
694
- this.postboy.subscribe(GetLayerQuery.ID).subscribe((ev) => ev.finish(this.layers.take(ev.name)));
695
- }
696
- observeAddTile() {
697
- this.postboy.subscribe(AddTileCommand.ID).subscribe((c) => {
698
- if (!this.map)
699
- return;
700
- this.map.addLayer(c.layer);
701
- });
702
- }
703
- observeMapRender() {
704
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
705
- this.map = m.map;
706
- });
707
- }
708
- observeAddLayer() {
709
- this.postboy.subscribe(AddLayerCommand.ID).subscribe((c) => {
710
- if (!this.map)
711
- return;
712
- this.layers.put(c.layer.get('name'), c.layer);
713
- this.map.addLayer(c.layer);
714
- });
715
- }
716
- observePlaceFeatures() {
717
- this.postboy.subscribe(PlaceLayerFeaturesCommand.ID).subscribe((c) => {
718
- if (!this.layers.has(c.layer))
719
- return;
720
- let source = this.layers.take(c.layer).getSource();
721
- if (!!source['getSource'])
722
- source = source?.getSource();
723
- source?.clear();
724
- !!c.features?.length && source?.addFeatures(c.features);
725
- });
726
- }
727
- observeRemoveLayer() {
728
- this.postboy.subscribe(RemoveLayerCommand.ID).subscribe((c) => {
729
- if (!this.map)
730
- return;
731
- this.layers.rmv(c.layer.get('name'));
732
- this.map.removeLayer(c.layer);
733
- });
734
- }
735
- observeFeaturesInArea() {
736
- this.postboy.subscribe(GetFeaturesInAreaQuery.ID).subscribe((qr) => {
737
- let result = new Dictionary();
738
- this.layers.forEach((l) => {
739
- let layerName = l.get('name');
740
- if (qr.ignore.has(layerName) || layerName === MapConstants.DrawingLayerId)
741
- return;
742
- let source = l.getSource();
743
- if (!!source['getSource'])
744
- source = source?.getSource();
745
- let features = this.postboy.execute(new FilterFeaturesInAreaExecutor(qr.area, source?.getFeatures() ?? []));
746
- result.put(layerName, features.map((e) => ({ id: e.getId(), ...e.get(MapConstants.FeatureInfo) })));
747
- });
748
- qr.finish(result);
749
- });
750
- }
751
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapManagementService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
752
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapManagementService });
753
- }
754
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapManagementService, decorators: [{
755
- type: Injectable
756
- }], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
757
-
758
- class MapStateService {
759
- postboy;
760
- map;
761
- constructor(postboy) {
762
- this.postboy = postboy;
763
- }
764
- up() {
765
- this.observeMapRendering();
766
- this.observeCenter();
767
- }
768
- observeMapRendering() {
769
- this.postboy
770
- .subscribe(MapRenderedEvent.ID)
771
- .pipe(first())
772
- .subscribe((ev) => {
773
- this.map = ev.map;
774
- this.map?.on('moveend', () => {
775
- const zoom = Math.floor(this.map?.getView().getZoom() || -1);
776
- const extent = this.map?.getView().calculateExtent() || [];
777
- this.postboy.fire(new MapMoveEndEvent(zoom, extent));
778
- });
779
- });
780
- }
781
- observeCenter() {
782
- this.postboy.subscribe(SetMapCenterCommand.ID).subscribe((c) => {
783
- this.map?.getView().setCenter([c.lng, c.lat]);
784
- if (c.zoom)
785
- this.map?.getView().setZoom(c.zoom);
786
- });
787
- }
788
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapStateService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
789
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapStateService });
790
- }
791
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapStateService, decorators: [{
792
- type: Injectable
793
- }], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
794
-
795
- class MapFeatureService {
796
- postboy;
797
- map;
798
- constructor(postboy) {
799
- this.postboy = postboy;
800
- }
801
- up() {
802
- this.observeMapRender();
803
- this.observeFitToFeatures();
804
- }
805
- observeMapRender() {
806
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
807
- this.map = m.map;
808
- });
809
- }
810
- observeFitToFeatures() {
811
- this.postboy.subscribe(FitToFeaturesCommand.ID).subscribe((m) => {
812
- this.fitToGeometries(m.features.map((f) => f.getGeometry()), m.zoomAfter);
813
- });
814
- }
815
- fitToGeometries(geometries, zoomAfter) {
816
- if (!geometries?.length || !this.map)
817
- return;
818
- const extent = createEmpty();
819
- geometries.forEach((g) => extend(extent, g.getExtent()));
820
- this.map.getView().fit(extent);
821
- this.map.getView().setZoom(this.map.getView().getZoom() + zoomAfter);
822
- }
823
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapFeatureService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
824
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapFeatureService });
825
- }
826
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapFeatureService, decorators: [{
827
- type: Injectable
828
- }], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
829
-
830
- class MapClickService {
831
- postboy;
832
- map;
833
- constructor(postboy) {
834
- this.postboy = postboy;
835
- }
836
- up() {
837
- this.observeMapRender();
838
- }
839
- observeMapRender() {
840
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
841
- this.map = m.map;
842
- this.map?.on('singleclick', (e) => {
843
- this.postboy.fire(this.onClick(e));
844
- });
845
- });
846
- }
847
- onClick(ev) {
848
- const model = new MapClickEvent(ev.coordinate, {}, {});
849
- this.map?.forEachFeatureAtPixel(ev.pixel, (f, l) => {
850
- this.getFeatureCollectionWithInner([f])
851
- .filter((f) => f.getId() != null)
852
- .forEach((fs) => {
853
- let layerName = l.get('name');
854
- if (!model.entities[layerName])
855
- model.entities[layerName] = [];
856
- if (!model.features[layerName])
857
- model.features[layerName] = [];
858
- model.entities[layerName].push({ id: fs.getId(), ...fs.get(MapConstants.FeatureInfo) });
859
- model.features[layerName].push(fs);
860
- });
861
- });
862
- return model;
863
- }
864
- getFeatureCollectionWithInner(features) {
865
- const result = [];
866
- features?.forEach((f) => {
867
- const innerFeatures = f.get('features');
868
- innerFeatures?.length ? result.push(...innerFeatures) : result.push(f);
869
- });
870
- return result;
871
- }
872
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapClickService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
873
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapClickService });
874
- }
875
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapClickService, decorators: [{
876
- type: Injectable
877
- }], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
878
-
879
- class DrawingService {
880
- postboy;
881
- drawInteraction;
882
- map;
883
- constructor(postboy) {
884
- this.postboy = postboy;
885
- }
886
- up() {
887
- this.observeDrawing();
888
- this.observeSelectArea();
889
- this.observeMapRender();
890
- }
891
- observeSelectArea() {
892
- this.postboy.subscribe(DrawSelectionAreaCommand.ID).subscribe((ev) => {
893
- const drawingCommand = new StartDrawingCommand(ev.type, ev.style);
894
- drawingCommand.result.subscribe((r) => {
895
- if (!r) {
896
- ev.finish(new Dictionary());
897
- return;
898
- }
899
- const area = PolygonModel.fromGeoJson(1, r).feature.getGeometry();
900
- const getFeaturesCommand = new GetFeaturesInAreaQuery(area, ev.ignore);
901
- getFeaturesCommand.result.subscribe((result) => ev.finish(result));
902
- this.postboy.fire(getFeaturesCommand);
903
- });
904
- this.postboy.fire(drawingCommand);
905
- });
906
- }
907
- observeDrawing() {
908
- this.postboy.subscribe(StartDrawingCommand.ID).subscribe((ev) => {
909
- this.draw((l) => {
910
- if (!l || !this.map) {
911
- this.clearInteraction(l);
912
- return;
913
- }
914
- const cancelSub = this.observeCancelation(ev, l);
915
- this.drawInteraction = this.postboy.execute(new GenerateDrawExecutor(l, ev.style, ev.type));
916
- this.map?.addInteraction(this.drawInteraction);
917
- this.drawInteraction.on('drawend', (evt) => {
918
- cancelSub.unsubscribe();
919
- this.onEnd(evt, ev, l);
920
- });
921
- });
922
- });
923
- }
924
- onEnd(evt, command, layer) {
925
- command.finish(command.format === FeatureOutputFormat.GeoJson
926
- ? new GeoJSON().writeFeature(evt.feature)
927
- : new WKT().writeFeature(evt.feature));
928
- this.clearInteraction(layer);
929
- }
930
- observeMapRender() {
931
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
932
- this.map = m.map;
933
- });
934
- }
935
- draw(action) {
936
- const query = new GetLayerQuery(MapConstants.DrawingLayerId);
937
- query.result.subscribe((l) => action(l));
938
- this.postboy.fire(query);
939
- }
940
- observeCancelation(ev, layer) {
941
- return this.postboy
942
- .subscribe(CancelDrawingCommand.ID)
943
- .pipe(first())
944
- .subscribe(() => {
945
- ev.finish(null);
946
- this.clearInteraction(layer);
947
- });
948
- }
949
- clearInteraction(layer) {
950
- if (!!this.drawInteraction) {
951
- this.map?.removeInteraction(this.drawInteraction);
952
- layer?.setSource(new Vector({}));
953
- }
954
- setTimeout(() => this.postboy.fire(new DrawingFinishedEvent()), 300);
955
- }
956
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DrawingService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
957
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DrawingService });
958
- }
959
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DrawingService, decorators: [{
960
- type: Injectable
961
- }], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
962
-
963
- class FeatureModificationService {
964
- postboy;
965
- modify;
966
- translate;
967
- map;
968
- constructor(postboy) {
969
- this.postboy = postboy;
970
- }
971
- up() {
972
- this.observeModification();
973
- this.observeMapRender();
974
- }
975
- observeModification() {
976
- this.postboy.subscribe(ModifyFeatureCommand.ID).subscribe((ev) => {
977
- this.defineLayer((l) => {
978
- if (!l || !this.map) {
979
- this.clearInteraction(l);
980
- return;
981
- }
982
- this.observeCancelation(ev, l);
983
- this.initFeature(l, ev.model.feature);
984
- this.addModify(ev);
985
- this.addDragging(ev);
986
- });
987
- });
988
- }
989
- initFeature(layer, feature) {
990
- layer.getSource()?.clear();
991
- layer.getSource()?.addFeature(feature);
992
- }
993
- addModify(command) {
994
- this.modify = new Modify({
995
- features: new Collection([command.model.feature]),
996
- style: command.style,
997
- });
998
- this.modify.on('modifyend', () => {
999
- this.onModified(command);
1000
- command.model.feature.changed();
1001
- });
1002
- this.map?.addInteraction(this.modify);
1003
- }
1004
- addDragging(command) {
1005
- this.translate = new Translate({
1006
- features: new Collection([command.model.feature]),
1007
- condition: (ev) => {
1008
- const clone = command.model.feature.clone();
1009
- clone.getGeometry()?.scale(0.999);
1010
- return clone.getGeometry().intersectsCoordinate(ev.coordinate);
1011
- },
1012
- });
1013
- this.translate.on('translateend', () => this.onModified(command));
1014
- this.map?.addInteraction(this.translate);
1015
- }
1016
- onModified(command) {
1017
- command.next(command.format === FeatureOutputFormat.GeoJson
1018
- ? new GeoJSON().writeFeature(command.model.feature)
1019
- : new WKT().writeFeature(command.model.feature));
1020
- }
1021
- observeMapRender() {
1022
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
1023
- this.map = m.map;
1024
- });
1025
- }
1026
- defineLayer(action) {
1027
- const query = new GetLayerQuery(MapConstants.DrawingLayerId);
1028
- query.result.subscribe((l) => action(l));
1029
- this.postboy.fire(query);
1030
- }
1031
- observeCancelation(ev, layer) {
1032
- return this.postboy
1033
- .subscribe(CancelFeatureModificationCommand.ID)
1034
- .pipe(first())
1035
- .subscribe(() => {
1036
- ev.finish(null);
1037
- this.clearInteraction(layer);
1038
- });
1039
- }
1040
- clearInteraction(layer) {
1041
- if (this.modify)
1042
- this.map?.removeInteraction(this.modify);
1043
- if (this.translate)
1044
- this.map?.removeInteraction(this.translate);
1045
- }
1046
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FeatureModificationService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
1047
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FeatureModificationService });
1048
- }
1049
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FeatureModificationService, decorators: [{
1050
- type: Injectable
1051
- }], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
1052
-
1053
- class ControlsService {
1054
- postboy;
1055
- map;
1056
- constructor(postboy) {
1057
- this.postboy = postboy;
1058
- }
1059
- up() {
1060
- this.observeMapRender();
1061
- }
1062
- observeMapRender() {
1063
- this.postboy
1064
- .subscribe(MapRenderedEvent.ID)
1065
- .pipe(first())
1066
- .subscribe((m) => {
1067
- this.map = m.map;
1068
- this.observeAdding();
1069
- this.observeRemoving();
1070
- });
1071
- }
1072
- observeAdding() {
1073
- this.postboy.subscribe(AddControlCommand.ID).subscribe((c) => this.map?.addControl(c.item));
1074
- }
1075
- observeRemoving() {
1076
- this.postboy
1077
- .subscribe(RemoveControlCommand.ID)
1078
- .subscribe((c) => this.map?.removeControl(c.item));
1079
- }
1080
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ControlsService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
1081
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ControlsService });
1082
- }
1083
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ControlsService, decorators: [{
1084
- type: Injectable
1085
- }], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
1086
-
1087
- class MessageRegistratorService extends PostboyAbstractRegistrator {
1088
- constructor(service, management, state, mapFeature, interaction, drawing, featureModification, controls) {
1089
- super(service);
1090
- this.registerServices([management, state, interaction, mapFeature, drawing, featureModification, controls]);
1091
- }
1092
- _up() {
1093
- this.registerReplay(MapRenderedEvent.ID);
1094
- this.registerReplay(PlaceLayerFeaturesCommand.ID);
1095
- this.registerReplay(RemoveControlCommand.ID);
1096
- this.registerReplay(AddControlCommand.ID);
1097
- this.registerReplay(SetMapCenterCommand.ID);
1098
- this.registerSubject(AddLayerCommand.ID);
1099
- this.registerSubject(RemoveLayerCommand.ID);
1100
- this.registerSubject(AddTileCommand.ID);
1101
- this.registerSubject(RemoveTileCommand.ID);
1102
- this.registerSubject(MapClickEvent.ID);
1103
- this.registerSubject(CloseTooltipCommand.ID);
1104
- this.registerSubject(FitToFeaturesCommand.ID);
1105
- this.registerSubject(MapMoveEndEvent.ID);
1106
- this.registerSubject(CancelDrawingCommand.ID);
1107
- this.registerSubject(StartDrawingCommand.ID);
1108
- this.registerSubject(GetLayerQuery.ID);
1109
- this.registerSubject(DrawingFinishedEvent.ID);
1110
- this.registerSubject(GetFeaturesInAreaQuery.ID);
1111
- this.registerSubject(DrawSelectionAreaCommand.ID);
1112
- this.registerSubject(CancelFeatureModificationCommand.ID);
1113
- this.registerSubject(ModifyFeatureCommand.ID);
1114
- this.setExecutors();
1115
- }
1116
- setExecutors() {
1117
- this.registerExecutor(FilterFeaturesInAreaExecutor.ID, (e) => FeatureService.filterFeaturesInArea(e));
1118
- this.registerExecutor(CalculateAreaExecutor.ID, (e) => FeatureService.calculateArea(e.polygon?.feature?.getGeometry()));
1119
- this.registerExecutor(GenerateDrawExecutor.ID, (e) => DrawingGenerationService.getDraw(e));
1120
- this.registerExecutor(GenerateZoomControlExecutor.ID, (e) => ZoomControlFactory.build(e.settings));
1121
- }
1122
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", 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 });
1123
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MessageRegistratorService });
1124
- }
1125
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MessageRegistratorService, decorators: [{
1126
- type: Injectable
1127
- }], ctorParameters: function () { return [{ type: MapPostboyService }, { type: MapManagementService }, { type: MapStateService }, { type: MapFeatureService }, { type: MapClickService }, { type: DrawingService }, { type: FeatureModificationService }, { type: ControlsService }]; } });
1128
-
1129
- class TileLayerSettings {
1130
- maxZoom = 19;
1131
- minZoom = 0;
1132
- opacity = 0.6;
1133
- url = '';
1134
- projection = 'EPSG:3857';
1135
- static copy(model) {
1136
- const result = new TileLayerSettings();
1137
- result.maxZoom = model.maxZoom;
1138
- result.minZoom = model.minZoom;
1139
- result.projection = model.projection;
1140
- result.opacity = model.opacity;
1141
- result.url = model.url;
1142
- return result;
1143
- }
1144
- setUrl(url) {
1145
- return TileLayerSettings.copy({ ...this, url });
1146
- }
1147
- setMaxZoom(maxZoom) {
1148
- return TileLayerSettings.copy({ ...this, maxZoom });
1149
- }
1150
- setMinZoom(minZoom) {
1151
- return TileLayerSettings.copy({ ...this, minZoom });
1152
- }
1153
- setOpacity(opacity) {
1154
- return TileLayerSettings.copy({ ...this, opacity });
1155
- }
1156
- setProjection(projection) {
1157
- return TileLayerSettings.copy({ ...this, projection });
1158
- }
1159
- isSame(model) {
1160
- if (this.maxZoom !== model.maxZoom)
1161
- return false;
1162
- if (this.minZoom !== model.minZoom)
1163
- return false;
1164
- if (this.url !== model.url)
1165
- return false;
1166
- if (this.projection !== model.projection)
1167
- return false;
1168
- if (this.opacity !== model.opacity)
1169
- return false;
1170
- return true;
1171
- }
1172
- }
1173
-
1174
- class TileLayerFactory {
1175
- build(settings) {
1176
- const source = new XYZ({
1177
- tileSize: 256,
1178
- maxZoom: settings.maxZoom || 14,
1179
- minZoom: settings.minZoom || 1,
1180
- projection: get(settings.projection),
1181
- tileUrlFunction: this.getTileFunc(settings),
1182
- crossOrigin: 'Anonymous',
1183
- });
1184
- return new TileLayer({ source, opacity: settings.opacity });
1185
- }
1186
- getTileFunc(settings) {
1187
- return (tileCoord) => {
1188
- const zoom = tileCoord[0];
1189
- const x = tileCoord[1];
1190
- const y = tileCoord[2];
1191
- const normalizedCoord = this.getNormalizedCoord({ x: x, y: y }, zoom);
1192
- const bound = 1 << zoom;
1193
- return settings.url
1194
- .replace('{x}', String(normalizedCoord?.x || x))
1195
- .replace('{z}', String(zoom))
1196
- .replace('{y}', String(bound - (normalizedCoord?.y || y) - 1));
1197
- };
1198
- }
1199
- getNormalizedCoord(coord, zoom) {
1200
- const y = coord.y;
1201
- let x = coord.x;
1202
- const tileRange = 1 << zoom;
1203
- if (y < 0 || y >= tileRange)
1204
- return null;
1205
- if (x < 0 || x >= tileRange)
1206
- x = ((x % tileRange) + tileRange) % tileRange;
1207
- return { x: x, y: y };
1208
- }
1209
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TileLayerFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1210
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TileLayerFactory, providedIn: 'root' });
1211
- }
1212
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TileLayerFactory, decorators: [{
1213
- type: Injectable,
1214
- args: [{
1215
- providedIn: 'root',
1216
- }]
204
+ /**
205
+ *
206
+ * A control is a visible widget with a DOM element in a fixed position on the screen. They can involve user input (buttons), or be informational only; the position is determined using CSS. By default these are placed in the container with CSS class name ol-overlaycontainer-stopevent, but can use any outside DOM element.
207
+ * This is the base class for controls. You can use it for simple custom controls by creating the element with listeners, creating an instance:
208
+ * var myControl = new Control({element: myElement}); and then adding this to the map.
209
+ * The main advantage of having this as a control rather than a simple separate DOM element is that preventing propagation is handled for you. Controls will also be objects in a module:ol/Collection~Collection, so you can use their methods.
210
+ * You can also extend this base for your own control class. See examples/custom-controls for an example of how to do this.
211
+ */
212
+ class MapControl extends Control {
213
+ constructor(options) {
214
+ super(options);
215
+ }
216
+ }
217
+
218
+ class MapRenderedEvent extends PostboyGenericMessage {
219
+ map;
220
+ static ID = 'b6121807-3b89-4cd3-82cf-089d2cefdc4f';
221
+ constructor(map) {
222
+ super();
223
+ this.map = map;
224
+ }
225
+ get id() {
226
+ return MapRenderedEvent.ID;
227
+ }
228
+ }
229
+
230
+ class MapClickEvent extends PostboyGenericMessage {
231
+ coordinates;
232
+ entities;
233
+ features;
234
+ static ID = '323df526-8d9c-49c6-83e8-6e9a1e7762f7';
235
+ constructor(coordinates, entities, features) {
236
+ super();
237
+ this.coordinates = coordinates;
238
+ this.entities = entities;
239
+ this.features = features;
240
+ }
241
+ get id() {
242
+ return MapClickEvent.ID;
243
+ }
244
+ }
245
+
246
+ class MapMoveEndEvent extends PostboyGenericMessage {
247
+ zoom;
248
+ extent;
249
+ static ID = 'f21f783e-b5af-4489-9fec-8027fd07a8ad';
250
+ constructor(zoom, extent) {
251
+ super();
252
+ this.zoom = zoom;
253
+ this.extent = extent;
254
+ }
255
+ get id() {
256
+ return MapMoveEndEvent.ID;
257
+ }
258
+ }
259
+
260
+ class CloseTooltipCommand extends PostboyGenericMessage {
261
+ tooltipId;
262
+ static ID = '4896d52c-e34f-4994-bcfd-32832d12dbe4';
263
+ constructor(tooltipId) {
264
+ super();
265
+ this.tooltipId = tooltipId;
266
+ }
267
+ get id() {
268
+ return CloseTooltipCommand.ID;
269
+ }
270
+ }
271
+
272
+ class StartDrawingCommand extends PostboyCallbackMessage {
273
+ type;
274
+ style;
275
+ format;
276
+ static ID = 'da904f4b-a1c8-4db7-a6af-14d9ee18ec8c';
277
+ constructor(type, style, format = FeatureOutputFormat.GeoJson) {
278
+ super();
279
+ this.type = type;
280
+ this.style = style;
281
+ this.format = format;
282
+ }
283
+ get id() {
284
+ return StartDrawingCommand.ID;
285
+ }
286
+ }
287
+
288
+ class CancelDrawingCommand extends PostboyGenericMessage {
289
+ static ID = '7d38d983-feba-4176-a66b-18175e5ecd6b';
290
+ get id() {
291
+ return CancelDrawingCommand.ID;
292
+ }
293
+ }
294
+
295
+ class DrawSelectionAreaCommand extends PostboyCallbackMessage {
296
+ type;
297
+ style;
298
+ ignore;
299
+ static ID = '573d8a0d-f25b-42b7-9ad7-0ac6d86ac362';
300
+ constructor(type, style, ignore = new Set()) {
301
+ super();
302
+ this.type = type;
303
+ this.style = style;
304
+ this.ignore = ignore;
305
+ }
306
+ get id() {
307
+ return DrawSelectionAreaCommand.ID;
308
+ }
309
+ }
310
+
311
+ class ModifyFeatureCommand extends PostboyCallbackMessage {
312
+ model;
313
+ style;
314
+ format;
315
+ static ID = 'ead85caa-24c6-4844-a68c-2cea91774c8c';
316
+ constructor(model, style, format = FeatureOutputFormat.GeoJson) {
317
+ super();
318
+ this.model = model;
319
+ this.style = style;
320
+ this.format = format;
321
+ }
322
+ get id() {
323
+ return ModifyFeatureCommand.ID;
324
+ }
325
+ }
326
+
327
+ class CancelFeatureModificationCommand extends PostboyGenericMessage {
328
+ static ID = '9c9fb40f-ea95-4704-8177-0e9ecabf36fa';
329
+ get id() {
330
+ return CancelFeatureModificationCommand.ID;
331
+ }
332
+ }
333
+
334
+ class AddControlCommand extends PostboyGenericMessage {
335
+ item;
336
+ static ID = '8e1c06eb-b395-4fe1-929c-ebf0805eeb49';
337
+ constructor(item) {
338
+ super();
339
+ this.item = item;
340
+ }
341
+ get id() {
342
+ return AddControlCommand.ID;
343
+ }
344
+ }
345
+
346
+ class RemoveControlCommand extends PostboyGenericMessage {
347
+ item;
348
+ static ID = '361641e0-804a-4930-8c27-0cea6330dbfc';
349
+ constructor(item) {
350
+ super();
351
+ this.item = item;
352
+ }
353
+ get id() {
354
+ return RemoveControlCommand.ID;
355
+ }
356
+ }
357
+
358
+ /**
359
+ * Forces map to move to a specific point
360
+ */
361
+ class SetMapCenterCommand extends PostboyGenericMessage {
362
+ lat;
363
+ lng;
364
+ zoom;
365
+ static ID = 'd50e89c9-6707-4f8c-ab57-65fcef232182';
366
+ /**
367
+ *
368
+ * @param lat - the desired latitude
369
+ * @param lng - the desired longitude
370
+ * @param zoom - the desired zoom; doesn't change zoom if undefined
371
+ */
372
+ constructor(lat, lng, zoom) {
373
+ super();
374
+ this.lat = lat;
375
+ this.lng = lng;
376
+ this.zoom = zoom;
377
+ }
378
+ get id() {
379
+ return SetMapCenterCommand.ID;
380
+ }
381
+ }
382
+
383
+ class CalculateAreaExecutor extends PostboyExecutor {
384
+ polygon;
385
+ static ID = '172ecf46-86b5-4f46-a5f1-96ba2cbb1694';
386
+ constructor(polygon) {
387
+ super();
388
+ this.polygon = polygon;
389
+ }
390
+ get id() {
391
+ return CalculateAreaExecutor.ID;
392
+ }
393
+ }
394
+
395
+ class FitToPolygonsCommand extends PostboyGenericMessage {
396
+ features;
397
+ zoomAfter;
398
+ static ID = 'a9e42b23-ffaf-4c46-8370-e0432cd14d60';
399
+ constructor(features, zoomAfter = 0) {
400
+ super();
401
+ this.features = features;
402
+ this.zoomAfter = zoomAfter;
403
+ }
404
+ get id() {
405
+ return FitToPolygonsCommand.ID;
406
+ }
407
+ }
408
+
409
+ class AddLayerCommand extends PostboyGenericMessage {
410
+ layer;
411
+ static ID = 'd93e250f-92bc-43ac-9c6a-46c521a1aaa5';
412
+ constructor(layer) {
413
+ super();
414
+ this.layer = layer;
415
+ }
416
+ get id() {
417
+ return AddLayerCommand.ID;
418
+ }
419
+ }
420
+
421
+ class PlaceLayerFeaturesCommand extends PostboyGenericMessage {
422
+ layer;
423
+ features;
424
+ static ID = '8caf86bc-869b-426f-b36d-4642f6b8aab0';
425
+ constructor(layer, features) {
426
+ super();
427
+ this.layer = layer;
428
+ this.features = features;
429
+ }
430
+ get id() {
431
+ return PlaceLayerFeaturesCommand.ID;
432
+ }
433
+ }
434
+
435
+ class RemoveLayerCommand extends PostboyGenericMessage {
436
+ layer;
437
+ static ID = 'ab484e0e-e185-45cd-8434-12101f3c7eb1';
438
+ constructor(layer) {
439
+ super();
440
+ this.layer = layer;
441
+ }
442
+ get id() {
443
+ return RemoveLayerCommand.ID;
444
+ }
445
+ }
446
+
447
+ class AddTileCommand extends PostboyGenericMessage {
448
+ layer;
449
+ static ID = '25b7df28-72ce-4453-9fe6-54285a2fdc57';
450
+ constructor(layer) {
451
+ super();
452
+ this.layer = layer;
453
+ }
454
+ get id() {
455
+ return AddTileCommand.ID;
456
+ }
457
+ }
458
+
459
+ class RemoveTileCommand extends PostboyGenericMessage {
460
+ layer;
461
+ static ID = 'c36ccc0b-5638-4819-b148-2de57a59a5b7';
462
+ constructor(layer) {
463
+ super();
464
+ this.layer = layer;
465
+ }
466
+ get id() {
467
+ return RemoveTileCommand.ID;
468
+ }
469
+ }
470
+
471
+ class FitToFeaturesCommand extends PostboyGenericMessage {
472
+ features;
473
+ zoomAfter;
474
+ static ID = '76cdc091-3793-4b6c-82f7-1e0334cf08a8';
475
+ constructor(features, zoomAfter = 0) {
476
+ super();
477
+ this.features = features;
478
+ this.zoomAfter = zoomAfter;
479
+ }
480
+ get id() {
481
+ return FitToFeaturesCommand.ID;
482
+ }
483
+ }
484
+
485
+ class GetLayerQuery extends PostboyCallbackMessage {
486
+ name;
487
+ static ID = '5c04c87b-8a93-4c2a-979e-d1e313d860ed';
488
+ constructor(name) {
489
+ super();
490
+ this.name = name;
491
+ }
492
+ get id() {
493
+ return GetLayerQuery.ID;
494
+ }
495
+ }
496
+
497
+ class DrawingFinishedEvent extends PostboyGenericMessage {
498
+ static ID = 'c724b68e-b4eb-4783-90f1-a8e31973fd36';
499
+ constructor() {
500
+ super();
501
+ }
502
+ get id() {
503
+ return DrawingFinishedEvent.ID;
504
+ }
505
+ }
506
+
507
+ class DrawingGenerationService {
508
+ static getDraw(ev) {
509
+ return new Draw({
510
+ source: ev.layer.getSource(),
511
+ type: ev.type === DrawingType.Polygon ? 'Polygon' : 'Circle',
512
+ style: ev.style,
513
+ geometryFunction: DrawingGenerationService.geometryFunc(ev.type),
514
+ });
515
+ }
516
+ static geometryFunc(type) {
517
+ switch (type) {
518
+ case DrawingType.Circle:
519
+ return createRegularPolygon(32);
520
+ case DrawingType.Box:
521
+ return createBox();
522
+ case DrawingType.Square:
523
+ return createRegularPolygon(4);
524
+ }
525
+ return undefined;
526
+ }
527
+ }
528
+
529
+ class FeatureService {
530
+ constructor() { }
531
+ static filterFeaturesInArea(query) {
532
+ return query.features.filter((f) => FeatureService.booleanIntersects(query.area, f.getGeometry()));
533
+ }
534
+ static booleanIntersects(g1, g2) {
535
+ if (g2.getType() === 'Point')
536
+ return g1.intersectsCoordinate(g2.getCoordinates());
537
+ if (g2.getType() === 'Circle')
538
+ return g1.intersectsCoordinate(g2.getCenter());
539
+ if (g2.getType() === 'Polygon')
540
+ return g1.intersectsCoordinate(g2.getInteriorPoint().getCoordinates());
541
+ return false;
542
+ }
543
+ static calculateArea(g) {
544
+ if (!g)
545
+ return 0;
546
+ return Sphere.getArea(g, { projection: 'EPSG:4326' });
547
+ }
548
+ }
549
+
550
+ class GetFeaturesInAreaQuery extends PostboyCallbackMessage {
551
+ area;
552
+ ignore;
553
+ static ID = 'efcf4271-a07a-40e0-9f02-d4dade40b8ac';
554
+ constructor(area, ignore = new Set()) {
555
+ super();
556
+ this.area = area;
557
+ this.ignore = ignore;
558
+ }
559
+ get id() {
560
+ return GetFeaturesInAreaQuery.ID;
561
+ }
562
+ }
563
+
564
+ class FilterFeaturesInAreaExecutor extends PostboyExecutor {
565
+ area;
566
+ features;
567
+ static ID = '36bb2d94-8028-4512-90dd-2386af3fc67c';
568
+ constructor(area, features) {
569
+ super();
570
+ this.area = area;
571
+ this.features = features;
572
+ }
573
+ get id() {
574
+ return FilterFeaturesInAreaExecutor.ID;
575
+ }
576
+ }
577
+
578
+ class GenerateDrawExecutor extends PostboyExecutor {
579
+ layer;
580
+ style;
581
+ type;
582
+ static ID = 'f01c99ba-0953-4ab5-82f9-04e6fbb678c1';
583
+ constructor(layer, style, type) {
584
+ super();
585
+ this.layer = layer;
586
+ this.style = style;
587
+ this.type = type;
588
+ }
589
+ get id() {
590
+ return GenerateDrawExecutor.ID;
591
+ }
592
+ }
593
+
594
+ class GenerateZoomControlExecutor extends PostboyExecutor {
595
+ settings;
596
+ static ID = 'ff16a833-c68e-4b1a-bc23-c0d16b002810';
597
+ constructor(settings) {
598
+ super();
599
+ this.settings = settings;
600
+ }
601
+ get id() {
602
+ return GenerateZoomControlExecutor.ID;
603
+ }
604
+ }
605
+
606
+ class ZoomControlFactory {
607
+ static build(settings) {
608
+ return new Zoom({
609
+ zoomInTipLabel: settings.zoomInLabel,
610
+ zoomOutTipLabel: settings.zoomOutLabel,
611
+ zoomInClassName: settings.zoomInClass,
612
+ zoomOutClassName: settings.zoomOutClass,
613
+ className: settings.controlClass,
614
+ });
615
+ }
616
+ }
617
+
618
+ class MapPostboyService extends PostboyService {
619
+ constructor() {
620
+ super();
621
+ this.addLocker({ locker: StartDrawingCommand.ID, unlocker: DrawingFinishedEvent.ID, locking: [MapClickEvent.ID] });
622
+ }
623
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapPostboyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
624
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapPostboyService });
625
+ }
626
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapPostboyService, decorators: [{
627
+ type: Injectable
628
+ }], ctorParameters: () => [] });
629
+
630
+ class MapManagementService {
631
+ postboy;
632
+ map;
633
+ layers = new Dictionary();
634
+ constructor(postboy) {
635
+ this.postboy = postboy;
636
+ }
637
+ up() {
638
+ this.observeMapRender();
639
+ this.observeAddLayer();
640
+ this.observeRemoveLayer();
641
+ this.observePlaceFeatures();
642
+ this.observeAddTile();
643
+ this.observeRemoveTile();
644
+ this.observeLayerQuery();
645
+ this.observeFeaturesInArea();
646
+ }
647
+ observeRemoveTile() {
648
+ this.postboy.subscribe(RemoveTileCommand.ID).subscribe((c) => {
649
+ if (!this.map)
650
+ return;
651
+ this.map.removeLayer(c.layer);
652
+ });
653
+ }
654
+ observeLayerQuery() {
655
+ this.postboy.subscribe(GetLayerQuery.ID).subscribe((ev) => ev.finish(this.layers.take(ev.name)));
656
+ }
657
+ observeAddTile() {
658
+ this.postboy.subscribe(AddTileCommand.ID).subscribe((c) => {
659
+ if (!this.map)
660
+ return;
661
+ this.map.addLayer(c.layer);
662
+ });
663
+ }
664
+ observeMapRender() {
665
+ this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
666
+ this.map = m.map;
667
+ });
668
+ }
669
+ observeAddLayer() {
670
+ this.postboy.subscribe(AddLayerCommand.ID).subscribe((c) => {
671
+ if (!this.map)
672
+ return;
673
+ this.layers.put(c.layer.get('name'), c.layer);
674
+ this.map.addLayer(c.layer);
675
+ });
676
+ }
677
+ observePlaceFeatures() {
678
+ this.postboy.subscribe(PlaceLayerFeaturesCommand.ID).subscribe((c) => {
679
+ if (!this.layers.has(c.layer))
680
+ return;
681
+ let source = this.layers.take(c.layer).getSource();
682
+ if (!!source['getSource'])
683
+ source = source?.getSource();
684
+ source?.clear();
685
+ !!c.features?.length && source?.addFeatures(c.features);
686
+ });
687
+ }
688
+ observeRemoveLayer() {
689
+ this.postboy.subscribe(RemoveLayerCommand.ID).subscribe((c) => {
690
+ if (!this.map)
691
+ return;
692
+ this.layers.rmv(c.layer.get('name'));
693
+ this.map.removeLayer(c.layer);
694
+ });
695
+ }
696
+ observeFeaturesInArea() {
697
+ this.postboy.subscribe(GetFeaturesInAreaQuery.ID).subscribe((qr) => {
698
+ let result = new Dictionary();
699
+ this.layers.forEach((l) => {
700
+ let layerName = l.get('name');
701
+ if (qr.ignore.has(layerName) || layerName === MapConstants.DrawingLayerId)
702
+ return;
703
+ let source = l.getSource();
704
+ if (!!source['getSource'])
705
+ source = source?.getSource();
706
+ let features = this.postboy.execute(new FilterFeaturesInAreaExecutor(qr.area, source?.getFeatures() ?? []));
707
+ result.put(layerName, features.map((e) => ({ id: e.getId(), ...e.get(MapConstants.FeatureInfo) })));
708
+ });
709
+ qr.finish(result);
710
+ });
711
+ }
712
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapManagementService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
713
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapManagementService });
714
+ }
715
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapManagementService, decorators: [{
716
+ type: Injectable
717
+ }], ctorParameters: () => [{ type: MapPostboyService }] });
718
+
719
+ class MapStateService {
720
+ postboy;
721
+ map;
722
+ constructor(postboy) {
723
+ this.postboy = postboy;
724
+ }
725
+ up() {
726
+ this.observeMapRendering();
727
+ this.observeCenter();
728
+ }
729
+ observeMapRendering() {
730
+ this.postboy
731
+ .subscribe(MapRenderedEvent.ID)
732
+ .pipe(first())
733
+ .subscribe((ev) => {
734
+ this.map = ev.map;
735
+ this.map?.on('moveend', () => {
736
+ const zoom = Math.floor(this.map?.getView().getZoom() || -1);
737
+ const extent = this.map?.getView().calculateExtent() || [];
738
+ this.postboy.fire(new MapMoveEndEvent(zoom, extent));
739
+ });
740
+ });
741
+ }
742
+ observeCenter() {
743
+ this.postboy.subscribe(SetMapCenterCommand.ID).subscribe((c) => {
744
+ this.map?.getView().setCenter([c.lng, c.lat]);
745
+ if (c.zoom)
746
+ this.map?.getView().setZoom(c.zoom);
747
+ });
748
+ }
749
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapStateService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
750
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapStateService });
751
+ }
752
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapStateService, decorators: [{
753
+ type: Injectable
754
+ }], ctorParameters: () => [{ type: MapPostboyService }] });
755
+
756
+ class MapFeatureService {
757
+ postboy;
758
+ map;
759
+ fitPolygonsWaiting;
760
+ constructor(postboy) {
761
+ this.postboy = postboy;
762
+ }
763
+ up() {
764
+ this.observeMapRender();
765
+ this.observeFitToFeatures();
766
+ this.observeFitToPolygons();
767
+ }
768
+ observeMapRender() {
769
+ this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
770
+ this.map = m.map;
771
+ if (this.fitPolygonsWaiting)
772
+ this.postboy.fire(this.fitPolygonsWaiting);
773
+ });
774
+ }
775
+ observeFitToFeatures() {
776
+ this.postboy.subscribe(FitToFeaturesCommand.ID).subscribe((cmd) => {
777
+ this.fitToGeometries(cmd.features.map((f) => f.getGeometry()), cmd.zoomAfter);
778
+ });
779
+ }
780
+ observeFitToPolygons() {
781
+ this.postboy.subscribe(FitToPolygonsCommand.ID).subscribe((cmd) => {
782
+ if (!this.map) {
783
+ this.fitPolygonsWaiting = cmd;
784
+ return;
785
+ }
786
+ this.fitPolygonsWaiting = undefined;
787
+ this.fitToGeometries(cmd.features.map((f) => f.feature.getGeometry()), cmd.zoomAfter);
788
+ });
789
+ }
790
+ fitToGeometries(geometries, zoomAfter) {
791
+ if (!geometries?.length || !this.map)
792
+ return;
793
+ const extent = createEmpty();
794
+ geometries.forEach((g) => extend(extent, g.getExtent()));
795
+ this.map.getView().fit(extent);
796
+ this.map.getView().setZoom(this.map.getView().getZoom() + zoomAfter);
797
+ }
798
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapFeatureService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
799
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapFeatureService });
800
+ }
801
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapFeatureService, decorators: [{
802
+ type: Injectable
803
+ }], ctorParameters: () => [{ type: MapPostboyService }] });
804
+
805
+ class MapClickService {
806
+ postboy;
807
+ map;
808
+ constructor(postboy) {
809
+ this.postboy = postboy;
810
+ }
811
+ up() {
812
+ this.observeMapRender();
813
+ }
814
+ observeMapRender() {
815
+ this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
816
+ this.map = m.map;
817
+ this.map?.on('singleclick', (e) => {
818
+ this.postboy.fire(this.onClick(e));
819
+ });
820
+ });
821
+ }
822
+ onClick(ev) {
823
+ const model = new MapClickEvent(ev.coordinate, {}, {});
824
+ this.map?.forEachFeatureAtPixel(ev.pixel, (f, l) => {
825
+ this.getFeatureCollectionWithInner([f])
826
+ .filter((f) => f.getId() != null)
827
+ .forEach((fs) => {
828
+ let layerName = l.get('name');
829
+ if (!model.entities[layerName])
830
+ model.entities[layerName] = [];
831
+ if (!model.features[layerName])
832
+ model.features[layerName] = [];
833
+ model.entities[layerName].push({ id: fs.getId(), ...fs.get(MapConstants.FeatureInfo) });
834
+ model.features[layerName].push(fs);
835
+ });
836
+ });
837
+ return model;
838
+ }
839
+ getFeatureCollectionWithInner(features) {
840
+ const result = [];
841
+ features?.forEach((f) => {
842
+ const innerFeatures = f.get('features');
843
+ innerFeatures?.length ? result.push(...innerFeatures) : result.push(f);
844
+ });
845
+ return result;
846
+ }
847
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapClickService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
848
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapClickService });
849
+ }
850
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapClickService, decorators: [{
851
+ type: Injectable
852
+ }], ctorParameters: () => [{ type: MapPostboyService }] });
853
+
854
+ class DrawingService {
855
+ postboy;
856
+ drawInteraction;
857
+ map;
858
+ constructor(postboy) {
859
+ this.postboy = postboy;
860
+ }
861
+ up() {
862
+ this.observeDrawing();
863
+ this.observeSelectArea();
864
+ this.observeMapRender();
865
+ }
866
+ observeSelectArea() {
867
+ this.postboy.subscribe(DrawSelectionAreaCommand.ID).subscribe((ev) => {
868
+ const drawingCommand = new StartDrawingCommand(ev.type, ev.style);
869
+ drawingCommand.result.subscribe((r) => {
870
+ if (!r) {
871
+ ev.finish(new Dictionary());
872
+ return;
873
+ }
874
+ const area = PolygonModel.fromGeoJson(1, r).feature.getGeometry();
875
+ const getFeaturesCommand = new GetFeaturesInAreaQuery(area, ev.ignore);
876
+ getFeaturesCommand.result.subscribe((result) => ev.finish(result));
877
+ this.postboy.fire(getFeaturesCommand);
878
+ });
879
+ this.postboy.fire(drawingCommand);
880
+ });
881
+ }
882
+ observeDrawing() {
883
+ this.postboy.subscribe(StartDrawingCommand.ID).subscribe((ev) => {
884
+ this.draw((l) => {
885
+ if (!l || !this.map) {
886
+ this.clearInteraction(l);
887
+ return;
888
+ }
889
+ const cancelSub = this.observeCancelation(ev, l);
890
+ this.drawInteraction = this.postboy.execute(new GenerateDrawExecutor(l, ev.style, ev.type));
891
+ this.map?.addInteraction(this.drawInteraction);
892
+ this.drawInteraction.on('drawend', (evt) => {
893
+ cancelSub.unsubscribe();
894
+ this.onEnd(evt, ev, l);
895
+ });
896
+ });
897
+ });
898
+ }
899
+ onEnd(evt, command, layer) {
900
+ command.finish(command.format === FeatureOutputFormat.GeoJson
901
+ ? new GeoJSON().writeFeature(evt.feature)
902
+ : new WKT().writeFeature(evt.feature));
903
+ this.clearInteraction(layer);
904
+ }
905
+ observeMapRender() {
906
+ this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
907
+ this.map = m.map;
908
+ });
909
+ }
910
+ draw(action) {
911
+ const query = new GetLayerQuery(MapConstants.DrawingLayerId);
912
+ query.result.subscribe((l) => action(l));
913
+ this.postboy.fire(query);
914
+ }
915
+ observeCancelation(ev, layer) {
916
+ return this.postboy
917
+ .subscribe(CancelDrawingCommand.ID)
918
+ .pipe(first())
919
+ .subscribe(() => {
920
+ ev.finish(null);
921
+ this.clearInteraction(layer);
922
+ });
923
+ }
924
+ clearInteraction(layer) {
925
+ if (!!this.drawInteraction) {
926
+ this.map?.removeInteraction(this.drawInteraction);
927
+ layer?.setSource(new Vector({}));
928
+ }
929
+ setTimeout(() => this.postboy.fire(new DrawingFinishedEvent()), 300);
930
+ }
931
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: DrawingService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
932
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: DrawingService });
933
+ }
934
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: DrawingService, decorators: [{
935
+ type: Injectable
936
+ }], ctorParameters: () => [{ type: MapPostboyService }] });
937
+
938
+ class FeatureModificationService {
939
+ postboy;
940
+ modify;
941
+ translate;
942
+ map;
943
+ constructor(postboy) {
944
+ this.postboy = postboy;
945
+ }
946
+ up() {
947
+ this.observeModification();
948
+ this.observeMapRender();
949
+ }
950
+ observeModification() {
951
+ this.postboy.subscribe(ModifyFeatureCommand.ID).subscribe((ev) => {
952
+ this.defineLayer((l) => {
953
+ if (!l || !this.map) {
954
+ this.clearInteraction(l);
955
+ return;
956
+ }
957
+ this.observeCancelation(ev, l);
958
+ this.initFeature(l, ev.model.feature);
959
+ this.addModify(ev);
960
+ this.addDragging(ev);
961
+ });
962
+ });
963
+ }
964
+ initFeature(layer, feature) {
965
+ layer.getSource()?.clear();
966
+ layer.getSource()?.addFeature(feature);
967
+ }
968
+ addModify(command) {
969
+ this.modify = new Modify({
970
+ features: new Collection([command.model.feature]),
971
+ style: command.style,
972
+ });
973
+ this.modify.on('modifyend', () => {
974
+ this.onModified(command);
975
+ command.model.feature.changed();
976
+ });
977
+ this.map?.addInteraction(this.modify);
978
+ }
979
+ addDragging(command) {
980
+ this.translate = new Translate({
981
+ features: new Collection([command.model.feature]),
982
+ condition: (ev) => {
983
+ const clone = command.model.feature.clone();
984
+ clone.getGeometry()?.scale(0.999);
985
+ return clone.getGeometry().intersectsCoordinate(ev.coordinate);
986
+ },
987
+ });
988
+ this.translate.on('translateend', () => this.onModified(command));
989
+ this.map?.addInteraction(this.translate);
990
+ }
991
+ onModified(command) {
992
+ command.next(command.format === FeatureOutputFormat.GeoJson
993
+ ? new GeoJSON().writeFeature(command.model.feature)
994
+ : new WKT().writeFeature(command.model.feature));
995
+ }
996
+ observeMapRender() {
997
+ this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
998
+ this.map = m.map;
999
+ });
1000
+ }
1001
+ defineLayer(action) {
1002
+ const query = new GetLayerQuery(MapConstants.DrawingLayerId);
1003
+ query.result.subscribe((l) => action(l));
1004
+ this.postboy.fire(query);
1005
+ }
1006
+ observeCancelation(ev, layer) {
1007
+ return this.postboy
1008
+ .subscribe(CancelFeatureModificationCommand.ID)
1009
+ .pipe(first())
1010
+ .subscribe(() => {
1011
+ ev.finish(null);
1012
+ this.clearInteraction(layer);
1013
+ });
1014
+ }
1015
+ clearInteraction(layer) {
1016
+ if (this.modify)
1017
+ this.map?.removeInteraction(this.modify);
1018
+ if (this.translate)
1019
+ this.map?.removeInteraction(this.translate);
1020
+ }
1021
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: FeatureModificationService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
1022
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: FeatureModificationService });
1023
+ }
1024
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: FeatureModificationService, decorators: [{
1025
+ type: Injectable
1026
+ }], ctorParameters: () => [{ type: MapPostboyService }] });
1027
+
1028
+ class ControlsService {
1029
+ postboy;
1030
+ map;
1031
+ constructor(postboy) {
1032
+ this.postboy = postboy;
1033
+ }
1034
+ up() {
1035
+ this.observeMapRender();
1036
+ }
1037
+ observeMapRender() {
1038
+ this.postboy
1039
+ .subscribe(MapRenderedEvent.ID)
1040
+ .pipe(first())
1041
+ .subscribe((m) => {
1042
+ this.map = m.map;
1043
+ this.observeAdding();
1044
+ this.observeRemoving();
1045
+ });
1046
+ }
1047
+ observeAdding() {
1048
+ this.postboy.subscribe(AddControlCommand.ID).subscribe((c) => this.map?.addControl(c.item));
1049
+ }
1050
+ observeRemoving() {
1051
+ this.postboy
1052
+ .subscribe(RemoveControlCommand.ID)
1053
+ .subscribe((c) => this.map?.removeControl(c.item));
1054
+ }
1055
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ControlsService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
1056
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ControlsService });
1057
+ }
1058
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ControlsService, decorators: [{
1059
+ type: Injectable
1060
+ }], ctorParameters: () => [{ type: MapPostboyService }] });
1061
+
1062
+ class MessageRegistratorService extends PostboyAbstractRegistrator {
1063
+ constructor(service, management, state, mapFeature, interaction, drawing, featureModification, controls) {
1064
+ super(service);
1065
+ this.registerServices([management, state, interaction, mapFeature, drawing, featureModification, controls]);
1066
+ }
1067
+ _up() {
1068
+ this.registerReplay(MapRenderedEvent.ID);
1069
+ this.registerReplay(PlaceLayerFeaturesCommand.ID);
1070
+ this.registerReplay(RemoveControlCommand.ID);
1071
+ this.registerReplay(AddControlCommand.ID);
1072
+ this.registerReplay(SetMapCenterCommand.ID);
1073
+ this.registerSubject(AddLayerCommand.ID);
1074
+ this.registerSubject(RemoveLayerCommand.ID);
1075
+ this.registerSubject(AddTileCommand.ID);
1076
+ this.registerSubject(RemoveTileCommand.ID);
1077
+ this.registerSubject(MapClickEvent.ID);
1078
+ this.registerSubject(CloseTooltipCommand.ID);
1079
+ this.registerSubject(FitToFeaturesCommand.ID);
1080
+ this.registerSubject(FitToPolygonsCommand.ID);
1081
+ this.registerSubject(MapMoveEndEvent.ID);
1082
+ this.registerSubject(CancelDrawingCommand.ID);
1083
+ this.registerSubject(StartDrawingCommand.ID);
1084
+ this.registerSubject(GetLayerQuery.ID);
1085
+ this.registerSubject(DrawingFinishedEvent.ID);
1086
+ this.registerSubject(GetFeaturesInAreaQuery.ID);
1087
+ this.registerSubject(DrawSelectionAreaCommand.ID);
1088
+ this.registerSubject(CancelFeatureModificationCommand.ID);
1089
+ this.registerSubject(ModifyFeatureCommand.ID);
1090
+ this.setExecutors();
1091
+ }
1092
+ setExecutors() {
1093
+ this.registerExecutor(FilterFeaturesInAreaExecutor.ID, (e) => FeatureService.filterFeaturesInArea(e));
1094
+ this.registerExecutor(CalculateAreaExecutor.ID, (e) => FeatureService.calculateArea(e.polygon?.feature?.getGeometry()));
1095
+ this.registerExecutor(GenerateDrawExecutor.ID, (e) => DrawingGenerationService.getDraw(e));
1096
+ this.registerExecutor(GenerateZoomControlExecutor.ID, (e) => ZoomControlFactory.build(e.settings));
1097
+ }
1098
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MessageRegistratorService, deps: [{ token: MapPostboyService }, { token: MapManagementService }, { token: MapStateService }, { token: MapFeatureService }, { token: MapClickService }, { token: DrawingService }, { token: FeatureModificationService }, { token: ControlsService }], target: i0.ɵɵFactoryTarget.Injectable });
1099
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MessageRegistratorService });
1100
+ }
1101
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MessageRegistratorService, decorators: [{
1102
+ type: Injectable
1103
+ }], ctorParameters: () => [{ type: MapPostboyService }, { type: MapManagementService }, { type: MapStateService }, { type: MapFeatureService }, { type: MapClickService }, { type: DrawingService }, { type: FeatureModificationService }, { type: ControlsService }] });
1104
+
1105
+ class TileLayerSettings {
1106
+ maxZoom = 19;
1107
+ minZoom = 0;
1108
+ opacity = 0.6;
1109
+ url = '';
1110
+ projection = 'EPSG:3857';
1111
+ static copy(model) {
1112
+ const result = new TileLayerSettings();
1113
+ result.maxZoom = model.maxZoom;
1114
+ result.minZoom = model.minZoom;
1115
+ result.projection = model.projection;
1116
+ result.opacity = model.opacity;
1117
+ result.url = model.url;
1118
+ return result;
1119
+ }
1120
+ setUrl(url) {
1121
+ return TileLayerSettings.copy({ ...this, url });
1122
+ }
1123
+ setMaxZoom(maxZoom) {
1124
+ return TileLayerSettings.copy({ ...this, maxZoom });
1125
+ }
1126
+ setMinZoom(minZoom) {
1127
+ return TileLayerSettings.copy({ ...this, minZoom });
1128
+ }
1129
+ setOpacity(opacity) {
1130
+ return TileLayerSettings.copy({ ...this, opacity });
1131
+ }
1132
+ setProjection(projection) {
1133
+ return TileLayerSettings.copy({ ...this, projection });
1134
+ }
1135
+ isSame(model) {
1136
+ if (this.maxZoom !== model.maxZoom)
1137
+ return false;
1138
+ if (this.minZoom !== model.minZoom)
1139
+ return false;
1140
+ if (this.url !== model.url)
1141
+ return false;
1142
+ if (this.projection !== model.projection)
1143
+ return false;
1144
+ if (this.opacity !== model.opacity)
1145
+ return false;
1146
+ return true;
1147
+ }
1148
+ }
1149
+
1150
+ class TileLayerFactory {
1151
+ build(settings) {
1152
+ const source = new XYZ({
1153
+ tileSize: 256,
1154
+ maxZoom: settings.maxZoom || 14,
1155
+ minZoom: settings.minZoom || 1,
1156
+ projection: get(settings.projection),
1157
+ tileUrlFunction: this.getTileFunc(settings),
1158
+ crossOrigin: 'Anonymous',
1159
+ });
1160
+ return new TileLayer({ source, opacity: settings.opacity });
1161
+ }
1162
+ getTileFunc(settings) {
1163
+ return (tileCoord) => {
1164
+ const zoom = tileCoord[0];
1165
+ const x = tileCoord[1];
1166
+ const y = tileCoord[2];
1167
+ const normalizedCoord = this.getNormalizedCoord({ x: x, y: y }, zoom);
1168
+ const bound = 1 << zoom;
1169
+ return settings.url
1170
+ .replace('{x}', String(normalizedCoord?.x || x))
1171
+ .replace('{z}', String(zoom))
1172
+ .replace('{y}', String(bound - (normalizedCoord?.y || y) - 1));
1173
+ };
1174
+ }
1175
+ getNormalizedCoord(coord, zoom) {
1176
+ const y = coord.y;
1177
+ let x = coord.x;
1178
+ const tileRange = 1 << zoom;
1179
+ if (y < 0 || y >= tileRange)
1180
+ return null;
1181
+ if (x < 0 || x >= tileRange)
1182
+ x = ((x % tileRange) + tileRange) % tileRange;
1183
+ return { x: x, y: y };
1184
+ }
1185
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: TileLayerFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1186
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: TileLayerFactory, providedIn: 'root' });
1187
+ }
1188
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: TileLayerFactory, decorators: [{
1189
+ type: Injectable,
1190
+ args: [{
1191
+ providedIn: 'root',
1192
+ }]
1217
1193
  }] });
1218
1194
 
1219
- class TileLayerComponent extends DestructibleComponent {
1220
- postboy;
1221
- factory;
1222
- layer;
1223
- constructor(postboy, factory) {
1224
- super();
1225
- this.postboy = postboy;
1226
- this.factory = factory;
1227
- }
1228
- ngOnInit() {
1229
- this.postboy
1230
- .subscribe(MapRenderedEvent.ID)
1231
- .pipe(filter((m) => !!m), first())
1232
- .subscribe((m) => this.initLayer());
1233
- }
1234
- _settings = new TileLayerSettings();
1235
- set settings(value) {
1236
- if (!value || this._settings.isSame(value))
1237
- return;
1238
- this._settings = value;
1239
- this.initLayer();
1240
- }
1241
- onDestroy = () => this.removeLayer();
1242
- initLayer() {
1243
- this.removeLayer();
1244
- this.layer = this.factory.build(this._settings);
1245
- this.postboy.fire(new AddTileCommand(this.layer));
1246
- }
1247
- removeLayer() {
1248
- if (this.layer)
1249
- this.postboy.fire(new RemoveTileCommand(this.layer));
1250
- }
1251
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TileLayerComponent, deps: [{ token: MapPostboyService }, { token: TileLayerFactory }], target: i0.ɵɵFactoryTarget.Component });
1252
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TileLayerComponent, selector: "art-tile-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1253
- }
1254
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TileLayerComponent, decorators: [{
1255
- type: Component,
1256
- args: [{ selector: 'art-tile-layer', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
1257
- }], ctorParameters: function () { return [{ type: MapPostboyService }, { type: TileLayerFactory }]; }, propDecorators: { settings: [{
1258
- type: Input
1195
+ class TileLayerComponent extends DestructibleComponent {
1196
+ postboy;
1197
+ factory;
1198
+ layer;
1199
+ constructor(postboy, factory) {
1200
+ super();
1201
+ this.postboy = postboy;
1202
+ this.factory = factory;
1203
+ }
1204
+ ngOnInit() {
1205
+ this.postboy
1206
+ .subscribe(MapRenderedEvent.ID)
1207
+ .pipe(filter((m) => !!m), first())
1208
+ .subscribe((m) => this.initLayer());
1209
+ }
1210
+ _settings = new TileLayerSettings();
1211
+ set settings(value) {
1212
+ if (!value || this._settings.isSame(value))
1213
+ return;
1214
+ this._settings = value;
1215
+ this.initLayer();
1216
+ }
1217
+ onDestroy = () => this.removeLayer();
1218
+ initLayer() {
1219
+ this.removeLayer();
1220
+ this.layer = this.factory.build(this._settings);
1221
+ this.postboy.fire(new AddTileCommand(this.layer));
1222
+ }
1223
+ removeLayer() {
1224
+ if (this.layer)
1225
+ this.postboy.fire(new RemoveTileCommand(this.layer));
1226
+ }
1227
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: TileLayerComponent, deps: [{ token: MapPostboyService }, { token: TileLayerFactory }], target: i0.ɵɵFactoryTarget.Component });
1228
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: TileLayerComponent, selector: "art-tile-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1229
+ }
1230
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: TileLayerComponent, decorators: [{
1231
+ type: Component,
1232
+ args: [{ selector: 'art-tile-layer', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
1233
+ }], ctorParameters: () => [{ type: MapPostboyService }, { type: TileLayerFactory }], propDecorators: { settings: [{
1234
+ type: Input
1259
1235
  }] } });
1260
1236
 
1261
- class OsmTileLayerComponent extends DestructibleComponent {
1262
- layer;
1263
- constructor() {
1264
- super();
1265
- }
1266
- _url = '';
1267
- set url(value) {
1268
- if (!value || this._url === value)
1269
- return;
1270
- this._url = value;
1271
- this.initLayer();
1272
- }
1273
- _map;
1274
- set map(value) {
1275
- if (!value || this._map === value)
1276
- return;
1277
- this._map = value;
1278
- this.initLayer();
1279
- }
1280
- ngOnInit() { }
1281
- ngOnDestroy() {
1282
- if (this.layer) {
1283
- this._map?.removeLayer(this.layer);
1284
- }
1285
- // @ts-ignore
1286
- this.layer?.setMap(null);
1287
- }
1288
- initLayer() {
1289
- if (!this._url || !this._map)
1290
- return;
1291
- if (this.layer)
1292
- this._map.removeLayer(this.layer);
1293
- this.layer = new TileLayer({
1294
- source: new OSM({
1295
- url: this._url,
1296
- }),
1297
- });
1298
- this.layer.set('name', 'osm-tile-layer');
1299
- this._map.addLayer(this.layer);
1300
- }
1301
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: OsmTileLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1302
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: OsmTileLayerComponent, selector: "art-osm-tile-layer", inputs: { url: "url", map: "map" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1303
- }
1304
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: OsmTileLayerComponent, decorators: [{
1305
- type: Component,
1306
- args: [{ selector: 'art-osm-tile-layer', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
1307
- }], ctorParameters: function () { return []; }, propDecorators: { url: [{
1308
- type: Input
1309
- }], map: [{
1310
- type: Input
1237
+ class OsmTileLayerComponent extends DestructibleComponent {
1238
+ layer;
1239
+ constructor() {
1240
+ super();
1241
+ }
1242
+ _url = '';
1243
+ set url(value) {
1244
+ if (!value || this._url === value)
1245
+ return;
1246
+ this._url = value;
1247
+ this.initLayer();
1248
+ }
1249
+ _map;
1250
+ set map(value) {
1251
+ if (!value || this._map === value)
1252
+ return;
1253
+ this._map = value;
1254
+ this.initLayer();
1255
+ }
1256
+ ngOnInit() { }
1257
+ ngOnDestroy() {
1258
+ if (this.layer) {
1259
+ this._map?.removeLayer(this.layer);
1260
+ }
1261
+ // @ts-ignore
1262
+ this.layer?.setMap(null);
1263
+ }
1264
+ initLayer() {
1265
+ if (!this._url || !this._map)
1266
+ return;
1267
+ if (this.layer)
1268
+ this._map.removeLayer(this.layer);
1269
+ this.layer = new TileLayer({
1270
+ source: new OSM({
1271
+ url: this._url,
1272
+ }),
1273
+ });
1274
+ this.layer.set('name', 'osm-tile-layer');
1275
+ this._map.addLayer(this.layer);
1276
+ }
1277
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: OsmTileLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1278
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: OsmTileLayerComponent, selector: "art-osm-tile-layer", inputs: { url: "url", map: "map" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1279
+ }
1280
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: OsmTileLayerComponent, decorators: [{
1281
+ type: Component,
1282
+ args: [{ selector: 'art-osm-tile-layer', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
1283
+ }], ctorParameters: () => [], propDecorators: { url: [{
1284
+ type: Input
1285
+ }], map: [{
1286
+ type: Input
1311
1287
  }] } });
1312
1288
 
1313
- /**
1314
- * A layer that is responsible for showing and styling main features on the map, such as markers and polygons
1315
- */
1316
- class FeatureLayerSettings {
1317
- /**
1318
- * The identifier of the field, it is autogenerated by default, but can be set manually
1319
- */
1320
- name = IdGenerator.get();
1321
- /**
1322
- * The priority of showing - layers with higher zIndex cover others in case of collisions
1323
- */
1324
- zIndex = 1;
1325
- /**
1326
- * The maximum zoom at which the layer is visible. 19 by default
1327
- */
1328
- maxZoom = 19;
1329
- /**
1330
- * The minimum zoom at which the layer is visible. 0 by default
1331
- */
1332
- minZoom = 0;
1333
- /**
1334
- * The styling definition of layer's features. The easiest way is to use {@link PolygonStyleHelper},{@link MarkerStyleHelper}
1335
- */
1336
- style;
1337
- /**
1338
- * Creates a clone of the existing settings
1339
- * @param model
1340
- */
1341
- static copy(model) {
1342
- const result = new FeatureLayerSettings();
1343
- result.name = model.name;
1344
- result.maxZoom = model.maxZoom;
1345
- result.minZoom = model.minZoom;
1346
- result.zIndex = model.zIndex;
1347
- result.style = model.style;
1348
- return result;
1349
- }
1350
- /**
1351
- Setter for {@link FeatureLayerSettings.zIndex}
1352
- * @param zIndex
1353
- */
1354
- setZIndex(zIndex) {
1355
- return FeatureLayerSettings.copy({ ...this, zIndex });
1356
- }
1357
- /**
1358
- * Setter for {@link FeatureLayerSettings.name}
1359
- * @param name
1360
- */
1361
- setName(name) {
1362
- return FeatureLayerSettings.copy({ ...this, name });
1363
- }
1364
- /**
1365
- * Setter for {@link FeatureLayerSettings.maxZoom}
1366
- * @param maxZoom
1367
- */
1368
- setMaxZoom(maxZoom) {
1369
- return FeatureLayerSettings.copy({ ...this, maxZoom });
1370
- }
1371
- /**
1372
- * Setter for {@link FeatureLayerSettings.minZoom}
1373
- * @param minZoom
1374
- */
1375
- setMinZoom(minZoom) {
1376
- return FeatureLayerSettings.copy({ ...this, minZoom });
1377
- }
1378
- /**
1379
- * Setter for {@link FeatureLayerSettings.style}
1380
- * @param style
1381
- */
1382
- setStyle(style) {
1383
- return FeatureLayerSettings.copy({ ...this, style });
1384
- }
1385
- /**
1386
- * Checks if the model has the same content
1387
- * @param model - the object to compare
1388
- */
1389
- isSame(model) {
1390
- if (this.maxZoom !== model.maxZoom)
1391
- return false;
1392
- if (this.minZoom !== model.minZoom)
1393
- return false;
1394
- if (this.zIndex !== model.zIndex)
1395
- return false;
1396
- if (this.name !== model.name)
1397
- return false;
1398
- if (this.style !== model.style)
1399
- return false;
1400
- return true;
1401
- }
1402
- }
1403
-
1404
- class FeatureLayerFactory {
1405
- build(settings) {
1406
- const source = new Vector({});
1407
- const layer = new Vector$1({
1408
- source: source,
1409
- maxZoom: settings.maxZoom,
1410
- minZoom: settings.minZoom,
1411
- zIndex: settings.zIndex,
1412
- });
1413
- if (settings.style)
1414
- layer.setStyle(settings.style);
1415
- layer.set('name', settings.name);
1416
- return layer;
1417
- }
1418
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FeatureLayerFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1419
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FeatureLayerFactory, providedIn: 'root' });
1420
- }
1421
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FeatureLayerFactory, decorators: [{
1422
- type: Injectable,
1423
- args: [{
1424
- providedIn: 'root',
1425
- }]
1289
+ /**
1290
+ * A layer that is responsible for showing and styling main features on the map, such as markers and polygons
1291
+ */
1292
+ class FeatureLayerSettings {
1293
+ /**
1294
+ * The identifier of the field, it is autogenerated by default, but can be set manually
1295
+ */
1296
+ name = IdGenerator.get();
1297
+ /**
1298
+ * The priority of showing - layers with higher zIndex cover others in case of collisions
1299
+ */
1300
+ zIndex = 1;
1301
+ /**
1302
+ * The maximum zoom at which the layer is visible. 19 by default
1303
+ */
1304
+ maxZoom = 19;
1305
+ /**
1306
+ * The minimum zoom at which the layer is visible. 0 by default
1307
+ */
1308
+ minZoom = 0;
1309
+ /**
1310
+ * The styling definition of layer's features. The easiest way is to use {@link PolygonStyleHelper},{@link MarkerStyleHelper}
1311
+ */
1312
+ style;
1313
+ /**
1314
+ * Creates a clone of the existing settings
1315
+ * @param model
1316
+ */
1317
+ static copy(model) {
1318
+ const result = new FeatureLayerSettings();
1319
+ result.name = model.name;
1320
+ result.maxZoom = model.maxZoom;
1321
+ result.minZoom = model.minZoom;
1322
+ result.zIndex = model.zIndex;
1323
+ result.style = model.style;
1324
+ return result;
1325
+ }
1326
+ /**
1327
+ Setter for {@link FeatureLayerSettings.zIndex}
1328
+ * @param zIndex
1329
+ */
1330
+ setZIndex(zIndex) {
1331
+ return FeatureLayerSettings.copy({ ...this, zIndex });
1332
+ }
1333
+ /**
1334
+ * Setter for {@link FeatureLayerSettings.name}
1335
+ * @param name
1336
+ */
1337
+ setName(name) {
1338
+ return FeatureLayerSettings.copy({ ...this, name });
1339
+ }
1340
+ /**
1341
+ * Setter for {@link FeatureLayerSettings.maxZoom}
1342
+ * @param maxZoom
1343
+ */
1344
+ setMaxZoom(maxZoom) {
1345
+ return FeatureLayerSettings.copy({ ...this, maxZoom });
1346
+ }
1347
+ /**
1348
+ * Setter for {@link FeatureLayerSettings.minZoom}
1349
+ * @param minZoom
1350
+ */
1351
+ setMinZoom(minZoom) {
1352
+ return FeatureLayerSettings.copy({ ...this, minZoom });
1353
+ }
1354
+ /**
1355
+ * Setter for {@link FeatureLayerSettings.style}
1356
+ * @param style
1357
+ */
1358
+ setStyle(style) {
1359
+ return FeatureLayerSettings.copy({ ...this, style });
1360
+ }
1361
+ /**
1362
+ * Checks if the model has the same content
1363
+ * @param model - the object to compare
1364
+ */
1365
+ isSame(model) {
1366
+ if (this.maxZoom !== model.maxZoom)
1367
+ return false;
1368
+ if (this.minZoom !== model.minZoom)
1369
+ return false;
1370
+ if (this.zIndex !== model.zIndex)
1371
+ return false;
1372
+ if (this.name !== model.name)
1373
+ return false;
1374
+ if (this.style !== model.style)
1375
+ return false;
1376
+ return true;
1377
+ }
1378
+ }
1379
+
1380
+ class FeatureLayerFactory {
1381
+ build(settings) {
1382
+ const source = new Vector({});
1383
+ const layer = new Vector$1({
1384
+ source: source,
1385
+ maxZoom: settings.maxZoom,
1386
+ minZoom: settings.minZoom,
1387
+ zIndex: settings.zIndex,
1388
+ });
1389
+ if (settings.style)
1390
+ layer.setStyle(settings.style);
1391
+ layer.set('name', settings.name);
1392
+ return layer;
1393
+ }
1394
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: FeatureLayerFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1395
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: FeatureLayerFactory, providedIn: 'root' });
1396
+ }
1397
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: FeatureLayerFactory, decorators: [{
1398
+ type: Injectable,
1399
+ args: [{
1400
+ providedIn: 'root',
1401
+ }]
1426
1402
  }] });
1427
1403
 
1428
- class FeatureLayerComponent extends DestructibleComponent {
1429
- postboy;
1430
- factory;
1431
- layer = null;
1432
- _settings = new FeatureLayerSettings();
1433
- constructor(postboy, factory) {
1434
- super();
1435
- this.postboy = postboy;
1436
- this.factory = factory;
1437
- }
1438
- ngOnInit() {
1439
- this.postboy
1440
- .subscribe(MapRenderedEvent.ID)
1441
- .pipe(filter((m) => !!m), first())
1442
- .subscribe((m) => this.initLayer());
1443
- }
1444
- set settings(value) {
1445
- if (!value || this._settings.isSame(value))
1446
- return;
1447
- this._settings = value;
1448
- this.initLayer();
1449
- }
1450
- onDestroy = () => this.removeLayer();
1451
- initLayer() {
1452
- this.removeLayer();
1453
- this.layer = this.factory.build(this._settings);
1454
- this.postboy.fire(new AddLayerCommand(this.layer));
1455
- }
1456
- removeLayer() {
1457
- if (this.layer)
1458
- this.postboy.fire(new RemoveLayerCommand(this.layer));
1459
- }
1460
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FeatureLayerComponent, deps: [{ token: MapPostboyService }, { token: FeatureLayerFactory }], target: i0.ɵɵFactoryTarget.Component });
1461
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FeatureLayerComponent, selector: "art-feature-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1462
- }
1463
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FeatureLayerComponent, decorators: [{
1464
- type: Component,
1465
- args: [{ selector: 'art-feature-layer', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
1466
- }], ctorParameters: function () { return [{ type: MapPostboyService }, { type: FeatureLayerFactory }]; }, propDecorators: { settings: [{
1467
- type: Input
1404
+ class FeatureLayerComponent extends DestructibleComponent {
1405
+ postboy;
1406
+ factory;
1407
+ layer = null;
1408
+ _settings = new FeatureLayerSettings();
1409
+ constructor(postboy, factory) {
1410
+ super();
1411
+ this.postboy = postboy;
1412
+ this.factory = factory;
1413
+ }
1414
+ ngOnInit() {
1415
+ this.postboy
1416
+ .subscribe(MapRenderedEvent.ID)
1417
+ .pipe(filter((m) => !!m), first())
1418
+ .subscribe((m) => this.initLayer());
1419
+ }
1420
+ set settings(value) {
1421
+ if (!value || this._settings.isSame(value))
1422
+ return;
1423
+ this._settings = value;
1424
+ this.initLayer();
1425
+ }
1426
+ onDestroy = () => this.removeLayer();
1427
+ initLayer() {
1428
+ this.removeLayer();
1429
+ this.layer = this.factory.build(this._settings);
1430
+ this.postboy.fire(new AddLayerCommand(this.layer));
1431
+ }
1432
+ removeLayer() {
1433
+ if (this.layer)
1434
+ this.postboy.fire(new RemoveLayerCommand(this.layer));
1435
+ }
1436
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: FeatureLayerComponent, deps: [{ token: MapPostboyService }, { token: FeatureLayerFactory }], target: i0.ɵɵFactoryTarget.Component });
1437
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: FeatureLayerComponent, selector: "art-feature-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1438
+ }
1439
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: FeatureLayerComponent, decorators: [{
1440
+ type: Component,
1441
+ args: [{ selector: 'art-feature-layer', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
1442
+ }], ctorParameters: () => [{ type: MapPostboyService }, { type: FeatureLayerFactory }], propDecorators: { settings: [{
1443
+ type: Input
1468
1444
  }] } });
1469
1445
 
1470
- class ClusterLayerSettings {
1471
- name = IdGenerator.get();
1472
- zIndex = 1;
1473
- maxZoom = 19;
1474
- minZoom = 0;
1475
- distance = 20;
1476
- bbox = false;
1477
- clusterCancel = 14;
1478
- style;
1479
- static copy(model) {
1480
- const result = new ClusterLayerSettings();
1481
- result.name = model.name;
1482
- result.maxZoom = model.maxZoom;
1483
- result.minZoom = model.minZoom;
1484
- result.zIndex = model.zIndex;
1485
- result.bbox = model.bbox;
1486
- result.clusterCancel = model.clusterCancel;
1487
- result.distance = model.distance;
1488
- result.style = model.style;
1489
- return result;
1490
- }
1491
- setZIndex(zIndex) {
1492
- return ClusterLayerSettings.copy({ ...this, zIndex });
1493
- }
1494
- setDistance(distance) {
1495
- return ClusterLayerSettings.copy({ ...this, distance });
1496
- }
1497
- setName(name) {
1498
- return ClusterLayerSettings.copy({ ...this, name });
1499
- }
1500
- setMaxZoom(maxZoom) {
1501
- return ClusterLayerSettings.copy({ ...this, maxZoom });
1502
- }
1503
- setMinZoom(minZoom) {
1504
- return ClusterLayerSettings.copy({ ...this, minZoom });
1505
- }
1506
- setClusterCancel(clusterCancel) {
1507
- return ClusterLayerSettings.copy({ ...this, clusterCancel });
1508
- }
1509
- setBbox(bbox) {
1510
- return ClusterLayerSettings.copy({ ...this, bbox });
1511
- }
1512
- setStyle(style) {
1513
- return ClusterLayerSettings.copy({ ...this, style });
1514
- }
1515
- isSame(model) {
1516
- if (this.maxZoom !== model.maxZoom)
1517
- return false;
1518
- if (this.minZoom !== model.minZoom)
1519
- return false;
1520
- if (this.zIndex !== model.zIndex)
1521
- return false;
1522
- if (this.name !== model.name)
1523
- return false;
1524
- if (this.distance !== model.distance)
1525
- return false;
1526
- if (this.clusterCancel !== model.clusterCancel)
1527
- return false;
1528
- if (this.bbox !== model.bbox)
1529
- return false;
1530
- if (this.style !== model.style)
1531
- return false;
1532
- return true;
1533
- }
1534
- }
1535
-
1536
- class ClusterLayerManager {
1537
- settings;
1538
- layer;
1539
- postboy;
1540
- constructor(settings, layer, postboy) {
1541
- this.settings = settings;
1542
- this.layer = layer;
1543
- this.postboy = postboy;
1544
- this.observeClick();
1545
- this.observeMapMovement();
1546
- }
1547
- observeMapMovement() {
1548
- combineLatest([
1549
- this.postboy.subscribe(MapMoveEndEvent.ID).pipe(auditTime(250)),
1550
- this.postboy.subscribe(MapRenderedEvent.ID),
1551
- ]).subscribe(([movement, renderEvent]) => {
1552
- this.checkClusterNecessity(renderEvent.map);
1553
- });
1554
- }
1555
- observeClick() {
1556
- this.postboy.subscribe(MapClickEvent.ID).subscribe((m) => {
1557
- if ((m.features[this.settings.name]?.length ?? 0) > 1) {
1558
- this.postboy.fire(new FitToFeaturesCommand(m.features[this.settings.name], -1));
1559
- }
1560
- });
1561
- }
1562
- checkClusterNecessity(map) {
1563
- let zoom = map.getView().getZoom() ?? 0;
1564
- const distance = zoom > this.settings.clusterCancel ? 0 : this.settings.distance;
1565
- this.layer?.getSource()?.setDistance(distance);
1566
- }
1567
- }
1568
-
1569
- class ClusterLayerFactory {
1570
- build(settings, postboy) {
1571
- const source = new Vector({
1572
- strategy: settings.bbox ? bbox : undefined,
1573
- });
1574
- const cluster = new Cluster({
1575
- distance: settings.distance,
1576
- source: source,
1577
- geometryFunction: (feature) => {
1578
- const geom = feature.getGeometry();
1579
- if (geom?.getType() == 'Point') {
1580
- return geom;
1581
- }
1582
- else if (geom?.getType() == 'Polygon') {
1583
- return geom?.getInteriorPoint();
1584
- }
1585
- else if (geom?.getType() == 'MultiPolygon') {
1586
- return fromExtent(geom.getExtent())?.getInteriorPoint();
1587
- }
1588
- return undefined;
1589
- },
1590
- });
1591
- const layer = new Vector$1({
1592
- source: cluster,
1593
- maxZoom: settings.maxZoom || undefined,
1594
- minZoom: settings.minZoom || undefined,
1595
- zIndex: settings.zIndex || 0,
1596
- });
1597
- layer.setStyle(this.styleFunc(settings));
1598
- layer.set('name', settings.name);
1599
- return new ClusterLayerManager(settings, layer, postboy);
1600
- }
1601
- styleFunc(settings) {
1602
- return (feature) => {
1603
- const features = feature.get('features');
1604
- if (!settings.style)
1605
- return undefined;
1606
- return settings.style(features.map((f) => ({ id: f.getId(), ...f.get(MapConstants.FeatureInfo) })));
1607
- };
1608
- }
1609
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ClusterLayerFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1610
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ClusterLayerFactory, providedIn: 'root' });
1611
- }
1612
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ClusterLayerFactory, decorators: [{
1613
- type: Injectable,
1614
- args: [{
1615
- providedIn: 'root',
1616
- }]
1446
+ class ClusterLayerSettings {
1447
+ name = IdGenerator.get();
1448
+ zIndex = 1;
1449
+ maxZoom = 19;
1450
+ minZoom = 0;
1451
+ distance = 20;
1452
+ bbox = false;
1453
+ clusterCancel = 14;
1454
+ style;
1455
+ static copy(model) {
1456
+ const result = new ClusterLayerSettings();
1457
+ result.name = model.name;
1458
+ result.maxZoom = model.maxZoom;
1459
+ result.minZoom = model.minZoom;
1460
+ result.zIndex = model.zIndex;
1461
+ result.bbox = model.bbox;
1462
+ result.clusterCancel = model.clusterCancel;
1463
+ result.distance = model.distance;
1464
+ result.style = model.style;
1465
+ return result;
1466
+ }
1467
+ setZIndex(zIndex) {
1468
+ return ClusterLayerSettings.copy({ ...this, zIndex });
1469
+ }
1470
+ setDistance(distance) {
1471
+ return ClusterLayerSettings.copy({ ...this, distance });
1472
+ }
1473
+ setName(name) {
1474
+ return ClusterLayerSettings.copy({ ...this, name });
1475
+ }
1476
+ setMaxZoom(maxZoom) {
1477
+ return ClusterLayerSettings.copy({ ...this, maxZoom });
1478
+ }
1479
+ setMinZoom(minZoom) {
1480
+ return ClusterLayerSettings.copy({ ...this, minZoom });
1481
+ }
1482
+ setClusterCancel(clusterCancel) {
1483
+ return ClusterLayerSettings.copy({ ...this, clusterCancel });
1484
+ }
1485
+ setBbox(bbox) {
1486
+ return ClusterLayerSettings.copy({ ...this, bbox });
1487
+ }
1488
+ setStyle(style) {
1489
+ return ClusterLayerSettings.copy({ ...this, style });
1490
+ }
1491
+ isSame(model) {
1492
+ if (this.maxZoom !== model.maxZoom)
1493
+ return false;
1494
+ if (this.minZoom !== model.minZoom)
1495
+ return false;
1496
+ if (this.zIndex !== model.zIndex)
1497
+ return false;
1498
+ if (this.name !== model.name)
1499
+ return false;
1500
+ if (this.distance !== model.distance)
1501
+ return false;
1502
+ if (this.clusterCancel !== model.clusterCancel)
1503
+ return false;
1504
+ if (this.bbox !== model.bbox)
1505
+ return false;
1506
+ if (this.style !== model.style)
1507
+ return false;
1508
+ return true;
1509
+ }
1510
+ }
1511
+
1512
+ class ClusterLayerManager {
1513
+ settings;
1514
+ layer;
1515
+ postboy;
1516
+ constructor(settings, layer, postboy) {
1517
+ this.settings = settings;
1518
+ this.layer = layer;
1519
+ this.postboy = postboy;
1520
+ this.observeClick();
1521
+ this.observeMapMovement();
1522
+ }
1523
+ observeMapMovement() {
1524
+ combineLatest([
1525
+ this.postboy.subscribe(MapMoveEndEvent.ID).pipe(auditTime(250)),
1526
+ this.postboy.subscribe(MapRenderedEvent.ID),
1527
+ ]).subscribe(([movement, renderEvent]) => {
1528
+ this.checkClusterNecessity(renderEvent.map);
1529
+ });
1530
+ }
1531
+ observeClick() {
1532
+ this.postboy.subscribe(MapClickEvent.ID).subscribe((m) => {
1533
+ if ((m.features[this.settings.name]?.length ?? 0) > 1) {
1534
+ this.postboy.fire(new FitToFeaturesCommand(m.features[this.settings.name], -1));
1535
+ }
1536
+ });
1537
+ }
1538
+ checkClusterNecessity(map) {
1539
+ let zoom = map.getView().getZoom() ?? 0;
1540
+ const distance = zoom > this.settings.clusterCancel ? 0 : this.settings.distance;
1541
+ this.layer?.getSource()?.setDistance(distance);
1542
+ }
1543
+ }
1544
+
1545
+ class ClusterLayerFactory {
1546
+ build(settings, postboy) {
1547
+ const source = new Vector({
1548
+ strategy: settings.bbox ? bbox : undefined,
1549
+ });
1550
+ const cluster = new Cluster({
1551
+ distance: settings.distance,
1552
+ source: source,
1553
+ geometryFunction: (feature) => {
1554
+ const geom = feature.getGeometry();
1555
+ if (geom?.getType() == 'Point') {
1556
+ return geom;
1557
+ }
1558
+ else if (geom?.getType() == 'Polygon') {
1559
+ return geom?.getInteriorPoint();
1560
+ }
1561
+ else if (geom?.getType() == 'MultiPolygon') {
1562
+ return fromExtent(geom.getExtent())?.getInteriorPoint();
1563
+ }
1564
+ return undefined;
1565
+ },
1566
+ });
1567
+ const layer = new Vector$1({
1568
+ source: cluster,
1569
+ maxZoom: settings.maxZoom || undefined,
1570
+ minZoom: settings.minZoom || undefined,
1571
+ zIndex: settings.zIndex || 0,
1572
+ });
1573
+ layer.setStyle(this.styleFunc(settings));
1574
+ layer.set('name', settings.name);
1575
+ return new ClusterLayerManager(settings, layer, postboy);
1576
+ }
1577
+ styleFunc(settings) {
1578
+ return (feature) => {
1579
+ const features = feature.get('features');
1580
+ if (!settings.style)
1581
+ return undefined;
1582
+ return settings.style(features.map((f) => ({ id: f.getId(), ...f.get(MapConstants.FeatureInfo) })));
1583
+ };
1584
+ }
1585
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ClusterLayerFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1586
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ClusterLayerFactory, providedIn: 'root' });
1587
+ }
1588
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ClusterLayerFactory, decorators: [{
1589
+ type: Injectable,
1590
+ args: [{
1591
+ providedIn: 'root',
1592
+ }]
1617
1593
  }] });
1618
1594
 
1619
- class ClusterLayerComponent extends DestructibleComponent {
1620
- postboy;
1621
- factory;
1622
- manager = null;
1623
- _settings = new ClusterLayerSettings();
1624
- constructor(postboy, factory) {
1625
- super();
1626
- this.postboy = postboy;
1627
- this.factory = factory;
1628
- }
1629
- ngOnInit() {
1630
- this.postboy
1631
- .subscribe(MapRenderedEvent.ID)
1632
- .pipe(filter((m) => !!m), first())
1633
- .subscribe((m) => this.initLayer());
1634
- }
1635
- set settings(value) {
1636
- if (!value || this._settings.isSame(value))
1637
- return;
1638
- this._settings = value;
1639
- this.initLayer();
1640
- }
1641
- onDestroy = () => this.removeLayer();
1642
- initLayer() {
1643
- this.removeLayer();
1644
- this.manager = this.factory.build(this._settings, this.postboy);
1645
- this.postboy.fire(new AddLayerCommand(this.manager.layer));
1646
- }
1647
- removeLayer() {
1648
- if (this.manager?.layer)
1649
- this.postboy.fire(new RemoveLayerCommand(this.manager.layer));
1650
- }
1651
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ClusterLayerComponent, deps: [{ token: MapPostboyService }, { token: ClusterLayerFactory }], target: i0.ɵɵFactoryTarget.Component });
1652
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ClusterLayerComponent, selector: "art-cluster-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1653
- }
1654
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ClusterLayerComponent, decorators: [{
1655
- type: Component,
1656
- args: [{ selector: 'art-cluster-layer', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
1657
- }], ctorParameters: function () { return [{ type: MapPostboyService }, { type: ClusterLayerFactory }]; }, propDecorators: { settings: [{
1658
- type: Input
1595
+ class ClusterLayerComponent extends DestructibleComponent {
1596
+ postboy;
1597
+ factory;
1598
+ manager = null;
1599
+ _settings = new ClusterLayerSettings();
1600
+ constructor(postboy, factory) {
1601
+ super();
1602
+ this.postboy = postboy;
1603
+ this.factory = factory;
1604
+ }
1605
+ ngOnInit() {
1606
+ this.postboy
1607
+ .subscribe(MapRenderedEvent.ID)
1608
+ .pipe(filter((m) => !!m), first())
1609
+ .subscribe((m) => this.initLayer());
1610
+ }
1611
+ set settings(value) {
1612
+ if (!value || this._settings.isSame(value))
1613
+ return;
1614
+ this._settings = value;
1615
+ this.initLayer();
1616
+ }
1617
+ onDestroy = () => this.removeLayer();
1618
+ initLayer() {
1619
+ this.removeLayer();
1620
+ this.manager = this.factory.build(this._settings, this.postboy);
1621
+ this.postboy.fire(new AddLayerCommand(this.manager.layer));
1622
+ }
1623
+ removeLayer() {
1624
+ if (this.manager?.layer)
1625
+ this.postboy.fire(new RemoveLayerCommand(this.manager.layer));
1626
+ }
1627
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ClusterLayerComponent, deps: [{ token: MapPostboyService }, { token: ClusterLayerFactory }], target: i0.ɵɵFactoryTarget.Component });
1628
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: ClusterLayerComponent, selector: "art-cluster-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1629
+ }
1630
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ClusterLayerComponent, decorators: [{
1631
+ type: Component,
1632
+ args: [{ selector: 'art-cluster-layer', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
1633
+ }], ctorParameters: () => [{ type: MapPostboyService }, { type: ClusterLayerFactory }], propDecorators: { settings: [{
1634
+ type: Input
1659
1635
  }] } });
1660
1636
 
1661
- class MapPlateFactory {
1662
- build(settings) {
1663
- return new Map({
1664
- controls: [],
1665
- view: new View({
1666
- center: settings?.center || [0, 0],
1667
- zoom: settings?.zoom || 4,
1668
- minZoom: settings?.minZoom || 0,
1669
- maxZoom: settings?.maxZoom || 19,
1670
- }),
1671
- layers: [],
1672
- });
1673
- }
1674
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapPlateFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1675
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapPlateFactory, providedIn: 'root' });
1676
- }
1677
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapPlateFactory, decorators: [{
1678
- type: Injectable,
1679
- args: [{
1680
- providedIn: 'root',
1681
- }]
1637
+ class MapPlateFactory {
1638
+ build(settings) {
1639
+ return new Map({
1640
+ controls: [],
1641
+ view: new View({
1642
+ center: settings?.center || [0, 0],
1643
+ zoom: settings?.zoom || 4,
1644
+ minZoom: settings?.minZoom || 0,
1645
+ maxZoom: settings?.maxZoom || 19,
1646
+ }),
1647
+ layers: [],
1648
+ });
1649
+ }
1650
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapPlateFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1651
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapPlateFactory, providedIn: 'root' });
1652
+ }
1653
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapPlateFactory, decorators: [{
1654
+ type: Injectable,
1655
+ args: [{
1656
+ providedIn: 'root',
1657
+ }]
1682
1658
  }] });
1683
1659
 
1684
- class MapPlateComponent extends DestructibleComponent {
1685
- elementRef;
1686
- postboy;
1687
- mapFactory;
1688
- registrator;
1689
- detector;
1690
- map;
1691
- osmUrl = '';
1692
- constructor(elementRef, postboy, mapFactory, registrator, detector) {
1693
- super();
1694
- this.elementRef = elementRef;
1695
- this.postboy = postboy;
1696
- this.mapFactory = mapFactory;
1697
- this.registrator = registrator;
1698
- this.detector = detector;
1699
- registrator.up();
1700
- }
1701
- _settings = new MapSettings();
1702
- drawingLayerSettings = new FeatureLayerSettings().setName(MapConstants.DrawingLayerId);
1703
- set settings(value) {
1704
- if (!value || this._settings.isSame(value))
1705
- return;
1706
- this._settings = value;
1707
- this.setOsm();
1708
- }
1709
- ngOnInit() {
1710
- useGeographic();
1711
- this.map = this.mapFactory.build(this._settings);
1712
- this.map.setTarget(this.elementRef.nativeElement);
1713
- this.detector.detectChanges();
1714
- this.map.once('postrender', () => {
1715
- this.map.updateSize();
1716
- this.postboy.fire(new MapRenderedEvent(this.map));
1717
- });
1718
- this.setOsm();
1719
- }
1720
- setOsm() {
1721
- if (!this.map)
1722
- return;
1723
- this.osmUrl = `https://mt{0-3}.google.com/vt/lyrs=${MapLyrsLabel.get(this._settings.lyrs)}&hl=${this._settings.language}&x={x}&y={y}&z={z}`;
1724
- this.detector.detectChanges();
1725
- this.map.updateSize();
1726
- }
1727
- onDestroy = () => {
1728
- this.registrator.down();
1729
- };
1730
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapPlateComponent, deps: [{ token: i0.ElementRef }, { token: MapPostboyService }, { token: MapPlateFactory }, { token: MessageRegistratorService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1731
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: MapPlateComponent, selector: "art-map-plate", inputs: { settings: "settings" }, providers: [
1732
- MessageRegistratorService,
1733
- MapStateService,
1734
- MapManagementService,
1735
- MapClickService,
1736
- MapFeatureService,
1737
- DrawingService,
1738
- DrawingGenerationService,
1739
- FeatureService,
1740
- FeatureModificationService,
1741
- ControlsService,
1742
- ], usesInheritance: true, ngImport: i0, template: "<ng-content></ng-content>\r\n<art-osm-tile-layer *ngIf=\"osmUrl && map\" [map]=\"map\" [url]=\"osmUrl\"></art-osm-tile-layer>\r\n<art-feature-layer *ngIf=\"map\" [settings]=\"drawingLayerSettings\"></art-feature-layer>\r\n", styles: ["art-map-plate{position:relative;display:flex;flex-direction:column;height:100%}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: OsmTileLayerComponent, selector: "art-osm-tile-layer", inputs: ["url", "map"] }, { kind: "component", type: FeatureLayerComponent, selector: "art-feature-layer", inputs: ["settings"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1743
- }
1744
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapPlateComponent, decorators: [{
1745
- type: Component,
1746
- args: [{ selector: 'art-map-plate', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
1747
- MessageRegistratorService,
1748
- MapStateService,
1749
- MapManagementService,
1750
- MapClickService,
1751
- MapFeatureService,
1752
- DrawingService,
1753
- DrawingGenerationService,
1754
- FeatureService,
1755
- FeatureModificationService,
1756
- ControlsService,
1757
- ], template: "<ng-content></ng-content>\r\n<art-osm-tile-layer *ngIf=\"osmUrl && map\" [map]=\"map\" [url]=\"osmUrl\"></art-osm-tile-layer>\r\n<art-feature-layer *ngIf=\"map\" [settings]=\"drawingLayerSettings\"></art-feature-layer>\r\n", styles: ["art-map-plate{position:relative;display:flex;flex-direction:column;height:100%}\n"] }]
1758
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: MapPostboyService }, { type: MapPlateFactory }, { type: MessageRegistratorService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { settings: [{
1759
- type: Input
1660
+ class MapPlateComponent extends DestructibleComponent {
1661
+ elementRef;
1662
+ postboy;
1663
+ mapFactory;
1664
+ registrator;
1665
+ detector;
1666
+ map;
1667
+ osmUrl = '';
1668
+ constructor(elementRef, postboy, mapFactory, registrator, detector) {
1669
+ super();
1670
+ this.elementRef = elementRef;
1671
+ this.postboy = postboy;
1672
+ this.mapFactory = mapFactory;
1673
+ this.registrator = registrator;
1674
+ this.detector = detector;
1675
+ registrator.up();
1676
+ }
1677
+ _settings = new MapSettings();
1678
+ drawingLayerSettings = new FeatureLayerSettings().setName(MapConstants.DrawingLayerId);
1679
+ set settings(value) {
1680
+ if (!value || this._settings.isSame(value))
1681
+ return;
1682
+ this._settings = value;
1683
+ this.setOsm();
1684
+ }
1685
+ ngOnInit() {
1686
+ useGeographic();
1687
+ this.map = this.mapFactory.build(this._settings);
1688
+ this.map.setTarget(this.elementRef.nativeElement);
1689
+ this.detector.detectChanges();
1690
+ this.map.once('postrender', () => {
1691
+ this.map.updateSize();
1692
+ this.postboy.fire(new MapRenderedEvent(this.map));
1693
+ });
1694
+ this.setOsm();
1695
+ }
1696
+ setOsm() {
1697
+ if (!this.map)
1698
+ return;
1699
+ this.osmUrl = `https://mt{0-3}.google.com/vt/lyrs=${MapLyrsLabel.get(this._settings.lyrs)}&hl=${this._settings.language}&x={x}&y={y}&z={z}`;
1700
+ this.detector.detectChanges();
1701
+ this.map.updateSize();
1702
+ }
1703
+ onDestroy = () => {
1704
+ this.registrator.down();
1705
+ };
1706
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapPlateComponent, deps: [{ token: i0.ElementRef }, { token: MapPostboyService }, { token: MapPlateFactory }, { token: MessageRegistratorService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1707
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: MapPlateComponent, selector: "art-map-plate", inputs: { settings: "settings" }, providers: [
1708
+ MessageRegistratorService,
1709
+ MapStateService,
1710
+ MapManagementService,
1711
+ MapClickService,
1712
+ MapFeatureService,
1713
+ DrawingService,
1714
+ DrawingGenerationService,
1715
+ FeatureService,
1716
+ FeatureModificationService,
1717
+ ControlsService,
1718
+ ], usesInheritance: true, ngImport: i0, template: "<ng-content></ng-content>\r\n<art-osm-tile-layer *ngIf=\"osmUrl && map\" [map]=\"map\" [url]=\"osmUrl\"></art-osm-tile-layer>\r\n<art-feature-layer *ngIf=\"map\" [settings]=\"drawingLayerSettings\"></art-feature-layer>\r\n", styles: ["art-map-plate{position:relative;display:flex;flex-direction:column;height:100%}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: OsmTileLayerComponent, selector: "art-osm-tile-layer", inputs: ["url", "map"] }, { kind: "component", type: FeatureLayerComponent, selector: "art-feature-layer", inputs: ["settings"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1719
+ }
1720
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapPlateComponent, decorators: [{
1721
+ type: Component,
1722
+ args: [{ selector: 'art-map-plate', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
1723
+ MessageRegistratorService,
1724
+ MapStateService,
1725
+ MapManagementService,
1726
+ MapClickService,
1727
+ MapFeatureService,
1728
+ DrawingService,
1729
+ DrawingGenerationService,
1730
+ FeatureService,
1731
+ FeatureModificationService,
1732
+ ControlsService,
1733
+ ], template: "<ng-content></ng-content>\r\n<art-osm-tile-layer *ngIf=\"osmUrl && map\" [map]=\"map\" [url]=\"osmUrl\"></art-osm-tile-layer>\r\n<art-feature-layer *ngIf=\"map\" [settings]=\"drawingLayerSettings\"></art-feature-layer>\r\n", styles: ["art-map-plate{position:relative;display:flex;flex-direction:column;height:100%}\n"] }]
1734
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: MapPostboyService }, { type: MapPlateFactory }, { type: MessageRegistratorService }, { type: i0.ChangeDetectorRef }], propDecorators: { settings: [{
1735
+ type: Input
1760
1736
  }] } });
1761
1737
 
1762
- class MarkersComponent extends DestructibleComponent {
1763
- postboy;
1764
- layerName = '';
1765
- constructor(postboy) {
1766
- super();
1767
- this.postboy = postboy;
1768
- }
1769
- _markers = [];
1770
- set markers(value) {
1771
- this._markers = value ?? [];
1772
- this.putMarkers();
1773
- }
1774
- ngOnInit() {
1775
- this.postboy
1776
- .subscribe(MapRenderedEvent.ID)
1777
- .pipe(filter((m) => !!m), first())
1778
- .subscribe(() => this.putMarkers());
1779
- }
1780
- putMarkers() {
1781
- if (!this._markers)
1782
- return;
1783
- this.postboy.fire(new PlaceLayerFeaturesCommand(this.layerName, this._markers.map((m) => m.feature)));
1784
- }
1785
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MarkersComponent, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Component });
1786
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: MarkersComponent, selector: "art-markers", inputs: { layerName: "layerName", markers: "markers" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1787
- }
1788
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MarkersComponent, decorators: [{
1789
- type: Component,
1790
- args: [{ selector: 'art-markers', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
1791
- }], ctorParameters: function () { return [{ type: MapPostboyService }]; }, propDecorators: { layerName: [{
1792
- type: Input
1793
- }], markers: [{
1794
- type: Input
1738
+ class MarkersComponent extends DestructibleComponent {
1739
+ postboy;
1740
+ layerName = '';
1741
+ constructor(postboy) {
1742
+ super();
1743
+ this.postboy = postboy;
1744
+ }
1745
+ _markers = [];
1746
+ set markers(value) {
1747
+ this._markers = value ?? [];
1748
+ this.putMarkers();
1749
+ }
1750
+ ngOnInit() {
1751
+ this.postboy
1752
+ .subscribe(MapRenderedEvent.ID)
1753
+ .pipe(filter((m) => !!m), first())
1754
+ .subscribe(() => this.putMarkers());
1755
+ }
1756
+ putMarkers() {
1757
+ if (!this._markers)
1758
+ return;
1759
+ this.postboy.fire(new PlaceLayerFeaturesCommand(this.layerName, this._markers.map((m) => m.feature)));
1760
+ }
1761
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MarkersComponent, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Component });
1762
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: MarkersComponent, selector: "art-markers", inputs: { layerName: "layerName", markers: "markers" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1763
+ }
1764
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MarkersComponent, decorators: [{
1765
+ type: Component,
1766
+ args: [{ selector: 'art-markers', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
1767
+ }], ctorParameters: () => [{ type: MapPostboyService }], propDecorators: { layerName: [{
1768
+ type: Input
1769
+ }], markers: [{
1770
+ type: Input
1795
1771
  }] } });
1796
1772
 
1797
- class TooltipSettings {
1798
- id;
1799
- containerClass = 'custom-tooltip-class';
1800
- show = (e) => true;
1801
- constructor(id) {
1802
- this.id = id ?? IdGenerator.get();
1803
- }
1804
- static copy(model) {
1805
- const result = new TooltipSettings(model.id);
1806
- result.show = model.show;
1807
- result.containerClass = model.containerClass;
1808
- return result;
1809
- }
1810
- setShow(show) {
1811
- return TooltipSettings.copy({ ...this, show });
1812
- }
1813
- setClass(containerClass) {
1814
- return TooltipSettings.copy({ ...this, containerClass });
1815
- }
1816
- isSame(model) {
1817
- if (this.show !== model.show)
1818
- return false;
1819
- if (this.containerClass !== model.containerClass)
1820
- return false;
1821
- if (this.id !== model.id)
1822
- return false;
1823
- return true;
1824
- }
1825
- }
1826
-
1827
- class TooltipComponent extends DestructibleComponent {
1828
- postboy;
1829
- detector;
1830
- container;
1831
- _settings = new TooltipSettings();
1832
- map;
1833
- overlay;
1834
- show = false;
1835
- set settings(value) {
1836
- if (!value || this._settings.isSame(value))
1837
- return;
1838
- this._settings = value;
1839
- this.detector.detectChanges();
1840
- }
1841
- constructor(postboy, detector) {
1842
- super();
1843
- this.postboy = postboy;
1844
- this.detector = detector;
1845
- }
1846
- ngOnInit() {
1847
- this.subs.push(this.observeMapRender());
1848
- this.subs.push(this.observeMapClick());
1849
- this.subs.push(this.observeClose());
1850
- }
1851
- observeMapClick() {
1852
- return this.postboy.subscribe(MapClickEvent.ID).subscribe((ev) => {
1853
- this._settings.show(ev) ? this.addOverlay(ev.coordinates) : this.removeOverlay();
1854
- });
1855
- }
1856
- observeClose() {
1857
- return this.postboy
1858
- .subscribe(CloseTooltipCommand.ID)
1859
- .pipe(filter((ev) => ev.tooltipId === this._settings.id))
1860
- .subscribe(() => this.removeOverlay());
1861
- }
1862
- observeMapRender() {
1863
- return this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
1864
- this.map = m.map;
1865
- });
1866
- }
1867
- removeOverlay = () => {
1868
- !!this.overlay && this.map?.removeOverlay(this.overlay);
1869
- this.show = false;
1870
- };
1871
- addOverlay(coordinates) {
1872
- this.removeOverlay();
1873
- this.overlay = new Overlay(this.options(coordinates));
1874
- this.map?.addOverlay(this.overlay);
1875
- this.show = true;
1876
- this.detector.detectChanges();
1877
- }
1878
- options = (coordinates) => {
1879
- return {
1880
- element: this.container?.nativeElement,
1881
- autoPan: false,
1882
- autoPanAnimation: { duration: 0 },
1883
- position: coordinates,
1884
- };
1885
- };
1886
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TooltipComponent, deps: [{ token: MapPostboyService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1887
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TooltipComponent, selector: "art-tooltip", inputs: { settings: "settings" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["tip"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div #tip [class]=\"['tooltip-wrapper', _settings.containerClass]\" [hidden]=\"!show\">\r\n <ng-content></ng-content>\r\n</div>\r\n", styles: [".tooltip-wrapper{position:absolute}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1888
- }
1889
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TooltipComponent, decorators: [{
1890
- type: Component,
1891
- args: [{ selector: 'art-tooltip', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div #tip [class]=\"['tooltip-wrapper', _settings.containerClass]\" [hidden]=\"!show\">\r\n <ng-content></ng-content>\r\n</div>\r\n", styles: [".tooltip-wrapper{position:absolute}\n"] }]
1892
- }], ctorParameters: function () { return [{ type: MapPostboyService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { container: [{
1893
- type: ViewChild,
1894
- args: ['tip']
1895
- }], settings: [{
1896
- type: Input
1773
+ class TooltipSettings {
1774
+ id;
1775
+ containerClass = 'custom-tooltip-class';
1776
+ show = (e) => true;
1777
+ constructor(id) {
1778
+ this.id = id ?? IdGenerator.get();
1779
+ }
1780
+ static copy(model) {
1781
+ const result = new TooltipSettings(model.id);
1782
+ result.show = model.show;
1783
+ result.containerClass = model.containerClass;
1784
+ return result;
1785
+ }
1786
+ setShow(show) {
1787
+ return TooltipSettings.copy({ ...this, show });
1788
+ }
1789
+ setClass(containerClass) {
1790
+ return TooltipSettings.copy({ ...this, containerClass });
1791
+ }
1792
+ isSame(model) {
1793
+ if (this.show !== model.show)
1794
+ return false;
1795
+ if (this.containerClass !== model.containerClass)
1796
+ return false;
1797
+ if (this.id !== model.id)
1798
+ return false;
1799
+ return true;
1800
+ }
1801
+ }
1802
+
1803
+ class TooltipComponent extends DestructibleComponent {
1804
+ postboy;
1805
+ detector;
1806
+ container;
1807
+ _settings = new TooltipSettings();
1808
+ map;
1809
+ overlay;
1810
+ show = false;
1811
+ set settings(value) {
1812
+ if (!value || this._settings.isSame(value))
1813
+ return;
1814
+ this._settings = value;
1815
+ this.detector.detectChanges();
1816
+ }
1817
+ constructor(postboy, detector) {
1818
+ super();
1819
+ this.postboy = postboy;
1820
+ this.detector = detector;
1821
+ }
1822
+ ngOnInit() {
1823
+ this.subs.push(this.observeMapRender());
1824
+ this.subs.push(this.observeMapClick());
1825
+ this.subs.push(this.observeClose());
1826
+ }
1827
+ observeMapClick() {
1828
+ return this.postboy.subscribe(MapClickEvent.ID).subscribe((ev) => {
1829
+ this._settings.show(ev) ? this.addOverlay(ev.coordinates) : this.removeOverlay();
1830
+ });
1831
+ }
1832
+ observeClose() {
1833
+ return this.postboy
1834
+ .subscribe(CloseTooltipCommand.ID)
1835
+ .pipe(filter((ev) => ev.tooltipId === this._settings.id))
1836
+ .subscribe(() => this.removeOverlay());
1837
+ }
1838
+ observeMapRender() {
1839
+ return this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
1840
+ this.map = m.map;
1841
+ });
1842
+ }
1843
+ removeOverlay = () => {
1844
+ !!this.overlay && this.map?.removeOverlay(this.overlay);
1845
+ this.show = false;
1846
+ };
1847
+ addOverlay(coordinates) {
1848
+ this.removeOverlay();
1849
+ this.overlay = new Overlay(this.options(coordinates));
1850
+ this.map?.addOverlay(this.overlay);
1851
+ this.show = true;
1852
+ this.detector.detectChanges();
1853
+ }
1854
+ options = (coordinates) => {
1855
+ return {
1856
+ element: this.container?.nativeElement,
1857
+ autoPan: false,
1858
+ autoPanAnimation: { duration: 0 },
1859
+ position: coordinates,
1860
+ };
1861
+ };
1862
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: TooltipComponent, deps: [{ token: MapPostboyService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1863
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: TooltipComponent, selector: "art-tooltip", inputs: { settings: "settings" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["tip"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div #tip [class]=\"['tooltip-wrapper', _settings.containerClass]\" [hidden]=\"!show\">\r\n <ng-content></ng-content>\r\n</div>\r\n", styles: [".tooltip-wrapper{position:absolute}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1864
+ }
1865
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: TooltipComponent, decorators: [{
1866
+ type: Component,
1867
+ args: [{ selector: 'art-tooltip', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div #tip [class]=\"['tooltip-wrapper', _settings.containerClass]\" [hidden]=\"!show\">\r\n <ng-content></ng-content>\r\n</div>\r\n", styles: [".tooltip-wrapper{position:absolute}\n"] }]
1868
+ }], ctorParameters: () => [{ type: MapPostboyService }, { type: i0.ChangeDetectorRef }], propDecorators: { container: [{
1869
+ type: ViewChild,
1870
+ args: ['tip']
1871
+ }], settings: [{
1872
+ type: Input
1897
1873
  }] } });
1898
1874
 
1899
- class PolygonsComponent extends DestructibleComponent {
1900
- postboy;
1901
- layerName = '';
1902
- constructor(postboy) {
1903
- super();
1904
- this.postboy = postboy;
1905
- }
1906
- _polygons = [];
1907
- set polygons(value) {
1908
- this._polygons = value ?? [];
1909
- this.putPolygons();
1910
- }
1911
- ngOnInit() {
1912
- this.postboy
1913
- .subscribe(MapRenderedEvent.ID)
1914
- .pipe(filter((m) => !!m), first())
1915
- .subscribe(() => this.putPolygons());
1916
- }
1917
- putPolygons() {
1918
- if (!this._polygons)
1919
- return;
1920
- this.postboy.fire(new PlaceLayerFeaturesCommand(this.layerName, this._polygons.map((m) => m.feature)));
1921
- }
1922
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PolygonsComponent, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Component });
1923
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: PolygonsComponent, selector: "art-polygons", inputs: { layerName: "layerName", polygons: "polygons" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1924
- }
1925
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PolygonsComponent, decorators: [{
1926
- type: Component,
1927
- args: [{ selector: 'art-polygons', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
1928
- }], ctorParameters: function () { return [{ type: MapPostboyService }]; }, propDecorators: { layerName: [{
1929
- type: Input
1930
- }], polygons: [{
1931
- type: Input
1875
+ class PolygonsComponent extends DestructibleComponent {
1876
+ postboy;
1877
+ layerName = '';
1878
+ constructor(postboy) {
1879
+ super();
1880
+ this.postboy = postboy;
1881
+ }
1882
+ _polygons = [];
1883
+ set polygons(value) {
1884
+ this._polygons = value ?? [];
1885
+ this.putPolygons();
1886
+ }
1887
+ ngOnInit() {
1888
+ this.postboy
1889
+ .subscribe(MapRenderedEvent.ID)
1890
+ .pipe(filter((m) => !!m), first())
1891
+ .subscribe(() => this.putPolygons());
1892
+ }
1893
+ putPolygons() {
1894
+ if (!this._polygons)
1895
+ return;
1896
+ this.postboy.fire(new PlaceLayerFeaturesCommand(this.layerName, this._polygons.map((m) => m.feature)));
1897
+ }
1898
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: PolygonsComponent, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Component });
1899
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: PolygonsComponent, selector: "art-polygons", inputs: { layerName: "layerName", polygons: "polygons" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1900
+ }
1901
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: PolygonsComponent, decorators: [{
1902
+ type: Component,
1903
+ args: [{ selector: 'art-polygons', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
1904
+ }], ctorParameters: () => [{ type: MapPostboyService }], propDecorators: { layerName: [{
1905
+ type: Input
1906
+ }], polygons: [{
1907
+ type: Input
1932
1908
  }] } });
1933
1909
 
1934
- class ZoomControlSettings {
1935
- controlClass = 'ol-zoom';
1936
- zoomInClass = 'ol-zoom-in';
1937
- zoomOutClass = 'ol-zoom-out';
1938
- zoomInLabel = 'Zoom In';
1939
- zoomOutLabel = 'Zoom Out';
1940
- static copy(model) {
1941
- const result = new ZoomControlSettings();
1942
- result.controlClass = model.controlClass;
1943
- result.zoomInClass = model.zoomInClass;
1944
- result.zoomOutClass = model.zoomOutClass;
1945
- result.zoomInLabel = model.zoomInLabel;
1946
- result.zoomOutLabel = model.zoomOutLabel;
1947
- return result;
1948
- }
1949
- isSame(model) {
1950
- if (this.zoomInClass !== model.zoomInClass)
1951
- return false;
1952
- if (this.zoomOutClass !== model.zoomOutClass)
1953
- return false;
1954
- if (this.zoomInLabel !== model.zoomInLabel)
1955
- return false;
1956
- if (this.controlClass !== model.controlClass)
1957
- return false;
1958
- if (this.zoomOutLabel !== model.zoomOutLabel)
1959
- return false;
1960
- return true;
1961
- }
1962
- setZoomInLabel(zoomInLabel) {
1963
- return ZoomControlSettings.copy({ ...this, zoomInLabel });
1964
- }
1965
- setZoomOutClass(zoomOutClass) {
1966
- return ZoomControlSettings.copy({ ...this, zoomOutClass });
1967
- }
1968
- setZoomInClass(zoomInClass) {
1969
- return ZoomControlSettings.copy({ ...this, zoomInClass });
1970
- }
1971
- setZoomOutLabel(zoomOutLabel) {
1972
- return ZoomControlSettings.copy({ ...this, zoomOutLabel });
1973
- }
1974
- setControlClass(controlClass) {
1975
- return ZoomControlSettings.copy({ ...this, controlClass });
1976
- }
1977
- }
1978
-
1979
- class MapControlZoomComponent extends DestructibleComponent {
1980
- postboy;
1981
- _settings = new ZoomControlSettings();
1982
- map;
1983
- control;
1984
- set settings(value) {
1985
- if (!value || this._settings.isSame(value))
1986
- return;
1987
- this._settings = value;
1988
- this.setControl();
1989
- }
1990
- constructor(postboy) {
1991
- super();
1992
- this.postboy = postboy;
1993
- }
1994
- ngOnInit() {
1995
- this.postboy
1996
- .subscribe(MapRenderedEvent.ID)
1997
- .pipe(filter((m) => !!m), first())
1998
- .subscribe((m) => {
1999
- this.map = m.map;
2000
- this.setControl();
2001
- });
2002
- }
2003
- setControl() {
2004
- if (!this.map)
2005
- return;
2006
- this.control = this.postboy.execute(new GenerateZoomControlExecutor(this._settings));
2007
- this.map.addControl(this.control);
2008
- }
2009
- onDestroy = () => {
2010
- this.eliminate();
2011
- };
2012
- eliminate = () => !!this.map && !!this.control && this.map.removeControl(this.control);
2013
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapControlZoomComponent, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Component });
2014
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: MapControlZoomComponent, selector: "art-map-control-zoom", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2015
- }
2016
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapControlZoomComponent, decorators: [{
2017
- type: Component,
2018
- args: [{ selector: 'art-map-control-zoom', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
2019
- }], ctorParameters: function () { return [{ type: MapPostboyService }]; }, propDecorators: { settings: [{
2020
- type: Input
1910
+ class ZoomControlSettings {
1911
+ controlClass = 'ol-zoom';
1912
+ zoomInClass = 'ol-zoom-in';
1913
+ zoomOutClass = 'ol-zoom-out';
1914
+ zoomInLabel = 'Zoom In';
1915
+ zoomOutLabel = 'Zoom Out';
1916
+ static copy(model) {
1917
+ const result = new ZoomControlSettings();
1918
+ result.controlClass = model.controlClass;
1919
+ result.zoomInClass = model.zoomInClass;
1920
+ result.zoomOutClass = model.zoomOutClass;
1921
+ result.zoomInLabel = model.zoomInLabel;
1922
+ result.zoomOutLabel = model.zoomOutLabel;
1923
+ return result;
1924
+ }
1925
+ isSame(model) {
1926
+ if (this.zoomInClass !== model.zoomInClass)
1927
+ return false;
1928
+ if (this.zoomOutClass !== model.zoomOutClass)
1929
+ return false;
1930
+ if (this.zoomInLabel !== model.zoomInLabel)
1931
+ return false;
1932
+ if (this.controlClass !== model.controlClass)
1933
+ return false;
1934
+ if (this.zoomOutLabel !== model.zoomOutLabel)
1935
+ return false;
1936
+ return true;
1937
+ }
1938
+ setZoomInLabel(zoomInLabel) {
1939
+ return ZoomControlSettings.copy({ ...this, zoomInLabel });
1940
+ }
1941
+ setZoomOutClass(zoomOutClass) {
1942
+ return ZoomControlSettings.copy({ ...this, zoomOutClass });
1943
+ }
1944
+ setZoomInClass(zoomInClass) {
1945
+ return ZoomControlSettings.copy({ ...this, zoomInClass });
1946
+ }
1947
+ setZoomOutLabel(zoomOutLabel) {
1948
+ return ZoomControlSettings.copy({ ...this, zoomOutLabel });
1949
+ }
1950
+ setControlClass(controlClass) {
1951
+ return ZoomControlSettings.copy({ ...this, controlClass });
1952
+ }
1953
+ }
1954
+
1955
+ class MapControlZoomComponent extends DestructibleComponent {
1956
+ postboy;
1957
+ _settings = new ZoomControlSettings();
1958
+ map;
1959
+ control;
1960
+ set settings(value) {
1961
+ if (!value || this._settings.isSame(value))
1962
+ return;
1963
+ this._settings = value;
1964
+ this.setControl();
1965
+ }
1966
+ constructor(postboy) {
1967
+ super();
1968
+ this.postboy = postboy;
1969
+ }
1970
+ ngOnInit() {
1971
+ this.postboy
1972
+ .subscribe(MapRenderedEvent.ID)
1973
+ .pipe(filter((m) => !!m), first())
1974
+ .subscribe((m) => {
1975
+ this.map = m.map;
1976
+ this.setControl();
1977
+ });
1978
+ }
1979
+ setControl() {
1980
+ if (!this.map)
1981
+ return;
1982
+ this.control = this.postboy.execute(new GenerateZoomControlExecutor(this._settings));
1983
+ this.map.addControl(this.control);
1984
+ }
1985
+ onDestroy = () => {
1986
+ this.eliminate();
1987
+ };
1988
+ eliminate = () => !!this.map && !!this.control && this.map.removeControl(this.control);
1989
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapControlZoomComponent, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Component });
1990
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: MapControlZoomComponent, selector: "art-map-control-zoom", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1991
+ }
1992
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapControlZoomComponent, decorators: [{
1993
+ type: Component,
1994
+ args: [{ selector: 'art-map-control-zoom', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
1995
+ }], ctorParameters: () => [{ type: MapPostboyService }], propDecorators: { settings: [{
1996
+ type: Input
2021
1997
  }] } });
2022
1998
 
2023
- class MapModule {
2024
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2025
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: MapModule, declarations: [DestructibleComponent,
2026
- MapPlateComponent,
2027
- TileLayerComponent,
2028
- OsmTileLayerComponent,
2029
- FeatureLayerComponent,
2030
- MarkersComponent,
2031
- TooltipComponent,
2032
- PolygonsComponent,
2033
- ClusterLayerComponent,
2034
- MapControlZoomComponent], imports: [CommonModule], exports: [MapPlateComponent,
2035
- FeatureLayerComponent,
2036
- MarkersComponent,
2037
- TileLayerComponent,
2038
- TooltipComponent,
2039
- PolygonsComponent,
2040
- ClusterLayerComponent,
2041
- MapControlZoomComponent] });
2042
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapModule, imports: [CommonModule] });
2043
- }
2044
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapModule, decorators: [{
2045
- type: NgModule,
2046
- args: [{
2047
- imports: [CommonModule],
2048
- declarations: [
2049
- DestructibleComponent,
2050
- MapPlateComponent,
2051
- TileLayerComponent,
2052
- OsmTileLayerComponent,
2053
- FeatureLayerComponent,
2054
- MarkersComponent,
2055
- TooltipComponent,
2056
- PolygonsComponent,
2057
- ClusterLayerComponent,
2058
- MapControlZoomComponent,
2059
- ],
2060
- exports: [
2061
- MapPlateComponent,
2062
- FeatureLayerComponent,
2063
- MarkersComponent,
2064
- TileLayerComponent,
2065
- TooltipComponent,
2066
- PolygonsComponent,
2067
- ClusterLayerComponent,
2068
- MapControlZoomComponent,
2069
- ],
2070
- }]
1999
+ class MapModule {
2000
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2001
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.7", ngImport: i0, type: MapModule, declarations: [DestructibleComponent,
2002
+ MapPlateComponent,
2003
+ TileLayerComponent,
2004
+ OsmTileLayerComponent,
2005
+ FeatureLayerComponent,
2006
+ MarkersComponent,
2007
+ TooltipComponent,
2008
+ PolygonsComponent,
2009
+ ClusterLayerComponent,
2010
+ MapControlZoomComponent], imports: [CommonModule], exports: [MapPlateComponent,
2011
+ FeatureLayerComponent,
2012
+ MarkersComponent,
2013
+ TileLayerComponent,
2014
+ TooltipComponent,
2015
+ PolygonsComponent,
2016
+ ClusterLayerComponent,
2017
+ MapControlZoomComponent] });
2018
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapModule, imports: [CommonModule] });
2019
+ }
2020
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapModule, decorators: [{
2021
+ type: NgModule,
2022
+ args: [{
2023
+ imports: [CommonModule],
2024
+ declarations: [
2025
+ DestructibleComponent,
2026
+ MapPlateComponent,
2027
+ TileLayerComponent,
2028
+ OsmTileLayerComponent,
2029
+ FeatureLayerComponent,
2030
+ MarkersComponent,
2031
+ TooltipComponent,
2032
+ PolygonsComponent,
2033
+ ClusterLayerComponent,
2034
+ MapControlZoomComponent,
2035
+ ],
2036
+ exports: [
2037
+ MapPlateComponent,
2038
+ FeatureLayerComponent,
2039
+ MarkersComponent,
2040
+ TileLayerComponent,
2041
+ TooltipComponent,
2042
+ PolygonsComponent,
2043
+ ClusterLayerComponent,
2044
+ MapControlZoomComponent,
2045
+ ],
2046
+ }]
2071
2047
  }] });
2072
2048
 
2073
- class MarkerStyleHelper {
2074
- static fromSvg(svg, size = [30, 30], zIndex = 400) {
2075
- let image = new Image();
2076
- image.src = 'data:image/svg+xml,' + escape(svg);
2077
- return new Style({
2078
- image: new Icon({
2079
- img: image,
2080
- imgSize: size,
2081
- }),
2082
- zIndex,
2083
- });
2084
- }
2085
- static circle(radius, fill, strokeColor, strokeWidth = 1) {
2086
- return new Style({
2087
- image: new Circle({
2088
- radius,
2089
- fill: new Fill({ color: fill }),
2090
- stroke: new Stroke({ color: strokeColor, width: strokeWidth }),
2091
- }),
2092
- });
2093
- }
2094
- static withText(style, text) {
2095
- style.setText(text);
2096
- return style;
2097
- }
2098
- }
2099
-
2100
- class PolygonStyleHelper {
2101
- static simple(fill, stroke, strokeWidth = 1) {
2102
- return new Style({
2103
- fill: new Fill({
2104
- color: fill,
2105
- }),
2106
- stroke: new Stroke({
2107
- color: stroke,
2108
- width: strokeWidth,
2109
- }),
2110
- });
2111
- }
2112
- static edit(fill, stroke, strokeWidth = 1, pinRadius = 5) {
2113
- return new Style({
2114
- image: new Circle({
2115
- fill: new Fill({
2116
- color: stroke,
2117
- }),
2118
- radius: pinRadius,
2119
- }),
2120
- fill: new Fill({
2121
- color: fill,
2122
- }),
2123
- stroke: new Stroke({
2124
- color: stroke,
2125
- width: strokeWidth,
2126
- }),
2127
- });
2128
- }
2129
- }
2130
-
2131
- class TextStyleHelper {
2132
- static get(text, font, color) {
2133
- return new Text({
2134
- text: text,
2135
- font: font,
2136
- textAlign: 'center',
2137
- fill: new Fill({
2138
- color: color,
2139
- }),
2140
- });
2141
- }
2142
- }
2143
-
2144
- class StringifyFeatureHelper {
2145
- static polygon(feature, format = FeatureOutputFormat.GeoJson) {
2146
- return format === FeatureOutputFormat.GeoJson
2147
- ? new GeoJSON().writeFeature(feature)
2148
- : new WKT().writeFeature(feature);
2149
- }
2150
- static circle(feature, format = FeatureOutputFormat.GeoJson) {
2151
- // const clone = feature.clone();
2152
- // clone.setGeometry(fromCircle(feature.getGeometry()! as Circle));
2153
- const tetemp = feature.getGeometryName();
2154
- const circle = feature.getGeometry();
2155
- // const temp = StringifyFeatureHelper.drawCircle(circle.getCenter(), circle.getRadius());
2156
- const ttt = feature.getGeometry().getExtent();
2157
- const eastPoint = [ttt[2], (ttt[1] + ttt[3]) / 2];
2158
- const aaa = [
2159
- ...transform([ttt[0], ttt[1]], 'EPSG:4326', 'EPSG:3857'),
2160
- ...transform([ttt[2], ttt[3]], 'EPSG:4326', 'EPSG:3857'),
2161
- ];
2162
- const radius = (aaa[2] - aaa[0]) / 2;
2163
- const radius2 = new LineString([circle.getCenter(), eastPoint]).getLength();
2164
- const polygonGeom = new Polygon(StringifyFeatureHelper.drawCircle(circle.getCenter(), radius));
2165
- // var edgeCoordinate = [circle.getCenter()[0] + radius, circle.getCenter()[1]];
2166
- // var wgs84Sphere = new Sphere(6378137);
2167
- return StringifyFeatureHelper.polygon(new Feature(polygonGeom), format);
2168
- // const rad = circle.getRadius();
2169
- // const degrees = 180 / Math.PI; // radians to degrees
2170
- // const radians = Math.PI / 180; // degrees to radians
2171
- // const rlat = rad * degrees * 1000;
2172
- // const rlng = rad * radians;
2173
- // return StringifyFeatureHelper.polygon(new Feature<Geometry>(circular(circle.getCenter(),circle.getRadius() * METERS_PER_UNIT)), format);
2174
- }
2175
- static drawCircle(point, radius) {
2176
- const tetetemp = transform(point, 'EPSG:4326', 'EPSG:3857');
2177
- // const tetetemp = point;
2178
- const radians = Math.PI / 180; // degrees to radians
2179
- const degrees = 180 / Math.PI; // radians to degrees
2180
- const earthsradius = 6378137.0;
2181
- const rlat = (radius / earthsradius) * degrees;
2182
- const rlng = rlat / Math.cos(tetetemp[1] * radians);
2183
- const extp = [];
2184
- for (let i = 0; i <= 32; i++) {
2185
- const theta = Math.PI * (i / 16);
2186
- extp.push([
2187
- tetetemp[0] + rlng * Math.cos(theta) * METERS_PER_UNIT,
2188
- tetetemp[1] + rlat * Math.sin(theta) * METERS_PER_UNIT,
2189
- ]);
2190
- }
2191
- return [extp.map((e) => transform(e, 'EPSG:3857', 'EPSG:4326'))];
2192
- }
2193
- }
2194
-
2195
- /*
2196
- * Public API Surface of maps
2049
+ class MarkerStyleHelper {
2050
+ static fromSvg(svg, size = [30, 30], zIndex = 400) {
2051
+ let image = new Image();
2052
+ image.src = 'data:image/svg+xml,' + escape(svg);
2053
+ return new Style({
2054
+ image: new Icon({
2055
+ img: image,
2056
+ imgSize: size,
2057
+ }),
2058
+ zIndex,
2059
+ });
2060
+ }
2061
+ static circle(radius, fill, strokeColor, strokeWidth = 1) {
2062
+ return new Style({
2063
+ image: new Circle({
2064
+ radius,
2065
+ fill: new Fill({ color: fill }),
2066
+ stroke: new Stroke({ color: strokeColor, width: strokeWidth }),
2067
+ }),
2068
+ });
2069
+ }
2070
+ static withText(style, text) {
2071
+ style.setText(text);
2072
+ return style;
2073
+ }
2074
+ }
2075
+
2076
+ class PolygonStyleHelper {
2077
+ static simple(fill, stroke, strokeWidth = 1) {
2078
+ return new Style({
2079
+ fill: new Fill({
2080
+ color: fill,
2081
+ }),
2082
+ stroke: new Stroke({
2083
+ color: stroke,
2084
+ width: strokeWidth,
2085
+ }),
2086
+ });
2087
+ }
2088
+ static edit(fill, stroke, strokeWidth = 1, pinRadius = 5) {
2089
+ return new Style({
2090
+ image: new Circle({
2091
+ fill: new Fill({
2092
+ color: stroke,
2093
+ }),
2094
+ radius: pinRadius,
2095
+ }),
2096
+ fill: new Fill({
2097
+ color: fill,
2098
+ }),
2099
+ stroke: new Stroke({
2100
+ color: stroke,
2101
+ width: strokeWidth,
2102
+ }),
2103
+ });
2104
+ }
2105
+ }
2106
+
2107
+ class TextStyleHelper {
2108
+ static get(text, font, color) {
2109
+ return new Text({
2110
+ text: text,
2111
+ font: font,
2112
+ textAlign: 'center',
2113
+ fill: new Fill({
2114
+ color: color,
2115
+ }),
2116
+ });
2117
+ }
2118
+ }
2119
+
2120
+ class StringifyFeatureHelper {
2121
+ static polygon(feature, format = FeatureOutputFormat.GeoJson) {
2122
+ return format === FeatureOutputFormat.GeoJson
2123
+ ? new GeoJSON().writeFeature(feature)
2124
+ : new WKT().writeFeature(feature);
2125
+ }
2126
+ static circle(feature, format = FeatureOutputFormat.GeoJson) {
2127
+ // const clone = feature.clone();
2128
+ // clone.setGeometry(fromCircle(feature.getGeometry()! as Circle));
2129
+ const tetemp = feature.getGeometryName();
2130
+ const circle = feature.getGeometry();
2131
+ // const temp = StringifyFeatureHelper.drawCircle(circle.getCenter(), circle.getRadius());
2132
+ const ttt = feature.getGeometry().getExtent();
2133
+ const eastPoint = [ttt[2], (ttt[1] + ttt[3]) / 2];
2134
+ const aaa = [
2135
+ ...transform([ttt[0], ttt[1]], 'EPSG:4326', 'EPSG:3857'),
2136
+ ...transform([ttt[2], ttt[3]], 'EPSG:4326', 'EPSG:3857'),
2137
+ ];
2138
+ const radius = (aaa[2] - aaa[0]) / 2;
2139
+ const radius2 = new LineString([circle.getCenter(), eastPoint]).getLength();
2140
+ const polygonGeom = new Polygon(StringifyFeatureHelper.drawCircle(circle.getCenter(), radius));
2141
+ // var edgeCoordinate = [circle.getCenter()[0] + radius, circle.getCenter()[1]];
2142
+ // var wgs84Sphere = new Sphere(6378137);
2143
+ return StringifyFeatureHelper.polygon(new Feature(polygonGeom), format);
2144
+ // const rad = circle.getRadius();
2145
+ // const degrees = 180 / Math.PI; // radians to degrees
2146
+ // const radians = Math.PI / 180; // degrees to radians
2147
+ // const rlat = rad * degrees * 1000;
2148
+ // const rlng = rad * radians;
2149
+ // return StringifyFeatureHelper.polygon(new Feature<Geometry>(circular(circle.getCenter(),circle.getRadius() * METERS_PER_UNIT)), format);
2150
+ }
2151
+ static drawCircle(point, radius) {
2152
+ const tetetemp = transform(point, 'EPSG:4326', 'EPSG:3857');
2153
+ // const tetetemp = point;
2154
+ const radians = Math.PI / 180; // degrees to radians
2155
+ const degrees = 180 / Math.PI; // radians to degrees
2156
+ const earthsradius = 6378137.0;
2157
+ const rlat = (radius / earthsradius) * degrees;
2158
+ const rlng = rlat / Math.cos(tetetemp[1] * radians);
2159
+ const extp = [];
2160
+ for (let i = 0; i <= 32; i++) {
2161
+ const theta = Math.PI * (i / 16);
2162
+ extp.push([
2163
+ tetetemp[0] + rlng * Math.cos(theta) * METERS_PER_UNIT,
2164
+ tetetemp[1] + rlat * Math.sin(theta) * METERS_PER_UNIT,
2165
+ ]);
2166
+ }
2167
+ return [extp.map((e) => transform(e, 'EPSG:3857', 'EPSG:4326'))];
2168
+ }
2169
+ }
2170
+
2171
+ /*
2172
+ * Public API Surface of maps
2197
2173
  */
2198
2174
 
2199
- /**
2200
- * Generated bundle index. Do not edit.
2175
+ /**
2176
+ * Generated bundle index. Do not edit.
2201
2177
  */
2202
2178
 
2203
- export { AddControlCommand, CalculateAreaExecutor, CancelDrawingCommand, CancelFeatureModificationCommand, CloseTooltipCommand, ClusterLayerComponent, ClusterLayerSettings, Dictionary, DrawSelectionAreaCommand, DrawingType, FeatureLayerComponent, FeatureLayerSettings, FeatureOutputFormat, MapClickEvent, MapControl, MapControlZoomComponent, MapLyrs, MapLyrsLabel, MapModule, MapMoveEndEvent, MapPlateComponent, MapPostboyService, MapRenderedEvent, MapSettings, MarkerModel, MarkerStyleHelper, MarkersComponent, MessageRegistratorService, ModifyFeatureCommand, OsmTileLayerComponent, PolygonModel, PolygonStyleHelper, PolygonsComponent, RemoveControlCommand, SetMapCenterCommand, StartDrawingCommand, StringifyFeatureHelper, TextStyleHelper, TileLayerComponent, TileLayerSettings, TooltipComponent, TooltipSettings, ZoomControlSettings };
2179
+ export { AddControlCommand, CalculateAreaExecutor, CancelDrawingCommand, CancelFeatureModificationCommand, CloseTooltipCommand, ClusterLayerComponent, ClusterLayerSettings, DrawSelectionAreaCommand, DrawingType, FeatureLayerComponent, FeatureLayerSettings, FeatureOutputFormat, FitToPolygonsCommand, MapClickEvent, MapControl, MapControlZoomComponent, MapLyrs, MapLyrsLabel, MapModule, MapMoveEndEvent, MapPlateComponent, MapPostboyService, MapRenderedEvent, MapSettings, MarkerModel, MarkerStyleHelper, MarkersComponent, MessageRegistratorService, ModifyFeatureCommand, OsmTileLayerComponent, PolygonModel, PolygonStyleHelper, PolygonsComponent, RemoveControlCommand, SetMapCenterCommand, StartDrawingCommand, StringifyFeatureHelper, TextStyleHelper, TileLayerComponent, TileLayerSettings, TooltipComponent, TooltipSettings, ZoomControlSettings };
2204
2180
  //# sourceMappingURL=maps-components-src-map.mjs.map