@artstesh/maps 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/dist/bundles/maps-components-src-map.umd.js +784 -286
  2. package/dist/bundles/maps-components-src-map.umd.js.map +1 -1
  3. package/dist/bundles/maps-components.umd.js +784 -286
  4. package/dist/bundles/maps-components.umd.js.map +1 -1
  5. package/dist/esm2015/map/helpers/index.js +2 -1
  6. package/dist/esm2015/map/helpers/marker-style.helper.js +5 -1
  7. package/dist/esm2015/map/helpers/text-style.helper.js +14 -0
  8. package/dist/esm2015/map/map-plate/features/polygons/polygons.component.js +2 -3
  9. package/dist/esm2015/map/map-plate/layers/cluster-layer/cluster-layer-factory.service.js +60 -0
  10. package/dist/esm2015/map/map-plate/layers/cluster-layer/cluster-layer.component.js +56 -0
  11. package/dist/esm2015/map/map-plate/layers/cluster-layer/cluster-layer.manager.js +37 -0
  12. package/dist/esm2015/map/map-plate/layers/cluster-layer/cluster-layer.settings.js +68 -0
  13. package/dist/esm2015/map/map-plate/layers/index.js +3 -1
  14. package/dist/esm2015/map/map-plate/layers/tile-layer/tile-layer.component.js +1 -1
  15. package/dist/esm2015/map/map-plate/map-plate.component.js +24 -4
  16. package/dist/esm2015/map/map.module.js +8 -3
  17. package/dist/esm2015/map/messages/commands/add-layer.command.js +3 -3
  18. package/dist/esm2015/map/messages/commands/add-tile.command.js +3 -3
  19. package/dist/esm2015/map/messages/commands/cancel-drawing.command.js +8 -0
  20. package/dist/esm2015/map/messages/commands/close-tooltip.command.js +3 -3
  21. package/dist/esm2015/map/messages/commands/fit-to-features.command.js +13 -0
  22. package/dist/esm2015/map/messages/commands/place-layer-features.command.js +3 -3
  23. package/dist/esm2015/map/messages/commands/remove-layer.command.js +3 -3
  24. package/dist/esm2015/map/messages/commands/remove-tile.command.js +3 -3
  25. package/dist/esm2015/map/messages/commands/start-drawing.command.js +15 -0
  26. package/dist/esm2015/map/messages/events/drawing-finished.event.js +11 -0
  27. package/dist/esm2015/map/messages/events/map-click.event.js +5 -4
  28. package/dist/esm2015/map/messages/events/map-move-end.event.js +13 -0
  29. package/dist/esm2015/map/messages/events/map-rendered.event.js +3 -3
  30. package/dist/esm2015/map/messages/index.js +4 -2
  31. package/dist/esm2015/map/messages/queries/get-layer.query.js +12 -0
  32. package/dist/esm2015/map/models/drawing-type.enum.js +5 -0
  33. package/dist/esm2015/map/models/feature-format.enum.js +6 -0
  34. package/dist/esm2015/map/models/i-identified.js +2 -0
  35. package/dist/esm2015/map/models/index.js +3 -1
  36. package/dist/esm2015/map/models/map.constants.js +5 -0
  37. package/dist/esm2015/map/models/marker-model.js +3 -2
  38. package/dist/esm2015/map/services/drawing/drawing.service.js +80 -0
  39. package/dist/esm2015/map/services/map-click.service.js +7 -3
  40. package/dist/esm2015/map/services/map-feature.service.js +39 -0
  41. package/dist/esm2015/map/services/map-management.service.js +12 -4
  42. package/dist/esm2015/map/services/map-postboy.service.js +8 -5
  43. package/dist/esm2015/map/services/map-state.service.js +12 -2
  44. package/dist/esm2015/map/services/message-registrator.service.js +20 -6
  45. package/dist/esm2015/src/map/helpers/index.js +2 -1
  46. package/dist/esm2015/src/map/helpers/marker-style.helper.js +5 -1
  47. package/dist/esm2015/src/map/helpers/text-style.helper.js +14 -0
  48. package/dist/esm2015/src/map/map-plate/features/polygons/polygons.component.js +2 -3
  49. package/dist/esm2015/src/map/map-plate/layers/cluster-layer/cluster-layer-factory.service.js +60 -0
  50. package/dist/esm2015/src/map/map-plate/layers/cluster-layer/cluster-layer.component.js +56 -0
  51. package/dist/esm2015/src/map/map-plate/layers/cluster-layer/cluster-layer.manager.js +37 -0
  52. package/dist/esm2015/src/map/map-plate/layers/cluster-layer/cluster-layer.settings.js +68 -0
  53. package/dist/esm2015/src/map/map-plate/layers/index.js +3 -1
  54. package/dist/esm2015/src/map/map-plate/layers/tile-layer/tile-layer.component.js +1 -1
  55. package/dist/esm2015/src/map/map-plate/map-plate.component.js +24 -4
  56. package/dist/esm2015/src/map/map.module.js +8 -3
  57. package/dist/esm2015/src/map/messages/commands/add-layer.command.js +3 -3
  58. package/dist/esm2015/src/map/messages/commands/add-tile.command.js +3 -3
  59. package/dist/esm2015/src/map/messages/commands/cancel-drawing.command.js +8 -0
  60. package/dist/esm2015/src/map/messages/commands/close-tooltip.command.js +3 -3
  61. package/dist/esm2015/src/map/messages/commands/fit-to-features.command.js +13 -0
  62. package/dist/esm2015/src/map/messages/commands/place-layer-features.command.js +3 -3
  63. package/dist/esm2015/src/map/messages/commands/remove-layer.command.js +3 -3
  64. package/dist/esm2015/src/map/messages/commands/remove-tile.command.js +3 -3
  65. package/dist/esm2015/src/map/messages/commands/start-drawing.command.js +15 -0
  66. package/dist/esm2015/src/map/messages/events/drawing-finished.event.js +11 -0
  67. package/dist/esm2015/src/map/messages/events/map-click.event.js +5 -4
  68. package/dist/esm2015/src/map/messages/events/map-move-end.event.js +13 -0
  69. package/dist/esm2015/src/map/messages/events/map-rendered.event.js +3 -3
  70. package/dist/esm2015/src/map/messages/index.js +4 -2
  71. package/dist/esm2015/src/map/messages/queries/get-layer.query.js +12 -0
  72. package/dist/esm2015/src/map/models/drawing-type.enum.js +5 -0
  73. package/dist/esm2015/src/map/models/feature-format.enum.js +6 -0
  74. package/dist/esm2015/src/map/models/i-identified.js +2 -0
  75. package/dist/esm2015/src/map/models/index.js +3 -1
  76. package/dist/esm2015/src/map/models/map.constants.js +5 -0
  77. package/dist/esm2015/src/map/models/marker-model.js +3 -2
  78. package/dist/esm2015/src/map/services/drawing/drawing.service.js +80 -0
  79. package/dist/esm2015/src/map/services/map-click.service.js +7 -3
  80. package/dist/esm2015/src/map/services/map-feature.service.js +39 -0
  81. package/dist/esm2015/src/map/services/map-management.service.js +12 -4
  82. package/dist/esm2015/src/map/services/map-postboy.service.js +8 -5
  83. package/dist/esm2015/src/map/services/map-state.service.js +12 -2
  84. package/dist/esm2015/src/map/services/message-registrator.service.js +20 -6
  85. package/dist/fesm2015/maps-components-src-map.js +613 -186
  86. package/dist/fesm2015/maps-components-src-map.js.map +1 -1
  87. package/dist/fesm2015/maps-components.js +613 -186
  88. package/dist/fesm2015/maps-components.js.map +1 -1
  89. package/dist/map/helpers/index.d.ts +1 -0
  90. package/dist/map/helpers/marker-style.helper.d.ts +2 -0
  91. package/dist/map/helpers/text-style.helper.d.ts +4 -0
  92. package/dist/map/map-plate/layers/cluster-layer/cluster-layer-factory.service.d.ts +11 -0
  93. package/dist/map/map-plate/layers/cluster-layer/cluster-layer.component.d.ts +21 -0
  94. package/dist/map/map-plate/layers/cluster-layer/cluster-layer.manager.d.ts +13 -0
  95. package/dist/map/map-plate/layers/cluster-layer/cluster-layer.settings.d.ts +22 -0
  96. package/dist/map/map-plate/layers/index.d.ts +2 -0
  97. package/dist/map/map-plate/map-plate.component.d.ts +2 -0
  98. package/dist/map/map.module.d.ts +3 -2
  99. package/dist/map/messages/commands/add-layer.command.d.ts +6 -5
  100. package/dist/map/messages/commands/add-tile.command.d.ts +3 -3
  101. package/dist/map/messages/commands/cancel-drawing.command.d.ts +5 -0
  102. package/dist/map/messages/commands/close-tooltip.command.d.ts +3 -3
  103. package/dist/map/messages/commands/fit-to-features.command.d.ts +10 -0
  104. package/dist/map/messages/commands/place-layer-features.command.d.ts +3 -3
  105. package/dist/map/messages/commands/remove-layer.command.d.ts +3 -3
  106. package/dist/map/messages/commands/remove-tile.command.d.ts +3 -3
  107. package/dist/map/messages/commands/start-drawing.command.d.ts +11 -0
  108. package/dist/map/messages/events/drawing-finished.event.d.ts +6 -0
  109. package/dist/map/messages/events/map-click.event.d.ts +13 -5
  110. package/dist/map/messages/events/map-move-end.event.d.ts +8 -0
  111. package/dist/map/messages/events/map-rendered.event.d.ts +3 -3
  112. package/dist/map/messages/index.d.ts +3 -1
  113. package/dist/map/messages/queries/get-layer.query.d.ts +10 -0
  114. package/dist/map/models/drawing-type.enum.d.ts +3 -0
  115. package/dist/map/models/feature-format.enum.d.ts +4 -0
  116. package/dist/map/models/i-identified.d.ts +3 -0
  117. package/dist/map/models/index.d.ts +2 -0
  118. package/dist/map/models/map.constants.d.ts +4 -0
  119. package/dist/map/services/drawing/drawing.service.d.ts +17 -0
  120. package/dist/map/services/map-feature.service.d.ts +14 -0
  121. package/dist/map/services/map-management.service.d.ts +1 -0
  122. package/dist/map/services/map-postboy.service.d.ts +1 -2
  123. package/dist/map/services/message-registrator.service.d.ts +3 -1
  124. package/dist/package.json +1 -1
  125. package/dist/src/map/helpers/index.d.ts +1 -0
  126. package/dist/src/map/helpers/marker-style.helper.d.ts +2 -0
  127. package/dist/src/map/helpers/text-style.helper.d.ts +4 -0
  128. package/dist/src/map/map-plate/layers/cluster-layer/cluster-layer-factory.service.d.ts +11 -0
  129. package/dist/src/map/map-plate/layers/cluster-layer/cluster-layer.component.d.ts +21 -0
  130. package/dist/src/map/map-plate/layers/cluster-layer/cluster-layer.manager.d.ts +13 -0
  131. package/dist/src/map/map-plate/layers/cluster-layer/cluster-layer.settings.d.ts +22 -0
  132. package/dist/src/map/map-plate/layers/index.d.ts +2 -0
  133. package/dist/src/map/map-plate/map-plate.component.d.ts +2 -0
  134. package/dist/src/map/map.module.d.ts +3 -2
  135. package/dist/src/map/messages/commands/add-layer.command.d.ts +6 -5
  136. package/dist/src/map/messages/commands/add-tile.command.d.ts +3 -3
  137. package/dist/src/map/messages/commands/cancel-drawing.command.d.ts +5 -0
  138. package/dist/src/map/messages/commands/close-tooltip.command.d.ts +3 -3
  139. package/dist/src/map/messages/commands/fit-to-features.command.d.ts +10 -0
  140. package/dist/src/map/messages/commands/place-layer-features.command.d.ts +3 -3
  141. package/dist/src/map/messages/commands/remove-layer.command.d.ts +3 -3
  142. package/dist/src/map/messages/commands/remove-tile.command.d.ts +3 -3
  143. package/dist/src/map/messages/commands/start-drawing.command.d.ts +11 -0
  144. package/dist/src/map/messages/events/drawing-finished.event.d.ts +6 -0
  145. package/dist/src/map/messages/events/map-click.event.d.ts +13 -5
  146. package/dist/src/map/messages/events/map-move-end.event.d.ts +8 -0
  147. package/dist/src/map/messages/events/map-rendered.event.d.ts +3 -3
  148. package/dist/src/map/messages/index.d.ts +3 -1
  149. package/dist/src/map/messages/queries/get-layer.query.d.ts +10 -0
  150. package/dist/src/map/models/drawing-type.enum.d.ts +3 -0
  151. package/dist/src/map/models/feature-format.enum.d.ts +4 -0
  152. package/dist/src/map/models/i-identified.d.ts +3 -0
  153. package/dist/src/map/models/index.d.ts +2 -0
  154. package/dist/src/map/models/map.constants.d.ts +4 -0
  155. package/dist/src/map/services/drawing/drawing.service.d.ts +17 -0
  156. package/dist/src/map/services/map-feature.service.d.ts +14 -0
  157. package/dist/src/map/services/map-management.service.d.ts +1 -0
  158. package/dist/src/map/services/map-postboy.service.d.ts +1 -2
  159. package/dist/src/map/services/message-registrator.service.d.ts +3 -1
  160. package/package.json +2 -2
  161. package/dist/esm2015/map/messages/generic-message.js +0 -15
  162. package/dist/esm2015/src/map/messages/generic-message.js +0 -15
  163. package/dist/map/messages/generic-message.d.ts +0 -9
  164. package/dist/src/map/messages/generic-message.d.ts +0 -9
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('ol'), require('ol/geom'), require('ol/format'), require('ol/extent'), require('ol/proj'), require('rxjs'), require('@artstesh/postboy'), require('ol/Map'), require('ol/View'), require('ol/layer/Tile'), require('ol/source/OSM'), require('rxjs/operators'), require('ol/source'), require('ol/layer'), require('ol/Overlay'), require('ol/style/Style'), require('ol/style')) :
3
- typeof define === 'function' && define.amd ? define('maps-components/src/map', ['exports', '@angular/core', '@angular/common', 'ol', 'ol/geom', 'ol/format', 'ol/extent', 'ol/proj', 'rxjs', '@artstesh/postboy', 'ol/Map', 'ol/View', 'ol/layer/Tile', 'ol/source/OSM', 'rxjs/operators', 'ol/source', 'ol/layer', 'ol/Overlay', 'ol/style/Style', 'ol/style'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["maps-components"] = global["maps-components"] || {}, global["maps-components"].src = global["maps-components"].src || {}, global["maps-components"].src.map = {}), global.ng.core, global.ng.common, global.ol, global.geom, global.format, global.extent, global.proj, global.rxjs, global.postboy, global.Map, global.View, global.TileLayer, global.OSM, global.rxjs.operators, global.source, global.layer, global.Overlay, global.Style, global.style));
5
- })(this, (function (exports, i0, i5, ol, geom, format, extent, proj, rxjs, postboy, Map, View, TileLayer, OSM, operators, source, layer, Overlay, Style, style) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('ol'), require('ol/geom'), require('ol/format'), require('ol/extent'), require('ol/proj'), require('@artstesh/postboy'), require('rxjs/operators'), require('ol/source'), require('ol/interaction'), require('ol/layer/Tile'), require('ol/source/OSM'), require('ol/layer'), require('ol/loadingstrategy'), require('ol/geom/Polygon'), require('ol/source/Cluster'), require('rxjs'), require('ol/Map'), require('ol/View'), require('ol/Overlay'), require('ol/style/Style'), require('ol/style')) :
3
+ typeof define === 'function' && define.amd ? define('maps-components/src/map', ['exports', '@angular/core', '@angular/common', 'ol', 'ol/geom', 'ol/format', 'ol/extent', 'ol/proj', '@artstesh/postboy', 'rxjs/operators', 'ol/source', 'ol/interaction', 'ol/layer/Tile', 'ol/source/OSM', 'ol/layer', 'ol/loadingstrategy', 'ol/geom/Polygon', 'ol/source/Cluster', 'rxjs', 'ol/Map', 'ol/View', 'ol/Overlay', 'ol/style/Style', 'ol/style'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["maps-components"] = global["maps-components"] || {}, global["maps-components"].src = global["maps-components"].src || {}, global["maps-components"].src.map = {}), global.ng.core, global.ng.common, global.ol, global.geom, global.format, global.extent, global.proj, global.postboy, global.rxjs.operators, global.source, global.interaction, global.TileLayer, global.OSM, global.layer, global.loadingstrategy, global.Polygon, global.Cluster, global.rxjs, global.Map, global.View, global.Overlay, global.Style, global.style));
5
+ })(this, (function (exports, i0, i6, ol, geom, format, extent, proj, postboy, operators, source, interaction, TileLayer, OSM, layer, loadingstrategy, Polygon, Cluster, rxjs, Map, View, Overlay, Style, style) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -25,11 +25,12 @@
25
25
  }
26
26
 
27
27
  var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
28
- var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
29
- var Map__default = /*#__PURE__*/_interopDefaultLegacy(Map);
30
- var View__default = /*#__PURE__*/_interopDefaultLegacy(View);
28
+ var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
31
29
  var TileLayer__default = /*#__PURE__*/_interopDefaultLegacy(TileLayer);
32
30
  var OSM__default = /*#__PURE__*/_interopDefaultLegacy(OSM);
31
+ var Cluster__default = /*#__PURE__*/_interopDefaultLegacy(Cluster);
32
+ var Map__default = /*#__PURE__*/_interopDefaultLegacy(Map);
33
+ var View__default = /*#__PURE__*/_interopDefaultLegacy(View);
33
34
  var Overlay__default = /*#__PURE__*/_interopDefaultLegacy(Overlay);
34
35
  var Style__default = /*#__PURE__*/_interopDefaultLegacy(Style);
35
36
 
@@ -608,6 +609,14 @@
608
609
  }());
609
610
  IdGenerator.collection = 'ABCDEFGHIJKLMNOPQRSTUVWXTZ0123456789'.split('');
610
611
 
612
+ var MapConstants = /** @class */ (function () {
613
+ function MapConstants() {
614
+ }
615
+ return MapConstants;
616
+ }());
617
+ MapConstants.FeatureInfo = 'f-info';
618
+ MapConstants.DrawingLayerId = '93a981756ec7';
619
+
611
620
  var MarkerModel = /** @class */ (function () {
612
621
  function MarkerModel(lat, lng, id, info) {
613
622
  this.lat = lat;
@@ -627,7 +636,7 @@
627
636
  var feature = new ol.Feature(new geom.Point([this.lng, this.lat]));
628
637
  feature.setId(this.id);
629
638
  if (this.info)
630
- feature.set('info', this.info);
639
+ feature.set(MapConstants.FeatureInfo, this.info);
631
640
  return feature;
632
641
  };
633
642
  return MarkerModel;
@@ -662,25 +671,16 @@
662
671
  return PolygonModel;
663
672
  }());
664
673
 
665
- var GenericMessage = /** @class */ (function () {
666
- function GenericMessage() {
667
- }
668
- return GenericMessage;
669
- }());
670
- var CallbackMessage = /** @class */ (function (_super) {
671
- __extends(CallbackMessage, _super);
672
- function CallbackMessage() {
673
- var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
674
- _this.result$ = new rxjs.Subject();
675
- _this.result = _this.result$.asObservable();
676
- return _this;
677
- }
678
- CallbackMessage.prototype.finish = function (value) {
679
- this.result$.next(value);
680
- this.result$.complete();
681
- };
682
- return CallbackMessage;
683
- }(GenericMessage));
674
+ exports.DrawingType = void 0;
675
+ (function (DrawingType) {
676
+ DrawingType[DrawingType["Polygon"] = 1] = "Polygon";
677
+ })(exports.DrawingType || (exports.DrawingType = {}));
678
+
679
+ exports.FeatureOutputFormat = void 0;
680
+ (function (FeatureOutputFormat) {
681
+ FeatureOutputFormat[FeatureOutputFormat["GeoJson"] = 1] = "GeoJson";
682
+ FeatureOutputFormat[FeatureOutputFormat["WKT"] = 2] = "WKT";
683
+ })(exports.FeatureOutputFormat || (exports.FeatureOutputFormat = {}));
684
684
 
685
685
  var MapRenderedEvent = /** @class */ (function (_super) {
686
686
  __extends(MapRenderedEvent, _super);
@@ -697,15 +697,16 @@
697
697
  configurable: true
698
698
  });
699
699
  return MapRenderedEvent;
700
- }(GenericMessage));
700
+ }(postboy.PostboyGenericMessage));
701
701
  MapRenderedEvent.ID = 'b6121807-3b89-4cd3-82cf-089d2cefdc4f';
702
702
 
703
703
  var MapClickEvent = /** @class */ (function (_super) {
704
704
  __extends(MapClickEvent, _super);
705
- function MapClickEvent(coordinates, entities) {
705
+ function MapClickEvent(coordinates, entities, features) {
706
706
  var _this = _super.call(this) || this;
707
707
  _this.coordinates = coordinates;
708
708
  _this.entities = entities;
709
+ _this.features = features;
709
710
  return _this;
710
711
  }
711
712
  Object.defineProperty(MapClickEvent.prototype, "id", {
@@ -716,9 +717,28 @@
716
717
  configurable: true
717
718
  });
718
719
  return MapClickEvent;
719
- }(GenericMessage));
720
+ }(postboy.PostboyGenericMessage));
720
721
  MapClickEvent.ID = '323df526-8d9c-49c6-83e8-6e9a1e7762f7';
721
722
 
723
+ var MapMoveEndEvent = /** @class */ (function (_super) {
724
+ __extends(MapMoveEndEvent, _super);
725
+ function MapMoveEndEvent(zoom, extent) {
726
+ var _this = _super.call(this) || this;
727
+ _this.zoom = zoom;
728
+ _this.extent = extent;
729
+ return _this;
730
+ }
731
+ Object.defineProperty(MapMoveEndEvent.prototype, "id", {
732
+ get: function () {
733
+ return MapMoveEndEvent.ID;
734
+ },
735
+ enumerable: false,
736
+ configurable: true
737
+ });
738
+ return MapMoveEndEvent;
739
+ }(postboy.PostboyGenericMessage));
740
+ MapMoveEndEvent.ID = 'f21f783e-b5af-4489-9fec-8027fd07a8ad';
741
+
722
742
  var CloseTooltipCommand = /** @class */ (function (_super) {
723
743
  __extends(CloseTooltipCommand, _super);
724
744
  function CloseTooltipCommand(tooltipId) {
@@ -734,9 +754,46 @@
734
754
  configurable: true
735
755
  });
736
756
  return CloseTooltipCommand;
737
- }(GenericMessage));
757
+ }(postboy.PostboyGenericMessage));
738
758
  CloseTooltipCommand.ID = '4896d52c-e34f-4994-bcfd-32832d12dbe4';
739
759
 
760
+ var StartDrawingCommand = /** @class */ (function (_super) {
761
+ __extends(StartDrawingCommand, _super);
762
+ function StartDrawingCommand(type, style, format) {
763
+ if (format === void 0) { format = exports.FeatureOutputFormat.GeoJson; }
764
+ var _this = _super.call(this) || this;
765
+ _this.type = type;
766
+ _this.style = style;
767
+ _this.format = format;
768
+ return _this;
769
+ }
770
+ Object.defineProperty(StartDrawingCommand.prototype, "id", {
771
+ get: function () {
772
+ return StartDrawingCommand.ID;
773
+ },
774
+ enumerable: false,
775
+ configurable: true
776
+ });
777
+ return StartDrawingCommand;
778
+ }(postboy.PostboyCallbackMessage));
779
+ StartDrawingCommand.ID = 'da904f4b-a1c8-4db7-a6af-14d9ee18ec8c';
780
+
781
+ var CancelDrawingCommand = /** @class */ (function (_super) {
782
+ __extends(CancelDrawingCommand, _super);
783
+ function CancelDrawingCommand() {
784
+ return _super !== null && _super.apply(this, arguments) || this;
785
+ }
786
+ Object.defineProperty(CancelDrawingCommand.prototype, "id", {
787
+ get: function () {
788
+ return CancelDrawingCommand.ID;
789
+ },
790
+ enumerable: false,
791
+ configurable: true
792
+ });
793
+ return CancelDrawingCommand;
794
+ }(postboy.PostboyGenericMessage));
795
+ CancelDrawingCommand.ID = '7d38d983-feba-4176-a66b-18175e5ecd6b';
796
+
740
797
  var AddLayerCommand = /** @class */ (function (_super) {
741
798
  __extends(AddLayerCommand, _super);
742
799
  function AddLayerCommand(layer) {
@@ -752,7 +809,7 @@
752
809
  configurable: true
753
810
  });
754
811
  return AddLayerCommand;
755
- }(GenericMessage));
812
+ }(postboy.PostboyGenericMessage));
756
813
  AddLayerCommand.ID = 'd93e250f-92bc-43ac-9c6a-46c521a1aaa5';
757
814
 
758
815
  var PlaceLayerFeaturesCommand = /** @class */ (function (_super) {
@@ -771,7 +828,7 @@
771
828
  configurable: true
772
829
  });
773
830
  return PlaceLayerFeaturesCommand;
774
- }(GenericMessage));
831
+ }(postboy.PostboyGenericMessage));
775
832
  PlaceLayerFeaturesCommand.ID = '8caf86bc-869b-426f-b36d-4642f6b8aab0';
776
833
 
777
834
  var RemoveLayerCommand = /** @class */ (function (_super) {
@@ -789,7 +846,7 @@
789
846
  configurable: true
790
847
  });
791
848
  return RemoveLayerCommand;
792
- }(GenericMessage));
849
+ }(postboy.PostboyGenericMessage));
793
850
  RemoveLayerCommand.ID = 'ab484e0e-e185-45cd-8434-12101f3c7eb1';
794
851
 
795
852
  var AddTileCommand = /** @class */ (function (_super) {
@@ -807,7 +864,7 @@
807
864
  configurable: true
808
865
  });
809
866
  return AddTileCommand;
810
- }(GenericMessage));
867
+ }(postboy.PostboyGenericMessage));
811
868
  AddTileCommand.ID = '25b7df28-72ce-4453-9fe6-54285a2fdc57';
812
869
 
813
870
  var RemoveTileCommand = /** @class */ (function (_super) {
@@ -825,23 +882,77 @@
825
882
  configurable: true
826
883
  });
827
884
  return RemoveTileCommand;
828
- }(GenericMessage));
885
+ }(postboy.PostboyGenericMessage));
829
886
  RemoveTileCommand.ID = 'c36ccc0b-5638-4819-b148-2de57a59a5b7';
830
887
 
888
+ var FitToFeaturesCommand = /** @class */ (function (_super) {
889
+ __extends(FitToFeaturesCommand, _super);
890
+ function FitToFeaturesCommand(features, zoomAfter) {
891
+ if (zoomAfter === void 0) { zoomAfter = 0; }
892
+ var _this = _super.call(this) || this;
893
+ _this.features = features;
894
+ _this.zoomAfter = zoomAfter;
895
+ return _this;
896
+ }
897
+ Object.defineProperty(FitToFeaturesCommand.prototype, "id", {
898
+ get: function () {
899
+ return FitToFeaturesCommand.ID;
900
+ },
901
+ enumerable: false,
902
+ configurable: true
903
+ });
904
+ return FitToFeaturesCommand;
905
+ }(postboy.PostboyGenericMessage));
906
+ FitToFeaturesCommand.ID = '76cdc091-3793-4b6c-82f7-1e0334cf08a8';
907
+
908
+ var GetLayerQuery = /** @class */ (function (_super) {
909
+ __extends(GetLayerQuery, _super);
910
+ function GetLayerQuery(name) {
911
+ var _this = _super.call(this) || this;
912
+ _this.name = name;
913
+ return _this;
914
+ }
915
+ Object.defineProperty(GetLayerQuery.prototype, "id", {
916
+ get: function () {
917
+ return GetLayerQuery.ID;
918
+ },
919
+ enumerable: false,
920
+ configurable: true
921
+ });
922
+ return GetLayerQuery;
923
+ }(postboy.PostboyCallbackMessage));
924
+ GetLayerQuery.ID = '5c04c87b-8a93-4c2a-979e-d1e313d860ed';
925
+
926
+ var DrawingFinishedEvent = /** @class */ (function (_super) {
927
+ __extends(DrawingFinishedEvent, _super);
928
+ function DrawingFinishedEvent() {
929
+ return _super.call(this) || this;
930
+ }
931
+ Object.defineProperty(DrawingFinishedEvent.prototype, "id", {
932
+ get: function () {
933
+ return DrawingFinishedEvent.ID;
934
+ },
935
+ enumerable: false,
936
+ configurable: true
937
+ });
938
+ return DrawingFinishedEvent;
939
+ }(postboy.PostboyGenericMessage));
940
+ DrawingFinishedEvent.ID = 'c724b68e-b4eb-4783-90f1-a8e31973fd36';
941
+
831
942
  var MapPostboyService = /** @class */ (function (_super) {
832
943
  __extends(MapPostboyService, _super);
833
944
  function MapPostboyService() {
834
- var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
835
- _this.observe = function (id) { return _this.subscribe(id); };
945
+ var _this = _super.call(this) || this;
946
+ _this.addLocker({ locker: StartDrawingCommand.ID, unlocker: DrawingFinishedEvent.ID, locking: [MapClickEvent.ID] });
836
947
  return _this;
837
948
  }
838
949
  return MapPostboyService;
839
950
  }(postboy.PostboyService));
840
- MapPostboyService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapPostboyService, deps: null, target: i0__namespace.ɵɵFactoryTarget.Injectable });
951
+ MapPostboyService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapPostboyService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
841
952
  MapPostboyService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapPostboyService });
842
953
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapPostboyService, decorators: [{
843
954
  type: i0.Injectable
844
- }] });
955
+ }], ctorParameters: function () { return []; } });
845
956
 
846
957
  var MapManagementService = /** @class */ (function () {
847
958
  function MapManagementService(postboy) {
@@ -855,6 +966,7 @@
855
966
  this.observePlaceFeatures();
856
967
  this.observeAddTile();
857
968
  this.observeRemoveTile();
969
+ this.observeLayerQuery();
858
970
  };
859
971
  MapManagementService.prototype.observeRemoveTile = function () {
860
972
  var _this = this;
@@ -864,6 +976,10 @@
864
976
  _this.map.removeLayer(c.layer);
865
977
  });
866
978
  };
979
+ MapManagementService.prototype.observeLayerQuery = function () {
980
+ var _this = this;
981
+ this.postboy.subscribe(GetLayerQuery.ID).subscribe(function (ev) { var _a; return ev.finish((_a = _this.layers[ev.name]) !== null && _a !== void 0 ? _a : null); });
982
+ };
867
983
  MapManagementService.prototype.observeAddTile = function () {
868
984
  var _this = this;
869
985
  this.postboy.subscribe(AddTileCommand.ID).subscribe(function (c) {
@@ -890,11 +1006,14 @@
890
1006
  MapManagementService.prototype.observePlaceFeatures = function () {
891
1007
  var _this = this;
892
1008
  this.postboy.subscribe(PlaceLayerFeaturesCommand.ID).subscribe(function (c) {
893
- var _a, _b, _c;
1009
+ var _a, _b;
894
1010
  if (!_this.layers[c.layer])
895
1011
  return;
896
- (_b = (_a = _this.layers[c.layer]) === null || _a === void 0 ? void 0 : _a.getSource()) === null || _b === void 0 ? void 0 : _b.clear();
897
- (_c = _this.layers[c.layer].getSource()) === null || _c === void 0 ? void 0 : _c.addFeatures(c.features);
1012
+ var source = (_a = _this.layers[c.layer]) === null || _a === void 0 ? void 0 : _a.getSource();
1013
+ if (!!source['getSource'])
1014
+ source = (_b = source) === null || _b === void 0 ? void 0 : _b.getSource();
1015
+ source === null || source === void 0 ? void 0 : source.clear();
1016
+ source === null || source === void 0 ? void 0 : source.addFeatures(c.features);
898
1017
  });
899
1018
  };
900
1019
  MapManagementService.prototype.observeRemoveLayer = function () {
@@ -920,7 +1039,16 @@
920
1039
  }
921
1040
  MapStateService.prototype.up = function () {
922
1041
  var _this = this;
923
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe(function (m) { return (_this.map = m); });
1042
+ this.postboy.subscribe(MapRenderedEvent.ID).subscribe(function (ev) {
1043
+ var _a;
1044
+ _this.map = ev.map;
1045
+ (_a = _this.map) === null || _a === void 0 ? void 0 : _a.on('moveend', function () {
1046
+ var _a, _b;
1047
+ var zoom = Math.floor(((_a = _this.map) === null || _a === void 0 ? void 0 : _a.getView().getZoom()) || -1);
1048
+ var extent = ((_b = _this.map) === null || _b === void 0 ? void 0 : _b.getView().calculateExtent()) || [];
1049
+ _this.postboy.fire(new MapMoveEndEvent(zoom, extent));
1050
+ });
1051
+ });
924
1052
  };
925
1053
  return MapStateService;
926
1054
  }());
@@ -930,6 +1058,42 @@
930
1058
  type: i0.Injectable
931
1059
  }], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
932
1060
 
1061
+ var MapFeatureService = /** @class */ (function () {
1062
+ function MapFeatureService(postboy) {
1063
+ this.postboy = postboy;
1064
+ }
1065
+ MapFeatureService.prototype.up = function () {
1066
+ this.observeMapRender();
1067
+ this.observeFitToFeatures();
1068
+ };
1069
+ MapFeatureService.prototype.observeMapRender = function () {
1070
+ var _this = this;
1071
+ this.postboy.subscribe(MapRenderedEvent.ID).subscribe(function (m) {
1072
+ _this.map = m.map;
1073
+ });
1074
+ };
1075
+ MapFeatureService.prototype.observeFitToFeatures = function () {
1076
+ var _this = this;
1077
+ this.postboy.subscribe(FitToFeaturesCommand.ID).subscribe(function (m) {
1078
+ _this.fitToGeometries(m.features.map(function (f) { return f.getGeometry(); }), m.zoomAfter);
1079
+ });
1080
+ };
1081
+ MapFeatureService.prototype.fitToGeometries = function (geometries, zoomAfter) {
1082
+ if (!(geometries === null || geometries === void 0 ? void 0 : geometries.length) || !this.map)
1083
+ return;
1084
+ var extent$1 = extent.createEmpty();
1085
+ geometries.forEach(function (g) { return extent.extend(extent$1, g.getExtent()); });
1086
+ this.map.getView().fit(extent$1);
1087
+ this.map.getView().setZoom(this.map.getView().getZoom() + zoomAfter);
1088
+ };
1089
+ return MapFeatureService;
1090
+ }());
1091
+ MapFeatureService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapFeatureService, deps: [{ token: MapPostboyService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1092
+ MapFeatureService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapFeatureService });
1093
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapFeatureService, decorators: [{
1094
+ type: i0.Injectable
1095
+ }], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
1096
+
933
1097
  var MapClickService = /** @class */ (function () {
934
1098
  function MapClickService(postboy) {
935
1099
  this.postboy = postboy;
@@ -950,7 +1114,7 @@
950
1114
  MapClickService.prototype.onClick = function (ev) {
951
1115
  var _this = this;
952
1116
  var _a;
953
- var model = new MapClickEvent(ev.coordinate, {});
1117
+ var model = new MapClickEvent(ev.coordinate, {}, {});
954
1118
  (_a = this.map) === null || _a === void 0 ? void 0 : _a.forEachFeatureAtPixel(ev.pixel, function (f, l) {
955
1119
  _this.getFeatureCollectionWithInner([f])
956
1120
  .filter(function (f) { return f.getId() != null; })
@@ -958,7 +1122,10 @@
958
1122
  var layerName = l.get('name');
959
1123
  if (!model.entities[layerName])
960
1124
  model.entities[layerName] = [];
961
- model.entities[layerName].push(f.getId());
1125
+ if (!model.features[layerName])
1126
+ model.features[layerName] = [];
1127
+ model.entities[layerName].push(Object.assign({ id: fs.getId() }, fs.get(MapConstants.FeatureInfo)));
1128
+ model.features[layerName].push(fs);
962
1129
  });
963
1130
  });
964
1131
  return model;
@@ -979,11 +1146,82 @@
979
1146
  type: i0.Injectable
980
1147
  }], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
981
1148
 
1149
+ var DrawingService = /** @class */ (function () {
1150
+ function DrawingService(postboy) {
1151
+ this.postboy = postboy;
1152
+ }
1153
+ DrawingService.prototype.up = function () {
1154
+ var _this = this;
1155
+ this.postboy.subscribe(StartDrawingCommand.ID).subscribe(function (ev) {
1156
+ _this.draw(function (l) {
1157
+ if (!l || !_this.map) {
1158
+ _this.clearInteraction(l);
1159
+ return;
1160
+ }
1161
+ var cancelSub = _this.observeCancelation(ev, l);
1162
+ _this.drawInteraction = new interaction.Draw({
1163
+ source: l.getSource(),
1164
+ type: exports.DrawingType[ev.type],
1165
+ style: ev.style,
1166
+ });
1167
+ _this.map.addInteraction(_this.drawInteraction);
1168
+ _this.drawInteraction.on('drawend', function (evt) {
1169
+ cancelSub.unsubscribe();
1170
+ _this.onEnd(evt, ev, l);
1171
+ });
1172
+ });
1173
+ });
1174
+ this.observeMapRender();
1175
+ };
1176
+ DrawingService.prototype.onEnd = function (evt, command, layer) {
1177
+ command.finish(command.format === exports.FeatureOutputFormat.GeoJson
1178
+ ? new format.GeoJSON().writeFeature(evt.feature)
1179
+ : new format.WKT().writeFeature(evt.feature));
1180
+ this.clearInteraction(layer);
1181
+ };
1182
+ DrawingService.prototype.observeMapRender = function () {
1183
+ var _this = this;
1184
+ this.postboy.subscribe(MapRenderedEvent.ID).subscribe(function (m) {
1185
+ _this.map = m.map;
1186
+ });
1187
+ };
1188
+ DrawingService.prototype.draw = function (action) {
1189
+ var query = new GetLayerQuery(MapConstants.DrawingLayerId);
1190
+ query.result.subscribe(function (l) { return action(l); });
1191
+ this.postboy.fire(query);
1192
+ };
1193
+ DrawingService.prototype.observeCancelation = function (ev, layer) {
1194
+ var _this = this;
1195
+ return this.postboy
1196
+ .subscribe(CancelDrawingCommand.ID)
1197
+ .pipe(operators.first())
1198
+ .subscribe(function () {
1199
+ ev.finish(null);
1200
+ _this.clearInteraction(layer);
1201
+ });
1202
+ };
1203
+ DrawingService.prototype.clearInteraction = function (layer) {
1204
+ var _this = this;
1205
+ var _a;
1206
+ if (!!this.drawInteraction) {
1207
+ (_a = this.map) === null || _a === void 0 ? void 0 : _a.removeInteraction(this.drawInteraction);
1208
+ layer === null || layer === void 0 ? void 0 : layer.setSource(new source.Vector({}));
1209
+ }
1210
+ setTimeout(function () { return _this.postboy.fire(new DrawingFinishedEvent()); }, 300);
1211
+ };
1212
+ return DrawingService;
1213
+ }());
1214
+ DrawingService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: DrawingService, deps: [{ token: MapPostboyService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1215
+ DrawingService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: DrawingService });
1216
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: DrawingService, decorators: [{
1217
+ type: i0.Injectable
1218
+ }], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
1219
+
982
1220
  var MessageRegistratorService = /** @class */ (function (_super) {
983
1221
  __extends(MessageRegistratorService, _super);
984
- function MessageRegistratorService(service, management, state, interaction) {
1222
+ function MessageRegistratorService(service, management, state, feature, interaction, drawing) {
985
1223
  var _this = _super.call(this, service) || this;
986
- _this.registerServices([management, state, interaction]);
1224
+ _this.registerServices([management, state, interaction, feature, drawing]);
987
1225
  return _this;
988
1226
  }
989
1227
  MessageRegistratorService.prototype._up = function () {
@@ -995,70 +1233,199 @@
995
1233
  this.registerSubject(RemoveTileCommand.ID);
996
1234
  this.registerSubject(MapClickEvent.ID);
997
1235
  this.registerSubject(CloseTooltipCommand.ID);
1236
+ this.registerSubject(FitToFeaturesCommand.ID);
1237
+ this.registerSubject(MapMoveEndEvent.ID);
1238
+ this.registerSubject(CancelDrawingCommand.ID);
1239
+ this.registerSubject(StartDrawingCommand.ID);
1240
+ this.registerSubject(GetLayerQuery.ID);
1241
+ this.registerSubject(DrawingFinishedEvent.ID);
998
1242
  };
999
1243
  return MessageRegistratorService;
1000
1244
  }(postboy.PostboyAbstractRegistrator));
1001
- MessageRegistratorService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MessageRegistratorService, deps: [{ token: MapPostboyService }, { token: MapManagementService }, { token: MapStateService }, { token: MapClickService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1245
+ MessageRegistratorService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MessageRegistratorService, deps: [{ token: MapPostboyService }, { token: MapManagementService }, { token: MapStateService }, { token: MapFeatureService }, { token: MapClickService }, { token: DrawingService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1002
1246
  MessageRegistratorService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MessageRegistratorService });
1003
1247
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MessageRegistratorService, decorators: [{
1004
1248
  type: i0.Injectable
1005
- }], ctorParameters: function () { return [{ type: MapPostboyService }, { type: MapManagementService }, { type: MapStateService }, { type: MapClickService }]; } });
1249
+ }], ctorParameters: function () { return [{ type: MapPostboyService }, { type: MapManagementService }, { type: MapStateService }, { type: MapFeatureService }, { type: MapClickService }, { type: DrawingService }]; } });
1006
1250
 
1007
- var MapPlateFactory = /** @class */ (function () {
1008
- function MapPlateFactory() {
1251
+ var TileLayerSettings = /** @class */ (function () {
1252
+ function TileLayerSettings() {
1253
+ this.maxZoom = 19;
1254
+ this.minZoom = 0;
1255
+ this.opacity = 0.6;
1256
+ this.url = '';
1257
+ this.projection = 'EPSG:3857';
1009
1258
  }
1010
- MapPlateFactory.prototype.build = function (settings) {
1011
- return new Map__default["default"]({
1012
- controls: [],
1013
- view: new View__default["default"]({
1014
- center: (settings === null || settings === void 0 ? void 0 : settings.center) || [0, 0],
1015
- zoom: (settings === null || settings === void 0 ? void 0 : settings.zoom) || 4,
1016
- minZoom: (settings === null || settings === void 0 ? void 0 : settings.minZoom) || 0,
1017
- maxZoom: (settings === null || settings === void 0 ? void 0 : settings.maxZoom) || 19,
1018
- }),
1019
- layers: [],
1259
+ TileLayerSettings.copy = function (model) {
1260
+ var result = new TileLayerSettings();
1261
+ result.maxZoom = model.maxZoom;
1262
+ result.minZoom = model.minZoom;
1263
+ result.projection = model.projection;
1264
+ result.opacity = model.opacity;
1265
+ result.url = model.url;
1266
+ return result;
1267
+ };
1268
+ TileLayerSettings.prototype.setUrl = function (url) {
1269
+ return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { url: url }));
1270
+ };
1271
+ TileLayerSettings.prototype.setMaxZoom = function (maxZoom) {
1272
+ return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { maxZoom: maxZoom }));
1273
+ };
1274
+ TileLayerSettings.prototype.setMinZoom = function (minZoom) {
1275
+ return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { minZoom: minZoom }));
1276
+ };
1277
+ TileLayerSettings.prototype.setOpacity = function (opacity) {
1278
+ return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { opacity: opacity }));
1279
+ };
1280
+ TileLayerSettings.prototype.setProjection = function (projection) {
1281
+ return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { projection: projection }));
1282
+ };
1283
+ TileLayerSettings.prototype.isSame = function (model) {
1284
+ if (this.maxZoom !== model.maxZoom)
1285
+ return false;
1286
+ if (this.minZoom !== model.minZoom)
1287
+ return false;
1288
+ if (this.url !== model.url)
1289
+ return false;
1290
+ if (this.projection !== model.projection)
1291
+ return false;
1292
+ if (this.opacity !== model.opacity)
1293
+ return false;
1294
+ return true;
1295
+ };
1296
+ return TileLayerSettings;
1297
+ }());
1298
+
1299
+ var TileLayerFactory = /** @class */ (function () {
1300
+ function TileLayerFactory() {
1301
+ }
1302
+ TileLayerFactory.prototype.build = function (settings) {
1303
+ var source$1 = new source.XYZ({
1304
+ tileSize: 256,
1305
+ maxZoom: settings.maxZoom || 14,
1306
+ minZoom: settings.minZoom || 1,
1307
+ projection: proj.get(settings.projection),
1308
+ tileUrlFunction: this.getTileFunc(settings),
1309
+ crossOrigin: 'Anonymous',
1020
1310
  });
1311
+ return new TileLayer__default["default"]({ source: source$1, opacity: settings.opacity });
1021
1312
  };
1022
- return MapPlateFactory;
1313
+ TileLayerFactory.prototype.getTileFunc = function (settings) {
1314
+ var _this = this;
1315
+ return function (tileCoord) {
1316
+ var zoom = tileCoord[0];
1317
+ var x = tileCoord[1];
1318
+ var y = tileCoord[2];
1319
+ var normalizedCoord = _this.getNormalizedCoord({ x: x, y: y }, zoom);
1320
+ var bound = 1 << zoom;
1321
+ return settings.url
1322
+ .replace('{x}', String((normalizedCoord === null || normalizedCoord === void 0 ? void 0 : normalizedCoord.x) || x))
1323
+ .replace('{z}', String(zoom))
1324
+ .replace('{y}', String(bound - ((normalizedCoord === null || normalizedCoord === void 0 ? void 0 : normalizedCoord.y) || y) - 1));
1325
+ };
1326
+ };
1327
+ TileLayerFactory.prototype.getNormalizedCoord = function (coord, zoom) {
1328
+ var y = coord.y;
1329
+ var x = coord.x;
1330
+ var tileRange = 1 << zoom;
1331
+ if (y < 0 || y >= tileRange)
1332
+ return null;
1333
+ if (x < 0 || x >= tileRange)
1334
+ x = ((x % tileRange) + tileRange) % tileRange;
1335
+ return { x: x, y: y };
1336
+ };
1337
+ return TileLayerFactory;
1023
1338
  }());
1024
- MapPlateFactory.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapPlateFactory, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1025
- MapPlateFactory.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapPlateFactory, providedIn: 'root' });
1026
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapPlateFactory, decorators: [{
1339
+ TileLayerFactory.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TileLayerFactory, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1340
+ TileLayerFactory.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TileLayerFactory, providedIn: 'root' });
1341
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TileLayerFactory, decorators: [{
1027
1342
  type: i0.Injectable,
1028
1343
  args: [{
1029
1344
  providedIn: 'root',
1030
1345
  }]
1031
1346
  }] });
1032
1347
 
1033
- var OsmTileLayerComponent = /** @class */ (function (_super) {
1034
- __extends(OsmTileLayerComponent, _super);
1035
- function OsmTileLayerComponent() {
1348
+ var TileLayerComponent = /** @class */ (function (_super) {
1349
+ __extends(TileLayerComponent, _super);
1350
+ function TileLayerComponent(postboy, factory) {
1036
1351
  var _this = _super.call(this) || this;
1037
- _this._url = '';
1352
+ _this.postboy = postboy;
1353
+ _this.factory = factory;
1354
+ _this._settings = new TileLayerSettings();
1355
+ _this.onDestroy = function () { return _this.removeLayer(); };
1038
1356
  return _this;
1039
1357
  }
1040
- Object.defineProperty(OsmTileLayerComponent.prototype, "url", {
1041
- set: function (value) {
1042
- if (!value || this._url === value)
1043
- return;
1044
- this._url = value;
1045
- this.initLayer();
1046
- },
1047
- enumerable: false,
1048
- configurable: true
1049
- });
1050
- Object.defineProperty(OsmTileLayerComponent.prototype, "map", {
1358
+ TileLayerComponent.prototype.ngOnInit = function () {
1359
+ var _this = this;
1360
+ this.postboy
1361
+ .subscribe(MapRenderedEvent.ID)
1362
+ .pipe(operators.filter(function (m) { return !!m; }), operators.first())
1363
+ .subscribe(function (m) { return _this.initLayer(); });
1364
+ };
1365
+ Object.defineProperty(TileLayerComponent.prototype, "settings", {
1051
1366
  set: function (value) {
1052
- if (!value || this._map === value)
1367
+ if (!value || this._settings.isSame(value))
1053
1368
  return;
1054
- this._map = value;
1369
+ this._settings = value;
1055
1370
  this.initLayer();
1056
1371
  },
1057
1372
  enumerable: false,
1058
1373
  configurable: true
1059
1374
  });
1060
- OsmTileLayerComponent.prototype.ngOnInit = function () { };
1061
- OsmTileLayerComponent.prototype.ngOnDestroy = function () {
1375
+ TileLayerComponent.prototype.initLayer = function () {
1376
+ this.removeLayer();
1377
+ this.layer = this.factory.build(this._settings);
1378
+ this.postboy.fire(new AddTileCommand(this.layer));
1379
+ };
1380
+ TileLayerComponent.prototype.removeLayer = function () {
1381
+ if (this.layer)
1382
+ this.postboy.fire(new RemoveTileCommand(this.layer));
1383
+ };
1384
+ return TileLayerComponent;
1385
+ }(DestructibleComponent));
1386
+ TileLayerComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TileLayerComponent, deps: [{ token: MapPostboyService }, { token: TileLayerFactory }], target: i0__namespace.ɵɵFactoryTarget.Component });
1387
+ TileLayerComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TileLayerComponent, selector: "lib-tile-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0__namespace, template: '', isInline: true, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1388
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TileLayerComponent, decorators: [{
1389
+ type: i0.Component,
1390
+ args: [{
1391
+ selector: 'lib-tile-layer',
1392
+ template: '',
1393
+ styleUrls: [],
1394
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
1395
+ }]
1396
+ }], ctorParameters: function () { return [{ type: MapPostboyService }, { type: TileLayerFactory }]; }, propDecorators: { settings: [{
1397
+ type: i0.Input
1398
+ }] } });
1399
+
1400
+ var OsmTileLayerComponent = /** @class */ (function (_super) {
1401
+ __extends(OsmTileLayerComponent, _super);
1402
+ function OsmTileLayerComponent() {
1403
+ var _this = _super.call(this) || this;
1404
+ _this._url = '';
1405
+ return _this;
1406
+ }
1407
+ Object.defineProperty(OsmTileLayerComponent.prototype, "url", {
1408
+ set: function (value) {
1409
+ if (!value || this._url === value)
1410
+ return;
1411
+ this._url = value;
1412
+ this.initLayer();
1413
+ },
1414
+ enumerable: false,
1415
+ configurable: true
1416
+ });
1417
+ Object.defineProperty(OsmTileLayerComponent.prototype, "map", {
1418
+ set: function (value) {
1419
+ if (!value || this._map === value)
1420
+ return;
1421
+ this._map = value;
1422
+ this.initLayer();
1423
+ },
1424
+ enumerable: false,
1425
+ configurable: true
1426
+ });
1427
+ OsmTileLayerComponent.prototype.ngOnInit = function () { };
1428
+ OsmTileLayerComponent.prototype.ngOnDestroy = function () {
1062
1429
  var _a, _b;
1063
1430
  if (this.layer) {
1064
1431
  (_a = this._map) === null || _a === void 0 ? void 0 : _a.removeLayer(this.layer);
@@ -1097,184 +1464,99 @@
1097
1464
  type: i0.Input
1098
1465
  }] } });
1099
1466
 
1100
- var MapPlateComponent = /** @class */ (function (_super) {
1101
- __extends(MapPlateComponent, _super);
1102
- function MapPlateComponent(elementRef, postboy, mapFactory, registrator, detector) {
1103
- var _this = _super.call(this) || this;
1104
- _this.elementRef = elementRef;
1105
- _this.postboy = postboy;
1106
- _this.mapFactory = mapFactory;
1107
- _this.registrator = registrator;
1108
- _this.detector = detector;
1109
- _this.osmUrl = '';
1110
- _this._settings = new MapSettings();
1111
- _this.onDestroy = function () {
1112
- _this.registrator.down();
1113
- };
1114
- registrator.up();
1115
- return _this;
1116
- }
1117
- Object.defineProperty(MapPlateComponent.prototype, "settings", {
1118
- set: function (value) {
1119
- if (!value || this._settings.isSame(value))
1120
- return;
1121
- this._settings = value;
1122
- this.setOsm();
1123
- },
1124
- enumerable: false,
1125
- configurable: true
1126
- });
1127
- MapPlateComponent.prototype.ngOnInit = function () {
1128
- var _this = this;
1129
- proj.useGeographic();
1130
- this.map = this.mapFactory.build(this._settings);
1131
- this.map.setTarget(this.elementRef.nativeElement);
1132
- this.detector.detectChanges();
1133
- this.map.once('postrender', function () {
1134
- _this.map.updateSize();
1135
- _this.postboy.fire(new MapRenderedEvent(_this.map));
1136
- });
1137
- this.setOsm();
1138
- };
1139
- MapPlateComponent.prototype.setOsm = function () {
1140
- if (!this.map)
1141
- return;
1142
- 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}";
1143
- this.detector.detectChanges();
1144
- this.map.updateSize();
1145
- };
1146
- return MapPlateComponent;
1147
- }(DestructibleComponent));
1148
- MapPlateComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapPlateComponent, deps: [{ token: i0__namespace.ElementRef }, { token: MapPostboyService }, { token: MapPlateFactory }, { token: MessageRegistratorService }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
1149
- MapPlateComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: MapPlateComponent, selector: "lib-map-plate", inputs: { settings: "settings" }, providers: [MessageRegistratorService, MapStateService, MapManagementService, MapClickService], usesInheritance: true, ngImport: i0__namespace, template: "<ng-content></ng-content>\n<lib-osm-tile-layer *ngIf=\"osmUrl && map\" [map]=\"map\" [url]=\"osmUrl\"></lib-osm-tile-layer>\n", styles: ["lib-map-plate{position:relative;display:flex;flex-direction:column;height:100%}\n"], components: [{ type: OsmTileLayerComponent, selector: "lib-osm-tile-layer", inputs: ["url", "map"] }], directives: [{ type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1150
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapPlateComponent, decorators: [{
1151
- type: i0.Component,
1152
- args: [{
1153
- selector: 'lib-map-plate',
1154
- templateUrl: './map-plate.component.html',
1155
- styleUrls: ['./map-plate.component.scss'],
1156
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
1157
- providers: [MessageRegistratorService, MapStateService, MapManagementService, MapClickService],
1158
- }]
1159
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: MapPostboyService }, { type: MapPlateFactory }, { type: MessageRegistratorService }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { settings: [{
1160
- type: i0.Input
1161
- }] } });
1162
-
1163
- var TileLayerSettings = /** @class */ (function () {
1164
- function TileLayerSettings() {
1467
+ var FeatureLayerSettings = /** @class */ (function () {
1468
+ function FeatureLayerSettings() {
1469
+ this.name = IdGenerator.get();
1470
+ this.zIndex = 1;
1165
1471
  this.maxZoom = 19;
1166
1472
  this.minZoom = 0;
1167
- this.opacity = 0.6;
1168
- this.url = '';
1169
- this.projection = 'EPSG:3857';
1170
1473
  }
1171
- TileLayerSettings.copy = function (model) {
1172
- var result = new TileLayerSettings();
1474
+ FeatureLayerSettings.copy = function (model) {
1475
+ var result = new FeatureLayerSettings();
1476
+ result.name = model.name;
1173
1477
  result.maxZoom = model.maxZoom;
1174
1478
  result.minZoom = model.minZoom;
1175
- result.projection = model.projection;
1176
- result.opacity = model.opacity;
1177
- result.url = model.url;
1479
+ result.zIndex = model.zIndex;
1480
+ result.style = model.style;
1178
1481
  return result;
1179
1482
  };
1180
- TileLayerSettings.prototype.setUrl = function (url) {
1181
- return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { url: url }));
1483
+ FeatureLayerSettings.prototype.setZIndex = function (zIndex) {
1484
+ return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { zIndex: zIndex }));
1182
1485
  };
1183
- TileLayerSettings.prototype.setMaxZoom = function (maxZoom) {
1184
- return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { maxZoom: maxZoom }));
1486
+ FeatureLayerSettings.prototype.setName = function (name) {
1487
+ return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { name: name }));
1185
1488
  };
1186
- TileLayerSettings.prototype.setMinZoom = function (minZoom) {
1187
- return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { minZoom: minZoom }));
1489
+ FeatureLayerSettings.prototype.setMaxZoom = function (maxZoom) {
1490
+ return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { maxZoom: maxZoom }));
1188
1491
  };
1189
- TileLayerSettings.prototype.setOpacity = function (opacity) {
1190
- return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { opacity: opacity }));
1492
+ FeatureLayerSettings.prototype.setMinZoom = function (minZoom) {
1493
+ return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { minZoom: minZoom }));
1191
1494
  };
1192
- TileLayerSettings.prototype.setProjection = function (projection) {
1193
- return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { projection: projection }));
1495
+ FeatureLayerSettings.prototype.setStyle = function (style) {
1496
+ return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { style: style }));
1194
1497
  };
1195
- TileLayerSettings.prototype.isSame = function (model) {
1498
+ FeatureLayerSettings.prototype.isSame = function (model) {
1196
1499
  if (this.maxZoom !== model.maxZoom)
1197
1500
  return false;
1198
1501
  if (this.minZoom !== model.minZoom)
1199
1502
  return false;
1200
- if (this.url !== model.url)
1503
+ if (this.zIndex !== model.zIndex)
1201
1504
  return false;
1202
- if (this.projection !== model.projection)
1505
+ if (this.name !== model.name)
1203
1506
  return false;
1204
- if (this.opacity !== model.opacity)
1507
+ if (this.style !== model.style)
1205
1508
  return false;
1206
1509
  return true;
1207
1510
  };
1208
- return TileLayerSettings;
1511
+ return FeatureLayerSettings;
1209
1512
  }());
1210
1513
 
1211
- var TileLayerFactory = /** @class */ (function () {
1212
- function TileLayerFactory() {
1514
+ var FeatureLayerFactory = /** @class */ (function () {
1515
+ function FeatureLayerFactory() {
1213
1516
  }
1214
- TileLayerFactory.prototype.build = function (settings) {
1215
- var source$1 = new source.XYZ({
1216
- tileSize: 256,
1217
- maxZoom: settings.maxZoom || 14,
1218
- minZoom: settings.minZoom || 1,
1219
- projection: proj.get(settings.projection),
1220
- tileUrlFunction: this.getTileFunc(settings),
1221
- crossOrigin: 'Anonymous',
1517
+ FeatureLayerFactory.prototype.build = function (settings) {
1518
+ var source$1 = new source.Vector({});
1519
+ var layer$1 = new layer.Vector({
1520
+ source: source$1,
1521
+ maxZoom: settings.maxZoom,
1522
+ minZoom: settings.minZoom,
1523
+ zIndex: settings.zIndex,
1222
1524
  });
1223
- return new TileLayer__default["default"]({ source: source$1, opacity: settings.opacity });
1224
- };
1225
- TileLayerFactory.prototype.getTileFunc = function (settings) {
1226
- var _this = this;
1227
- return function (tileCoord) {
1228
- var zoom = tileCoord[0];
1229
- var x = tileCoord[1];
1230
- var y = tileCoord[2];
1231
- var normalizedCoord = _this.getNormalizedCoord({ x: x, y: y }, zoom);
1232
- var bound = 1 << zoom;
1233
- return settings.url
1234
- .replace('{x}', String((normalizedCoord === null || normalizedCoord === void 0 ? void 0 : normalizedCoord.x) || x))
1235
- .replace('{z}', String(zoom))
1236
- .replace('{y}', String(bound - ((normalizedCoord === null || normalizedCoord === void 0 ? void 0 : normalizedCoord.y) || y) - 1));
1237
- };
1238
- };
1239
- TileLayerFactory.prototype.getNormalizedCoord = function (coord, zoom) {
1240
- var y = coord.y;
1241
- var x = coord.x;
1242
- var tileRange = 1 << zoom;
1243
- if (y < 0 || y >= tileRange)
1244
- return null;
1245
- if (x < 0 || x >= tileRange)
1246
- x = ((x % tileRange) + tileRange) % tileRange;
1247
- return { x: x, y: y };
1525
+ if (settings.style)
1526
+ layer$1.setStyle(settings.style);
1527
+ layer$1.set('name', settings.name);
1528
+ return layer$1;
1248
1529
  };
1249
- return TileLayerFactory;
1530
+ return FeatureLayerFactory;
1250
1531
  }());
1251
- TileLayerFactory.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TileLayerFactory, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1252
- TileLayerFactory.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TileLayerFactory, providedIn: 'root' });
1253
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TileLayerFactory, decorators: [{
1532
+ FeatureLayerFactory.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FeatureLayerFactory, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1533
+ FeatureLayerFactory.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FeatureLayerFactory, providedIn: 'root' });
1534
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FeatureLayerFactory, decorators: [{
1254
1535
  type: i0.Injectable,
1255
1536
  args: [{
1256
1537
  providedIn: 'root',
1257
1538
  }]
1258
1539
  }] });
1259
1540
 
1260
- var TileLayerComponent = /** @class */ (function (_super) {
1261
- __extends(TileLayerComponent, _super);
1262
- function TileLayerComponent(postboy, factory) {
1541
+ var FeatureLayerComponent = /** @class */ (function (_super) {
1542
+ __extends(FeatureLayerComponent, _super);
1543
+ function FeatureLayerComponent(postboy, factory) {
1263
1544
  var _this = _super.call(this) || this;
1264
1545
  _this.postboy = postboy;
1265
1546
  _this.factory = factory;
1266
- _this._settings = new TileLayerSettings();
1547
+ _this.layer = null;
1548
+ _this._settings = new FeatureLayerSettings();
1267
1549
  _this.onDestroy = function () { return _this.removeLayer(); };
1268
1550
  return _this;
1269
1551
  }
1270
- TileLayerComponent.prototype.ngOnInit = function () {
1552
+ FeatureLayerComponent.prototype.ngOnInit = function () {
1271
1553
  var _this = this;
1272
1554
  this.postboy
1273
1555
  .subscribe(MapRenderedEvent.ID)
1274
1556
  .pipe(operators.filter(function (m) { return !!m; }), operators.first())
1275
1557
  .subscribe(function (m) { return _this.initLayer(); });
1276
1558
  };
1277
- Object.defineProperty(TileLayerComponent.prototype, "settings", {
1559
+ Object.defineProperty(FeatureLayerComponent.prototype, "settings", {
1278
1560
  set: function (value) {
1279
1561
  if (!value || this._settings.isSame(value))
1280
1562
  return;
@@ -1284,63 +1566,78 @@
1284
1566
  enumerable: false,
1285
1567
  configurable: true
1286
1568
  });
1287
- TileLayerComponent.prototype.initLayer = function () {
1569
+ FeatureLayerComponent.prototype.initLayer = function () {
1288
1570
  this.removeLayer();
1289
1571
  this.layer = this.factory.build(this._settings);
1290
- this.postboy.fire(new AddTileCommand(this.layer));
1572
+ this.postboy.fire(new AddLayerCommand(this.layer));
1291
1573
  };
1292
- TileLayerComponent.prototype.removeLayer = function () {
1574
+ FeatureLayerComponent.prototype.removeLayer = function () {
1293
1575
  if (this.layer)
1294
- this.postboy.fire(new RemoveTileCommand(this.layer));
1576
+ this.postboy.fire(new RemoveLayerCommand(this.layer));
1295
1577
  };
1296
- return TileLayerComponent;
1578
+ return FeatureLayerComponent;
1297
1579
  }(DestructibleComponent));
1298
- TileLayerComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TileLayerComponent, deps: [{ token: MapPostboyService }, { token: TileLayerFactory }], target: i0__namespace.ɵɵFactoryTarget.Component });
1299
- TileLayerComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TileLayerComponent, selector: "lib-tile-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0__namespace, template: '', isInline: true, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1300
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TileLayerComponent, decorators: [{
1580
+ FeatureLayerComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FeatureLayerComponent, deps: [{ token: MapPostboyService }, { token: FeatureLayerFactory }], target: i0__namespace.ɵɵFactoryTarget.Component });
1581
+ FeatureLayerComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: FeatureLayerComponent, selector: "lib-feature-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0__namespace, template: '', isInline: true, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1582
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FeatureLayerComponent, decorators: [{
1301
1583
  type: i0.Component,
1302
1584
  args: [{
1303
- selector: 'lib-tile-layer',
1585
+ selector: 'lib-feature-layer',
1304
1586
  template: '',
1305
1587
  styleUrls: [],
1306
1588
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
1307
1589
  }]
1308
- }], ctorParameters: function () { return [{ type: MapPostboyService }, { type: TileLayerFactory }]; }, propDecorators: { settings: [{
1590
+ }], ctorParameters: function () { return [{ type: MapPostboyService }, { type: FeatureLayerFactory }]; }, propDecorators: { settings: [{
1309
1591
  type: i0.Input
1310
1592
  }] } });
1311
1593
 
1312
- var FeatureLayerSettings = /** @class */ (function () {
1313
- function FeatureLayerSettings() {
1594
+ var ClusterLayerSettings = /** @class */ (function () {
1595
+ function ClusterLayerSettings() {
1314
1596
  this.name = IdGenerator.get();
1315
1597
  this.zIndex = 1;
1316
1598
  this.maxZoom = 19;
1317
1599
  this.minZoom = 0;
1600
+ this.distance = 20;
1601
+ this.bbox = false;
1602
+ this.clusterCancel = 14;
1318
1603
  }
1319
- FeatureLayerSettings.copy = function (model) {
1320
- var result = new FeatureLayerSettings();
1604
+ ClusterLayerSettings.copy = function (model) {
1605
+ var result = new ClusterLayerSettings();
1321
1606
  result.name = model.name;
1322
1607
  result.maxZoom = model.maxZoom;
1323
1608
  result.minZoom = model.minZoom;
1324
1609
  result.zIndex = model.zIndex;
1610
+ result.bbox = model.bbox;
1611
+ result.clusterCancel = model.clusterCancel;
1612
+ result.distance = model.distance;
1325
1613
  result.style = model.style;
1326
1614
  return result;
1327
1615
  };
1328
- FeatureLayerSettings.prototype.setZIndex = function (zIndex) {
1329
- return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { zIndex: zIndex }));
1616
+ ClusterLayerSettings.prototype.setZIndex = function (zIndex) {
1617
+ return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { zIndex: zIndex }));
1330
1618
  };
1331
- FeatureLayerSettings.prototype.setName = function (name) {
1332
- return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { name: name }));
1619
+ ClusterLayerSettings.prototype.setDistance = function (distance) {
1620
+ return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { distance: distance }));
1333
1621
  };
1334
- FeatureLayerSettings.prototype.setMaxZoom = function (maxZoom) {
1335
- return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { maxZoom: maxZoom }));
1622
+ ClusterLayerSettings.prototype.setName = function (name) {
1623
+ return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { name: name }));
1336
1624
  };
1337
- FeatureLayerSettings.prototype.setMinZoom = function (minZoom) {
1338
- return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { minZoom: minZoom }));
1625
+ ClusterLayerSettings.prototype.setMaxZoom = function (maxZoom) {
1626
+ return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { maxZoom: maxZoom }));
1339
1627
  };
1340
- FeatureLayerSettings.prototype.setStyle = function (style) {
1341
- return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { style: style }));
1628
+ ClusterLayerSettings.prototype.setMinZoom = function (minZoom) {
1629
+ return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { minZoom: minZoom }));
1342
1630
  };
1343
- FeatureLayerSettings.prototype.isSame = function (model) {
1631
+ ClusterLayerSettings.prototype.setClusterCancel = function (clusterCancel) {
1632
+ return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { clusterCancel: clusterCancel }));
1633
+ };
1634
+ ClusterLayerSettings.prototype.setBbox = function (bbox) {
1635
+ return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { bbox: bbox }));
1636
+ };
1637
+ ClusterLayerSettings.prototype.setStyle = function (style) {
1638
+ return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { style: style }));
1639
+ };
1640
+ ClusterLayerSettings.prototype.isSame = function (model) {
1344
1641
  if (this.maxZoom !== model.maxZoom)
1345
1642
  return false;
1346
1643
  if (this.minZoom !== model.minZoom)
@@ -1349,59 +1646,128 @@
1349
1646
  return false;
1350
1647
  if (this.name !== model.name)
1351
1648
  return false;
1649
+ if (this.distance !== model.distance)
1650
+ return false;
1651
+ if (this.clusterCancel !== model.clusterCancel)
1652
+ return false;
1653
+ if (this.bbox !== model.bbox)
1654
+ return false;
1352
1655
  if (this.style !== model.style)
1353
1656
  return false;
1354
1657
  return true;
1355
1658
  };
1356
- return FeatureLayerSettings;
1659
+ return ClusterLayerSettings;
1357
1660
  }());
1358
1661
 
1359
- var FeatureLayerFactory = /** @class */ (function () {
1360
- function FeatureLayerFactory() {
1662
+ var ClusterLayerManager = /** @class */ (function () {
1663
+ function ClusterLayerManager(settings, layer, postboy) {
1664
+ this.settings = settings;
1665
+ this.layer = layer;
1666
+ this.postboy = postboy;
1667
+ this.observeClick();
1668
+ this.observeMapMovement();
1361
1669
  }
1362
- FeatureLayerFactory.prototype.build = function (settings) {
1363
- var source$1 = new source.Vector({});
1364
- var layer$1 = new layer.Vector({
1670
+ ClusterLayerManager.prototype.observeMapMovement = function () {
1671
+ var _this = this;
1672
+ rxjs.combineLatest([
1673
+ this.postboy.subscribe(MapMoveEndEvent.ID).pipe(operators.auditTime(250)),
1674
+ this.postboy.subscribe(MapRenderedEvent.ID),
1675
+ ]).subscribe(function (_d) {
1676
+ var _e = __read(_d, 2), movement = _e[0], renderEvent = _e[1];
1677
+ _this.checkClusterNecessity(renderEvent.map);
1678
+ });
1679
+ };
1680
+ ClusterLayerManager.prototype.observeClick = function () {
1681
+ var _this = this;
1682
+ this.postboy.subscribe(MapClickEvent.ID).subscribe(function (m) {
1683
+ var _a, _b;
1684
+ if (((_b = (_a = m.features[_this.settings.name]) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 1) {
1685
+ _this.postboy.fire(new FitToFeaturesCommand(m.features[_this.settings.name], -1));
1686
+ }
1687
+ });
1688
+ };
1689
+ ClusterLayerManager.prototype.checkClusterNecessity = function (map) {
1690
+ var _a, _b, _c;
1691
+ var zoom = (_a = map.getView().getZoom()) !== null && _a !== void 0 ? _a : 0;
1692
+ var distance = zoom > this.settings.clusterCancel ? 0 : this.settings.distance;
1693
+ (_c = (_b = this.layer) === null || _b === void 0 ? void 0 : _b.getSource()) === null || _c === void 0 ? void 0 : _c.setDistance(distance);
1694
+ };
1695
+ return ClusterLayerManager;
1696
+ }());
1697
+
1698
+ var ClusterLayerFactory = /** @class */ (function () {
1699
+ function ClusterLayerFactory() {
1700
+ }
1701
+ ClusterLayerFactory.prototype.build = function (settings, postboy) {
1702
+ var source$1 = new source.Vector({
1703
+ strategy: settings.bbox ? loadingstrategy.bbox : undefined,
1704
+ });
1705
+ var cluster = new Cluster__default["default"]({
1706
+ distance: settings.distance,
1365
1707
  source: source$1,
1366
- maxZoom: settings.maxZoom,
1367
- minZoom: settings.minZoom,
1368
- zIndex: settings.zIndex,
1708
+ geometryFunction: function (feature) {
1709
+ var _a, _b;
1710
+ var geom = feature.getGeometry();
1711
+ if ((geom === null || geom === void 0 ? void 0 : geom.getType()) == 'Point') {
1712
+ return geom;
1713
+ }
1714
+ else if ((geom === null || geom === void 0 ? void 0 : geom.getType()) == 'Polygon') {
1715
+ return (_a = geom) === null || _a === void 0 ? void 0 : _a.getInteriorPoint();
1716
+ }
1717
+ else if ((geom === null || geom === void 0 ? void 0 : geom.getType()) == 'MultiPolygon') {
1718
+ return (_b = Polygon.fromExtent(geom.getExtent())) === null || _b === void 0 ? void 0 : _b.getInteriorPoint();
1719
+ }
1720
+ return undefined;
1721
+ },
1369
1722
  });
1370
- if (settings.style)
1371
- layer$1.setStyle(settings.style);
1723
+ var layer$1 = new layer.Vector({
1724
+ source: cluster,
1725
+ maxZoom: settings.maxZoom || undefined,
1726
+ minZoom: settings.minZoom || undefined,
1727
+ zIndex: settings.zIndex || 0,
1728
+ });
1729
+ layer$1.setStyle(this.styleFunc(settings));
1372
1730
  layer$1.set('name', settings.name);
1373
- return layer$1;
1731
+ return new ClusterLayerManager(settings, layer$1, postboy);
1732
+ };
1733
+ ClusterLayerFactory.prototype.styleFunc = function (settings) {
1734
+ return function (feature) {
1735
+ var features = feature.get('features');
1736
+ if (!settings.style)
1737
+ return undefined;
1738
+ return settings.style(features.map(function (f) { return (Object.assign({ id: f.getId() }, f.get(MapConstants.FeatureInfo))); }));
1739
+ };
1374
1740
  };
1375
- return FeatureLayerFactory;
1741
+ return ClusterLayerFactory;
1376
1742
  }());
1377
- FeatureLayerFactory.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FeatureLayerFactory, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1378
- FeatureLayerFactory.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FeatureLayerFactory, providedIn: 'root' });
1379
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FeatureLayerFactory, decorators: [{
1743
+ ClusterLayerFactory.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ClusterLayerFactory, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1744
+ ClusterLayerFactory.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ClusterLayerFactory, providedIn: 'root' });
1745
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ClusterLayerFactory, decorators: [{
1380
1746
  type: i0.Injectable,
1381
1747
  args: [{
1382
1748
  providedIn: 'root',
1383
1749
  }]
1384
1750
  }] });
1385
1751
 
1386
- var FeatureLayerComponent = /** @class */ (function (_super) {
1387
- __extends(FeatureLayerComponent, _super);
1388
- function FeatureLayerComponent(postboy, factory) {
1752
+ var ClusterLayerComponent = /** @class */ (function (_super) {
1753
+ __extends(ClusterLayerComponent, _super);
1754
+ function ClusterLayerComponent(postboy, factory) {
1389
1755
  var _this = _super.call(this) || this;
1390
1756
  _this.postboy = postboy;
1391
1757
  _this.factory = factory;
1392
- _this.layer = null;
1393
- _this._settings = new FeatureLayerSettings();
1758
+ _this.manager = null;
1759
+ _this._settings = new ClusterLayerSettings();
1394
1760
  _this.onDestroy = function () { return _this.removeLayer(); };
1395
1761
  return _this;
1396
1762
  }
1397
- FeatureLayerComponent.prototype.ngOnInit = function () {
1763
+ ClusterLayerComponent.prototype.ngOnInit = function () {
1398
1764
  var _this = this;
1399
1765
  this.postboy
1400
1766
  .subscribe(MapRenderedEvent.ID)
1401
1767
  .pipe(operators.filter(function (m) { return !!m; }), operators.first())
1402
1768
  .subscribe(function (m) { return _this.initLayer(); });
1403
1769
  };
1404
- Object.defineProperty(FeatureLayerComponent.prototype, "settings", {
1770
+ Object.defineProperty(ClusterLayerComponent.prototype, "settings", {
1405
1771
  set: function (value) {
1406
1772
  if (!value || this._settings.isSame(value))
1407
1773
  return;
@@ -1411,28 +1777,133 @@
1411
1777
  enumerable: false,
1412
1778
  configurable: true
1413
1779
  });
1414
- FeatureLayerComponent.prototype.initLayer = function () {
1780
+ ClusterLayerComponent.prototype.initLayer = function () {
1415
1781
  this.removeLayer();
1416
- this.layer = this.factory.build(this._settings);
1417
- this.postboy.fire(new AddLayerCommand(this.layer));
1782
+ this.manager = this.factory.build(this._settings, this.postboy);
1783
+ this.postboy.fire(new AddLayerCommand(this.manager.layer));
1418
1784
  };
1419
- FeatureLayerComponent.prototype.removeLayer = function () {
1420
- if (this.layer)
1421
- this.postboy.fire(new RemoveLayerCommand(this.layer));
1785
+ ClusterLayerComponent.prototype.removeLayer = function () {
1786
+ var _a;
1787
+ if ((_a = this.manager) === null || _a === void 0 ? void 0 : _a.layer)
1788
+ this.postboy.fire(new RemoveLayerCommand(this.manager.layer));
1422
1789
  };
1423
- return FeatureLayerComponent;
1790
+ return ClusterLayerComponent;
1424
1791
  }(DestructibleComponent));
1425
- FeatureLayerComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FeatureLayerComponent, deps: [{ token: MapPostboyService }, { token: FeatureLayerFactory }], target: i0__namespace.ɵɵFactoryTarget.Component });
1426
- FeatureLayerComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: FeatureLayerComponent, selector: "lib-feature-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0__namespace, template: '', isInline: true, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1427
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FeatureLayerComponent, decorators: [{
1792
+ ClusterLayerComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ClusterLayerComponent, deps: [{ token: MapPostboyService }, { token: ClusterLayerFactory }], target: i0__namespace.ɵɵFactoryTarget.Component });
1793
+ ClusterLayerComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ClusterLayerComponent, selector: "lib-cluster-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0__namespace, template: '', isInline: true, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1794
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ClusterLayerComponent, decorators: [{
1428
1795
  type: i0.Component,
1429
1796
  args: [{
1430
- selector: 'lib-feature-layer',
1797
+ selector: 'lib-cluster-layer',
1431
1798
  template: '',
1432
1799
  styleUrls: [],
1433
1800
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
1434
1801
  }]
1435
- }], ctorParameters: function () { return [{ type: MapPostboyService }, { type: FeatureLayerFactory }]; }, propDecorators: { settings: [{
1802
+ }], ctorParameters: function () { return [{ type: MapPostboyService }, { type: ClusterLayerFactory }]; }, propDecorators: { settings: [{
1803
+ type: i0.Input
1804
+ }] } });
1805
+
1806
+ var MapPlateFactory = /** @class */ (function () {
1807
+ function MapPlateFactory() {
1808
+ }
1809
+ MapPlateFactory.prototype.build = function (settings) {
1810
+ return new Map__default["default"]({
1811
+ controls: [],
1812
+ view: new View__default["default"]({
1813
+ center: (settings === null || settings === void 0 ? void 0 : settings.center) || [0, 0],
1814
+ zoom: (settings === null || settings === void 0 ? void 0 : settings.zoom) || 4,
1815
+ minZoom: (settings === null || settings === void 0 ? void 0 : settings.minZoom) || 0,
1816
+ maxZoom: (settings === null || settings === void 0 ? void 0 : settings.maxZoom) || 19,
1817
+ }),
1818
+ layers: [],
1819
+ });
1820
+ };
1821
+ return MapPlateFactory;
1822
+ }());
1823
+ MapPlateFactory.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapPlateFactory, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1824
+ MapPlateFactory.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapPlateFactory, providedIn: 'root' });
1825
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapPlateFactory, decorators: [{
1826
+ type: i0.Injectable,
1827
+ args: [{
1828
+ providedIn: 'root',
1829
+ }]
1830
+ }] });
1831
+
1832
+ var MapPlateComponent = /** @class */ (function (_super) {
1833
+ __extends(MapPlateComponent, _super);
1834
+ function MapPlateComponent(elementRef, postboy, mapFactory, registrator, detector) {
1835
+ var _this = _super.call(this) || this;
1836
+ _this.elementRef = elementRef;
1837
+ _this.postboy = postboy;
1838
+ _this.mapFactory = mapFactory;
1839
+ _this.registrator = registrator;
1840
+ _this.detector = detector;
1841
+ _this.osmUrl = '';
1842
+ _this._settings = new MapSettings();
1843
+ _this.drawingLayerSettings = new FeatureLayerSettings().setName(MapConstants.DrawingLayerId);
1844
+ _this.onDestroy = function () {
1845
+ _this.registrator.down();
1846
+ };
1847
+ registrator.up();
1848
+ return _this;
1849
+ }
1850
+ Object.defineProperty(MapPlateComponent.prototype, "settings", {
1851
+ set: function (value) {
1852
+ if (!value || this._settings.isSame(value))
1853
+ return;
1854
+ this._settings = value;
1855
+ this.setOsm();
1856
+ },
1857
+ enumerable: false,
1858
+ configurable: true
1859
+ });
1860
+ MapPlateComponent.prototype.ngOnInit = function () {
1861
+ var _this = this;
1862
+ proj.useGeographic();
1863
+ this.map = this.mapFactory.build(this._settings);
1864
+ this.map.setTarget(this.elementRef.nativeElement);
1865
+ this.detector.detectChanges();
1866
+ this.map.once('postrender', function () {
1867
+ _this.map.updateSize();
1868
+ _this.postboy.fire(new MapRenderedEvent(_this.map));
1869
+ });
1870
+ this.setOsm();
1871
+ };
1872
+ MapPlateComponent.prototype.setOsm = function () {
1873
+ if (!this.map)
1874
+ return;
1875
+ 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}";
1876
+ this.detector.detectChanges();
1877
+ this.map.updateSize();
1878
+ };
1879
+ return MapPlateComponent;
1880
+ }(DestructibleComponent));
1881
+ MapPlateComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapPlateComponent, deps: [{ token: i0__namespace.ElementRef }, { token: MapPostboyService }, { token: MapPlateFactory }, { token: MessageRegistratorService }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
1882
+ MapPlateComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: MapPlateComponent, selector: "lib-map-plate", inputs: { settings: "settings" }, providers: [
1883
+ MessageRegistratorService,
1884
+ MapStateService,
1885
+ MapManagementService,
1886
+ MapClickService,
1887
+ MapFeatureService,
1888
+ DrawingService,
1889
+ ], usesInheritance: true, ngImport: i0__namespace, template: "<ng-content></ng-content>\r\n<lib-osm-tile-layer *ngIf=\"osmUrl && map\" [map]=\"map\" [url]=\"osmUrl\"></lib-osm-tile-layer>\r\n<lib-feature-layer *ngIf=\"map\" [settings]=\"drawingLayerSettings\"></lib-feature-layer>\r\n", styles: ["lib-map-plate{position:relative;display:flex;flex-direction:column;height:100%}\n"], components: [{ type: OsmTileLayerComponent, selector: "lib-osm-tile-layer", inputs: ["url", "map"] }, { type: FeatureLayerComponent, selector: "lib-feature-layer", inputs: ["settings"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1890
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapPlateComponent, decorators: [{
1891
+ type: i0.Component,
1892
+ args: [{
1893
+ selector: 'lib-map-plate',
1894
+ templateUrl: './map-plate.component.html',
1895
+ styleUrls: ['./map-plate.component.scss'],
1896
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
1897
+ providers: [
1898
+ MessageRegistratorService,
1899
+ MapStateService,
1900
+ MapManagementService,
1901
+ MapClickService,
1902
+ MapFeatureService,
1903
+ DrawingService,
1904
+ ],
1905
+ }]
1906
+ }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: MapPostboyService }, { type: MapPlateFactory }, { type: MessageRegistratorService }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { settings: [{
1436
1907
  type: i0.Input
1437
1908
  }] } });
1438
1909
 
@@ -1624,8 +2095,7 @@
1624
2095
  .subscribe(function () { return _this.putPolygons(); });
1625
2096
  };
1626
2097
  PolygonsComponent.prototype.putPolygons = function () {
1627
- var _a;
1628
- if (!((_a = this._polygons) === null || _a === void 0 ? void 0 : _a.length))
2098
+ if (!this._polygons)
1629
2099
  return;
1630
2100
  this.postboy.fire(new PlaceLayerFeaturesCommand(this.layerName, this._polygons.map(function (m) { return m.feature; })));
1631
2101
  };
@@ -1660,17 +2130,19 @@
1660
2130
  FeatureLayerComponent,
1661
2131
  MarkersComponent,
1662
2132
  TooltipComponent,
1663
- PolygonsComponent], imports: [i5.CommonModule], exports: [MapPlateComponent,
2133
+ PolygonsComponent,
2134
+ ClusterLayerComponent], imports: [i6.CommonModule], exports: [MapPlateComponent,
1664
2135
  FeatureLayerComponent,
1665
2136
  MarkersComponent,
1666
2137
  TileLayerComponent,
1667
2138
  TooltipComponent,
1668
- PolygonsComponent] });
1669
- MapModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapModule, imports: [[i5.CommonModule]] });
2139
+ PolygonsComponent,
2140
+ ClusterLayerComponent] });
2141
+ MapModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapModule, imports: [[i6.CommonModule]] });
1670
2142
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapModule, decorators: [{
1671
2143
  type: i0.NgModule,
1672
2144
  args: [{
1673
- imports: [i5.CommonModule],
2145
+ imports: [i6.CommonModule],
1674
2146
  declarations: [
1675
2147
  DestructibleComponent,
1676
2148
  MapPlateComponent,
@@ -1680,6 +2152,7 @@
1680
2152
  MarkersComponent,
1681
2153
  TooltipComponent,
1682
2154
  PolygonsComponent,
2155
+ ClusterLayerComponent,
1683
2156
  ],
1684
2157
  exports: [
1685
2158
  MapPlateComponent,
@@ -1688,6 +2161,7 @@
1688
2161
  TileLayerComponent,
1689
2162
  TooltipComponent,
1690
2163
  PolygonsComponent,
2164
+ ClusterLayerComponent,
1691
2165
  ],
1692
2166
  }]
1693
2167
  }] });
@@ -1718,6 +2192,10 @@
1718
2192
  }),
1719
2193
  });
1720
2194
  };
2195
+ MarkerStyleHelper.withText = function (style, text) {
2196
+ style.setText(text);
2197
+ return style;
2198
+ };
1721
2199
  return MarkerStyleHelper;
1722
2200
  }());
1723
2201
 
@@ -1739,6 +2217,22 @@
1739
2217
  return PolygonStyleHelper;
1740
2218
  }());
1741
2219
 
2220
+ var TextStyleHelper = /** @class */ (function () {
2221
+ function TextStyleHelper() {
2222
+ }
2223
+ TextStyleHelper.get = function (text, font, color) {
2224
+ return new style.Text({
2225
+ text: text,
2226
+ font: font,
2227
+ textAlign: 'center',
2228
+ fill: new style.Fill({
2229
+ color: color,
2230
+ }),
2231
+ });
2232
+ };
2233
+ return TextStyleHelper;
2234
+ }());
2235
+
1742
2236
  /*
1743
2237
  * Public API Surface of maps
1744
2238
  */
@@ -1747,14 +2241,16 @@
1747
2241
  * Generated bundle index. Do not edit.
1748
2242
  */
1749
2243
 
1750
- exports.CallbackMessage = CallbackMessage;
2244
+ exports.CancelDrawingCommand = CancelDrawingCommand;
1751
2245
  exports.CloseTooltipCommand = CloseTooltipCommand;
2246
+ exports.ClusterLayerComponent = ClusterLayerComponent;
2247
+ exports.ClusterLayerSettings = ClusterLayerSettings;
1752
2248
  exports.FeatureLayerComponent = FeatureLayerComponent;
1753
2249
  exports.FeatureLayerSettings = FeatureLayerSettings;
1754
- exports.GenericMessage = GenericMessage;
1755
2250
  exports.MapClickEvent = MapClickEvent;
1756
2251
  exports.MapLyrsLabel = MapLyrsLabel;
1757
2252
  exports.MapModule = MapModule;
2253
+ exports.MapMoveEndEvent = MapMoveEndEvent;
1758
2254
  exports.MapPlateComponent = MapPlateComponent;
1759
2255
  exports.MapPostboyService = MapPostboyService;
1760
2256
  exports.MapRenderedEvent = MapRenderedEvent;
@@ -1767,6 +2263,8 @@
1767
2263
  exports.PolygonModel = PolygonModel;
1768
2264
  exports.PolygonStyleHelper = PolygonStyleHelper;
1769
2265
  exports.PolygonsComponent = PolygonsComponent;
2266
+ exports.StartDrawingCommand = StartDrawingCommand;
2267
+ exports.TextStyleHelper = TextStyleHelper;
1770
2268
  exports.TileLayerComponent = TileLayerComponent;
1771
2269
  exports.TileLayerSettings = TileLayerSettings;
1772
2270
  exports.TooltipComponent = TooltipComponent;