@artstesh/maps 1.1.6 → 1.1.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 (132) hide show
  1. package/dist/bundles/maps-components-src-map.umd.js +488 -168
  2. package/dist/bundles/maps-components-src-map.umd.js.map +1 -1
  3. package/dist/bundles/maps-components.umd.js +488 -168
  4. package/dist/bundles/maps-components.umd.js.map +1 -1
  5. package/dist/esm2015/map/helpers/marker-style.helper.js +27 -1
  6. package/dist/esm2015/map/helpers/polygon-style.helper.js +22 -1
  7. package/dist/esm2015/map/helpers/stringify-feature.helper.js +24 -21
  8. package/dist/esm2015/map/helpers/text-style.helper.js +12 -1
  9. package/dist/esm2015/map/map-plate/controls/map-control-zoom/map-control-zoom.component.js +18 -1
  10. package/dist/esm2015/map/map-plate/controls/map-control-zoom/zoom-control.settings.js +72 -1
  11. package/dist/esm2015/map/map-plate/features/markers/markers.component.js +11 -1
  12. package/dist/esm2015/map/map-plate/features/polygons/polygons.component.js +11 -1
  13. package/dist/esm2015/map/map-plate/layers/cluster-layer/cluster-layer.component.js +15 -7
  14. package/dist/esm2015/map/map-plate/layers/cluster-layer/cluster-layer.settings.js +79 -1
  15. package/dist/esm2015/map/map-plate/layers/feature-layer/feature-layer.component.js +7 -7
  16. package/dist/esm2015/map/map-plate/layers/feature-layer/feature-layer.settings.js +37 -17
  17. package/dist/esm2015/map/map-plate/layers/tile-layer/tile-layer.component.js +7 -7
  18. package/dist/esm2015/map/map-plate/layers/tile-layer/tile-layer.settings.js +76 -1
  19. package/dist/esm2015/map/map-plate/map-plate.component.js +2 -2
  20. package/dist/esm2015/map/map-plate/tooltips/tooltip/tooltip.component.js +15 -15
  21. package/dist/esm2015/map/map-plate/tooltips/tooltip/tooltip.settings.js +1 -1
  22. package/dist/esm2015/map/messages/commands/draw-selection-area.command.js +1 -1
  23. package/dist/esm2015/map/messages/commands/fit-to-polygons.command.js +13 -0
  24. package/dist/esm2015/map/messages/index.js +2 -1
  25. package/dist/esm2015/map/messages/queries/get-features-in-area.query.js +1 -1
  26. package/dist/esm2015/map/models/index.js +1 -2
  27. package/dist/esm2015/map/models/map-control.js +2 -2
  28. package/dist/esm2015/map/models/marker-model.js +1 -1
  29. package/dist/esm2015/map/models/polygon.model.js +4 -4
  30. package/dist/esm2015/map/services/drawing/drawing.service.js +3 -2
  31. package/dist/esm2015/map/services/feature.service.js +6 -6
  32. package/dist/esm2015/map/services/map-click.service.js +10 -10
  33. package/dist/esm2015/map/services/map-feature.service.js +17 -4
  34. package/dist/esm2015/map/services/map-management.service.js +2 -2
  35. package/dist/esm2015/map/services/map-state.service.js +2 -3
  36. package/dist/esm2015/map/services/message-registrator.service.js +3 -2
  37. package/dist/esm2015/src/map/helpers/marker-style.helper.js +27 -1
  38. package/dist/esm2015/src/map/helpers/polygon-style.helper.js +22 -1
  39. package/dist/esm2015/src/map/helpers/stringify-feature.helper.js +24 -21
  40. package/dist/esm2015/src/map/helpers/text-style.helper.js +12 -1
  41. package/dist/esm2015/src/map/map-plate/controls/map-control-zoom/map-control-zoom.component.js +18 -1
  42. package/dist/esm2015/src/map/map-plate/controls/map-control-zoom/zoom-control.settings.js +72 -1
  43. package/dist/esm2015/src/map/map-plate/features/markers/markers.component.js +11 -1
  44. package/dist/esm2015/src/map/map-plate/features/polygons/polygons.component.js +11 -1
  45. package/dist/esm2015/src/map/map-plate/layers/cluster-layer/cluster-layer.component.js +15 -7
  46. package/dist/esm2015/src/map/map-plate/layers/cluster-layer/cluster-layer.settings.js +79 -1
  47. package/dist/esm2015/src/map/map-plate/layers/feature-layer/feature-layer.component.js +7 -7
  48. package/dist/esm2015/src/map/map-plate/layers/feature-layer/feature-layer.settings.js +37 -17
  49. package/dist/esm2015/src/map/map-plate/layers/tile-layer/tile-layer.component.js +7 -7
  50. package/dist/esm2015/src/map/map-plate/layers/tile-layer/tile-layer.settings.js +76 -1
  51. package/dist/esm2015/src/map/map-plate/map-plate.component.js +2 -2
  52. package/dist/esm2015/src/map/map-plate/tooltips/tooltip/tooltip.component.js +15 -15
  53. package/dist/esm2015/src/map/map-plate/tooltips/tooltip/tooltip.settings.js +1 -1
  54. package/dist/esm2015/src/map/messages/commands/draw-selection-area.command.js +1 -1
  55. package/dist/esm2015/src/map/messages/commands/fit-to-polygons.command.js +13 -0
  56. package/dist/esm2015/src/map/messages/index.js +2 -1
  57. package/dist/esm2015/src/map/messages/queries/get-features-in-area.query.js +1 -1
  58. package/dist/esm2015/src/map/models/index.js +1 -2
  59. package/dist/esm2015/src/map/models/map-control.js +2 -2
  60. package/dist/esm2015/src/map/models/marker-model.js +1 -1
  61. package/dist/esm2015/src/map/models/polygon.model.js +4 -4
  62. package/dist/esm2015/src/map/services/drawing/drawing.service.js +3 -2
  63. package/dist/esm2015/src/map/services/feature.service.js +6 -6
  64. package/dist/esm2015/src/map/services/map-click.service.js +10 -10
  65. package/dist/esm2015/src/map/services/map-feature.service.js +17 -4
  66. package/dist/esm2015/src/map/services/map-management.service.js +2 -2
  67. package/dist/esm2015/src/map/services/map-state.service.js +2 -3
  68. package/dist/esm2015/src/map/services/message-registrator.service.js +3 -2
  69. package/dist/fesm2015/maps-components-src-map.js +468 -146
  70. package/dist/fesm2015/maps-components-src-map.js.map +1 -1
  71. package/dist/fesm2015/maps-components.js +468 -146
  72. package/dist/fesm2015/maps-components.js.map +1 -1
  73. package/dist/map/helpers/marker-style.helper.d.ts +26 -0
  74. package/dist/map/helpers/polygon-style.helper.d.ts +21 -0
  75. package/dist/map/helpers/stringify-feature.helper.d.ts +18 -0
  76. package/dist/map/helpers/text-style.helper.d.ts +11 -0
  77. package/dist/map/map-plate/controls/map-control-zoom/map-control-zoom.component.d.ts +20 -3
  78. package/dist/map/map-plate/controls/map-control-zoom/zoom-control.settings.d.ts +71 -0
  79. package/dist/map/map-plate/features/markers/markers.component.d.ts +10 -0
  80. package/dist/map/map-plate/features/polygons/polygons.component.d.ts +10 -0
  81. package/dist/map/map-plate/layers/cluster-layer/cluster-layer.component.d.ts +10 -2
  82. package/dist/map/map-plate/layers/cluster-layer/cluster-layer.settings.d.ts +78 -0
  83. package/dist/map/map-plate/layers/feature-layer/feature-layer.component.d.ts +2 -2
  84. package/dist/map/map-plate/layers/feature-layer/feature-layer.settings.d.ts +36 -16
  85. package/dist/map/map-plate/layers/tile-layer/tile-layer.component.d.ts +1 -1
  86. package/dist/map/map-plate/layers/tile-layer/tile-layer.settings.d.ts +75 -0
  87. package/dist/map/map-plate/map-plate.component.d.ts +2 -2
  88. package/dist/map/map-plate/tooltips/tooltip/tooltip.component.d.ts +5 -5
  89. package/dist/map/map-plate/tooltips/tooltip/tooltip.settings.d.ts +1 -1
  90. package/dist/map/messages/commands/draw-selection-area.command.d.ts +2 -1
  91. package/dist/map/messages/commands/fit-to-polygons.command.d.ts +9 -0
  92. package/dist/map/messages/index.d.ts +1 -0
  93. package/dist/map/messages/queries/get-features-in-area.query.d.ts +1 -1
  94. package/dist/map/models/index.d.ts +0 -1
  95. package/dist/map/models/map-control.d.ts +1 -1
  96. package/dist/map/models/polygon.model.d.ts +2 -2
  97. package/dist/map/services/feature.service.d.ts +1 -1
  98. package/dist/map/services/map-click.service.d.ts +1 -1
  99. package/dist/map/services/map-feature.service.d.ts +2 -0
  100. package/dist/package.json +2 -1
  101. package/dist/src/map/helpers/marker-style.helper.d.ts +26 -0
  102. package/dist/src/map/helpers/polygon-style.helper.d.ts +21 -0
  103. package/dist/src/map/helpers/stringify-feature.helper.d.ts +18 -0
  104. package/dist/src/map/helpers/text-style.helper.d.ts +11 -0
  105. package/dist/src/map/map-plate/controls/map-control-zoom/map-control-zoom.component.d.ts +20 -3
  106. package/dist/src/map/map-plate/controls/map-control-zoom/zoom-control.settings.d.ts +71 -0
  107. package/dist/src/map/map-plate/features/markers/markers.component.d.ts +10 -0
  108. package/dist/src/map/map-plate/features/polygons/polygons.component.d.ts +10 -0
  109. package/dist/src/map/map-plate/layers/cluster-layer/cluster-layer.component.d.ts +10 -2
  110. package/dist/src/map/map-plate/layers/cluster-layer/cluster-layer.settings.d.ts +78 -0
  111. package/dist/src/map/map-plate/layers/feature-layer/feature-layer.component.d.ts +2 -2
  112. package/dist/src/map/map-plate/layers/feature-layer/feature-layer.settings.d.ts +36 -16
  113. package/dist/src/map/map-plate/layers/tile-layer/tile-layer.component.d.ts +1 -1
  114. package/dist/src/map/map-plate/layers/tile-layer/tile-layer.settings.d.ts +75 -0
  115. package/dist/src/map/map-plate/map-plate.component.d.ts +2 -2
  116. package/dist/src/map/map-plate/tooltips/tooltip/tooltip.component.d.ts +5 -5
  117. package/dist/src/map/map-plate/tooltips/tooltip/tooltip.settings.d.ts +1 -1
  118. package/dist/src/map/messages/commands/draw-selection-area.command.d.ts +2 -1
  119. package/dist/src/map/messages/commands/fit-to-polygons.command.d.ts +9 -0
  120. package/dist/src/map/messages/index.d.ts +1 -0
  121. package/dist/src/map/messages/queries/get-features-in-area.query.d.ts +1 -1
  122. package/dist/src/map/models/index.d.ts +0 -1
  123. package/dist/src/map/models/map-control.d.ts +1 -1
  124. package/dist/src/map/models/polygon.model.d.ts +2 -2
  125. package/dist/src/map/services/feature.service.d.ts +1 -1
  126. package/dist/src/map/services/map-click.service.d.ts +1 -1
  127. package/dist/src/map/services/map-feature.service.d.ts +2 -0
  128. package/package.json +3 -2
  129. package/dist/esm2015/map/models/dictionary.js +0 -56
  130. package/dist/esm2015/src/map/models/dictionary.js +0 -56
  131. package/dist/map/models/dictionary.d.ts +0 -17
  132. package/dist/src/map/models/dictionary.d.ts +0 -17
@@ -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/control'), require('ol/proj'), require('@artstesh/postboy'), require('ol/interaction'), require('ol/interaction/Draw'), require('ol/sphere'), require('rxjs/operators'), require('ol/source'), 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'), require('ol/proj/epsg4326')) :
3
- typeof define === 'function' && define.amd ? define('maps-components/src/map', ['exports', '@angular/core', '@angular/common', 'ol', 'ol/geom', 'ol/format', 'ol/extent', 'ol/control', 'ol/proj', '@artstesh/postboy', 'ol/interaction', 'ol/interaction/Draw', 'ol/sphere', 'rxjs/operators', 'ol/source', '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', 'ol/proj/epsg4326'], 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.control, global.proj, global.postboy, global.interaction, global.Draw, global.Sphere, global.rxjs.operators, global.source, global.TileLayer, global.OSM, global.layer, global.loadingstrategy, global.Polygon, global.Cluster, global.rxjs, global.Map, global.View, global.Overlay, global.Style, global.style, global.epsg4326));
5
- })(this, (function (exports, i0, i6, ol, geom, format, extent, control, proj, postboy, interaction, Draw, Sphere, operators, source, TileLayer, OSM, layer, loadingstrategy, Polygon, Cluster, rxjs, Map, View, Overlay, Style, style, epsg4326) { '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/control'), require('ol/proj'), require('@artstesh/postboy'), require('ol/interaction'), require('ol/interaction/Draw'), require('ol/sphere'), require('@artstesh/collections'), require('rxjs/operators'), require('ol/source'), 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'), require('ol/proj/epsg4326')) :
3
+ typeof define === 'function' && define.amd ? define('maps-components/src/map', ['exports', '@angular/core', '@angular/common', 'ol', 'ol/geom', 'ol/format', 'ol/extent', 'ol/control', 'ol/proj', '@artstesh/postboy', 'ol/interaction', 'ol/interaction/Draw', 'ol/sphere', '@artstesh/collections', 'rxjs/operators', 'ol/source', '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', 'ol/proj/epsg4326'], 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.control, global.proj, global.postboy, global.interaction, global.Draw, global.Sphere, global.collections, global.rxjs.operators, global.source, global.TileLayer, global.OSM, global.layer, global.loadingstrategy, global.Polygon, global.Cluster, global.rxjs, global.Map, global.View, global.Overlay, global.Style, global.style, global.epsg4326));
5
+ })(this, (function (exports, i0, i6, ol, geom, format, extent, control, proj, postboy, interaction, Draw, Sphere, collections, operators, source, TileLayer, OSM, layer, loadingstrategy, Polygon, Cluster, rxjs, Map, View, Overlay, Style, style, epsg4326) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -655,6 +655,13 @@
655
655
  (_a = this._feature) === null || _a === void 0 ? void 0 : _a.set(MapConstants.FeatureInfo, this.info);
656
656
  _c = __read(extent.getCenter((_b = this._feature.getGeometry()) === null || _b === void 0 ? void 0 : _b.getExtent()), 2), this.lng = _c[0], this.lat = _c[1];
657
657
  }
658
+ Object.defineProperty(PolygonModel.prototype, "feature", {
659
+ get: function () {
660
+ return this._feature;
661
+ },
662
+ enumerable: false,
663
+ configurable: true
664
+ });
658
665
  PolygonModel.fromGeoJson = function (id, json, info) {
659
666
  var feature = new format.GeoJSON().readFeature(json);
660
667
  feature.setId(id);
@@ -665,13 +672,6 @@
665
672
  feature.setId(id);
666
673
  return new PolygonModel(feature, id, info);
667
674
  };
668
- Object.defineProperty(PolygonModel.prototype, "feature", {
669
- get: function () {
670
- return this._feature;
671
- },
672
- enumerable: false,
673
- configurable: true
674
- });
675
675
  return PolygonModel;
676
676
  }());
677
677
 
@@ -689,75 +689,9 @@
689
689
  FeatureOutputFormat[FeatureOutputFormat["WKT"] = 2] = "WKT";
690
690
  })(exports.FeatureOutputFormat || (exports.FeatureOutputFormat = {}));
691
691
 
692
- var Dictionary = /** @class */ (function () {
693
- function Dictionary() {
694
- var _this = this;
695
- this.collection = {};
696
- this._keys = new Set();
697
- this.has = function (key) { return _this._keys.has(key); };
698
- }
699
- Object.defineProperty(Dictionary.prototype, "keys", {
700
- get: function () {
701
- return Array.from(this._keys);
702
- },
703
- enumerable: false,
704
- configurable: true
705
- });
706
- Object.defineProperty(Dictionary.prototype, "size", {
707
- get: function () {
708
- return this._keys.size;
709
- },
710
- enumerable: false,
711
- configurable: true
712
- });
713
- Dictionary.clone = function (dic, action) {
714
- return Dictionary.create(dic.collection, action);
715
- };
716
- Dictionary.create = function (dic, action) {
717
- var keyList = Object.keys(dic);
718
- var result = new Dictionary();
719
- for (var i = 0; i < keyList.length; i++) {
720
- var key = keyList[i];
721
- result._keys.add(key);
722
- result.collection[key] = action ? action(dic[key], key) : dic[key];
723
- }
724
- return result;
725
- };
726
- Dictionary.prototype.find = function (predicate) {
727
- var result = null;
728
- this.forEach(function (e) {
729
- if (result === null && predicate(e))
730
- result = e;
731
- });
732
- return result;
733
- };
734
- Dictionary.prototype.take = function (key) {
735
- return this._keys.has(key) ? this.collection[key] : null;
736
- };
737
- Dictionary.prototype.put = function (key, value) {
738
- if (value == null)
739
- return;
740
- this.collection[key] = value;
741
- this._keys.add(key);
742
- };
743
- Dictionary.prototype.rmv = function (key) {
744
- if (!this._keys.has(key))
745
- return;
746
- delete this.collection[key];
747
- this._keys.delete(key);
748
- };
749
- Dictionary.prototype.forEach = function (callback) {
750
- var keys = Object.keys(this.collection);
751
- for (var i = 0; i < keys.length; i++) {
752
- callback(this.collection[keys[i]], i);
753
- }
754
- };
755
- return Dictionary;
756
- }());
757
-
758
692
  /**
759
693
  *
760
- * 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.
694
+ * 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.
761
695
  * This is the base class for controls. You can use it for simple custom controls by creating the element with listeners, creating an instance:
762
696
  * var myControl = new Control({element: myElement}); and then adding this to the map.
763
697
  * 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.
@@ -1024,6 +958,26 @@
1024
958
  }(postboy.PostboyExecutor));
1025
959
  CalculateAreaExecutor.ID = '172ecf46-86b5-4f46-a5f1-96ba2cbb1694';
1026
960
 
961
+ var FitToPolygonsCommand = /** @class */ (function (_super) {
962
+ __extends(FitToPolygonsCommand, _super);
963
+ function FitToPolygonsCommand(features, zoomAfter) {
964
+ if (zoomAfter === void 0) { zoomAfter = 0; }
965
+ var _this = _super.call(this) || this;
966
+ _this.features = features;
967
+ _this.zoomAfter = zoomAfter;
968
+ return _this;
969
+ }
970
+ Object.defineProperty(FitToPolygonsCommand.prototype, "id", {
971
+ get: function () {
972
+ return FitToPolygonsCommand.ID;
973
+ },
974
+ enumerable: false,
975
+ configurable: true
976
+ });
977
+ return FitToPolygonsCommand;
978
+ }(postboy.PostboyGenericMessage));
979
+ FitToPolygonsCommand.ID = 'a9e42b23-ffaf-4c46-8370-e0432cd14d60';
980
+
1027
981
  var AddLayerCommand = /** @class */ (function (_super) {
1028
982
  __extends(AddLayerCommand, _super);
1029
983
  function AddLayerCommand(layer) {
@@ -1200,6 +1154,11 @@
1200
1154
  FeatureService.filterFeaturesInArea = function (query) {
1201
1155
  return query.features.filter(function (f) { return FeatureService.booleanIntersects(query.area, f.getGeometry()); });
1202
1156
  };
1157
+ FeatureService.calculateArea = function (g) {
1158
+ if (!g)
1159
+ return 0;
1160
+ return Sphere__namespace.getArea(g, { projection: 'EPSG:4326' });
1161
+ };
1203
1162
  FeatureService.booleanIntersects = function (g1, g2) {
1204
1163
  if (g2.getType() === 'Point')
1205
1164
  return g1.intersectsCoordinate(g2.getCoordinates());
@@ -1209,11 +1168,6 @@
1209
1168
  return g1.intersectsCoordinate(g2.getInteriorPoint().getCoordinates());
1210
1169
  return false;
1211
1170
  };
1212
- FeatureService.calculateArea = function (g) {
1213
- if (!g)
1214
- return 0;
1215
- return Sphere__namespace.getArea(g, { projection: 'EPSG:4326' });
1216
- };
1217
1171
  return FeatureService;
1218
1172
  }());
1219
1173
 
@@ -1327,7 +1281,7 @@
1327
1281
  var MapManagementService = /** @class */ (function () {
1328
1282
  function MapManagementService(postboy) {
1329
1283
  this.postboy = postboy;
1330
- this.layers = new Dictionary();
1284
+ this.layers = new collections.Dictionary();
1331
1285
  }
1332
1286
  MapManagementService.prototype.up = function () {
1333
1287
  this.observeMapRender();
@@ -1399,7 +1353,7 @@
1399
1353
  MapManagementService.prototype.observeFeaturesInArea = function () {
1400
1354
  var _this = this;
1401
1355
  this.postboy.subscribe(GetFeaturesInAreaQuery.ID).subscribe(function (qr) {
1402
- var result = new Dictionary();
1356
+ var result = new collections.Dictionary();
1403
1357
  _this.layers.forEach(function (l) {
1404
1358
  var _a, _b;
1405
1359
  var layerName = l.get('name');
@@ -1470,17 +1424,31 @@
1470
1424
  MapFeatureService.prototype.up = function () {
1471
1425
  this.observeMapRender();
1472
1426
  this.observeFitToFeatures();
1427
+ this.observeFitToPolygons();
1473
1428
  };
1474
1429
  MapFeatureService.prototype.observeMapRender = function () {
1475
1430
  var _this = this;
1476
1431
  this.postboy.subscribe(MapRenderedEvent.ID).subscribe(function (m) {
1477
1432
  _this.map = m.map;
1433
+ if (_this.fitPolygonsWaiting)
1434
+ _this.postboy.fire(_this.fitPolygonsWaiting);
1478
1435
  });
1479
1436
  };
1480
1437
  MapFeatureService.prototype.observeFitToFeatures = function () {
1481
1438
  var _this = this;
1482
- this.postboy.subscribe(FitToFeaturesCommand.ID).subscribe(function (m) {
1483
- _this.fitToGeometries(m.features.map(function (f) { return f.getGeometry(); }), m.zoomAfter);
1439
+ this.postboy.subscribe(FitToFeaturesCommand.ID).subscribe(function (cmd) {
1440
+ _this.fitToGeometries(cmd.features.map(function (f) { return f.getGeometry(); }), cmd.zoomAfter);
1441
+ });
1442
+ };
1443
+ MapFeatureService.prototype.observeFitToPolygons = function () {
1444
+ var _this = this;
1445
+ this.postboy.subscribe(FitToPolygonsCommand.ID).subscribe(function (cmd) {
1446
+ if (!_this.map) {
1447
+ _this.fitPolygonsWaiting = cmd;
1448
+ return;
1449
+ }
1450
+ _this.fitPolygonsWaiting = undefined;
1451
+ _this.fitToGeometries(cmd.features.map(function (f) { return f.feature.getGeometry(); }), cmd.zoomAfter);
1484
1452
  });
1485
1453
  };
1486
1454
  MapFeatureService.prototype.fitToGeometries = function (geometries, zoomAfter) {
@@ -1506,16 +1474,6 @@
1506
1474
  MapClickService.prototype.up = function () {
1507
1475
  this.observeMapRender();
1508
1476
  };
1509
- MapClickService.prototype.observeMapRender = function () {
1510
- var _this = this;
1511
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe(function (m) {
1512
- var _a;
1513
- _this.map = m.map;
1514
- (_a = _this.map) === null || _a === void 0 ? void 0 : _a.on('singleclick', function (e) {
1515
- _this.postboy.fire(_this.onClick(e));
1516
- });
1517
- });
1518
- };
1519
1477
  MapClickService.prototype.onClick = function (ev) {
1520
1478
  var _this = this;
1521
1479
  var _a;
@@ -1535,6 +1493,16 @@
1535
1493
  });
1536
1494
  return model;
1537
1495
  };
1496
+ MapClickService.prototype.observeMapRender = function () {
1497
+ var _this = this;
1498
+ this.postboy.subscribe(MapRenderedEvent.ID).subscribe(function (m) {
1499
+ var _a;
1500
+ _this.map = m.map;
1501
+ (_a = _this.map) === null || _a === void 0 ? void 0 : _a.on('singleclick', function (e) {
1502
+ _this.postboy.fire(_this.onClick(e));
1503
+ });
1504
+ });
1505
+ };
1538
1506
  MapClickService.prototype.getFeatureCollectionWithInner = function (features) {
1539
1507
  var result = [];
1540
1508
  features === null || features === void 0 ? void 0 : features.forEach(function (f) {
@@ -1566,7 +1534,7 @@
1566
1534
  var drawingCommand = new StartDrawingCommand(ev.type, ev.style);
1567
1535
  drawingCommand.result.subscribe(function (r) {
1568
1536
  if (!r) {
1569
- ev.finish(new Dictionary());
1537
+ ev.finish(new collections.Dictionary());
1570
1538
  return;
1571
1539
  }
1572
1540
  var area = PolygonModel.fromGeoJson(1, r).feature.getGeometry();
@@ -1793,6 +1761,7 @@
1793
1761
  this.registerSubject(MapClickEvent.ID);
1794
1762
  this.registerSubject(CloseTooltipCommand.ID);
1795
1763
  this.registerSubject(FitToFeaturesCommand.ID);
1764
+ this.registerSubject(FitToPolygonsCommand.ID);
1796
1765
  this.registerSubject(MapMoveEndEvent.ID);
1797
1766
  this.registerSubject(CancelDrawingCommand.ID);
1798
1767
  this.registerSubject(StartDrawingCommand.ID);
@@ -1818,14 +1787,53 @@
1818
1787
  type: i0.Injectable
1819
1788
  }], ctorParameters: function () { return [{ type: MapPostboyService }, { type: MapManagementService }, { type: MapStateService }, { type: MapFeatureService }, { type: MapClickService }, { type: DrawingService }, { type: FeatureModificationService }, { type: ControlsService }]; } });
1820
1789
 
1790
+ /**
1791
+ * Class representing settings for a tile layer.
1792
+ */
1821
1793
  var TileLayerSettings = /** @class */ (function () {
1822
1794
  function TileLayerSettings() {
1795
+ /**
1796
+ * The maximum zoom level for a map view.
1797
+ *
1798
+ * @type {number}
1799
+ * @default 19
1800
+ */
1823
1801
  this.maxZoom = 19;
1802
+ /**
1803
+ * The minimum zoom level allowed.
1804
+ *
1805
+ * @type {number}
1806
+ */
1824
1807
  this.minZoom = 0;
1808
+ /**
1809
+ * The opacity of an element.
1810
+ *
1811
+ * @type {number}
1812
+ * @default 0.6
1813
+ */
1825
1814
  this.opacity = 0.6;
1815
+ /**
1816
+ * Represents the tiles URL.
1817
+ * @typedef {string} url
1818
+ *
1819
+ * @example
1820
+ * 'https://example.ex/{z}/{x}/{y}.png'
1821
+ */
1826
1822
  this.url = '';
1823
+ /**
1824
+ * The projection of the coordinate system.
1825
+ *
1826
+ * @type {string}
1827
+ * @default 'EPSG:3857'
1828
+ */
1827
1829
  this.projection = 'EPSG:3857';
1828
1830
  }
1831
+ /**
1832
+ * Creates a copy of the given tile layer settings.
1833
+ *
1834
+ * @param {TileLayerSettings} model - The tile layer settings to be copied.
1835
+ * @return {TileLayerSettings} - A new instance of TileLayerSettings with the same properties as the model.
1836
+ */
1829
1837
  TileLayerSettings.copy = function (model) {
1830
1838
  var result = new TileLayerSettings();
1831
1839
  result.maxZoom = model.maxZoom;
@@ -1835,21 +1843,57 @@
1835
1843
  result.url = model.url;
1836
1844
  return result;
1837
1845
  };
1846
+ /**
1847
+ * Sets the URL of the TileLayerSettings object.
1848
+ *
1849
+ * @param {string} url - The URL to be set.
1850
+ * @return {TileLayerSettings} - The updated TileLayerSettings object.
1851
+ */
1838
1852
  TileLayerSettings.prototype.setUrl = function (url) {
1839
1853
  return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { url: url }));
1840
1854
  };
1855
+ /**
1856
+ * Sets the maximum zoom level for the tile layer.
1857
+ *
1858
+ * @param {number} maxZoom - The maximum zoom level.
1859
+ * @returns {TileLayerSettings} - The updated tile layer settings object.
1860
+ */
1841
1861
  TileLayerSettings.prototype.setMaxZoom = function (maxZoom) {
1842
1862
  return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { maxZoom: maxZoom }));
1843
1863
  };
1864
+ /**
1865
+ * Sets the minimum zoom level for the Tile Layer.
1866
+ *
1867
+ * @param {number} minZoom - The minimum zoom level to be set.
1868
+ * @return {TileLayerSettings} The modified TileLayerSettings object with the updated minimum zoom level.
1869
+ */
1844
1870
  TileLayerSettings.prototype.setMinZoom = function (minZoom) {
1845
1871
  return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { minZoom: minZoom }));
1846
1872
  };
1873
+ /**
1874
+ * Sets the opacity of the TileLayerSettings.
1875
+ *
1876
+ * @param {number} opacity - The opacity value to set. Must be a number between 0 and 1.
1877
+ * @return {TileLayerSettings} - A new instance of TileLayerSettings with the opacity set.
1878
+ */
1847
1879
  TileLayerSettings.prototype.setOpacity = function (opacity) {
1848
1880
  return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { opacity: opacity }));
1849
1881
  };
1882
+ /**
1883
+ * Sets the projection for the tile layer settings.
1884
+ *
1885
+ * @param {string} projection - The desired projection for the tile layer settings.
1886
+ * @return {TileLayerSettings} - The updated tile layer settings with the new projection.
1887
+ */
1850
1888
  TileLayerSettings.prototype.setProjection = function (projection) {
1851
1889
  return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { projection: projection }));
1852
1890
  };
1891
+ /**
1892
+ * Checks if the current instance of TileLayerSettings is equal to the given model.
1893
+ * @param {TileLayerSettings} model - The model to compare against.
1894
+ * @return {boolean} - True if all properties of the current instance matches the properties of the model;
1895
+ * otherwise, false.
1896
+ */
1853
1897
  TileLayerSettings.prototype.isSame = function (model) {
1854
1898
  if (this.maxZoom !== model.maxZoom)
1855
1899
  return false;
@@ -1925,13 +1969,6 @@
1925
1969
  _this.onDestroy = function () { return _this.removeLayer(); };
1926
1970
  return _this;
1927
1971
  }
1928
- TileLayerComponent.prototype.ngOnInit = function () {
1929
- var _this = this;
1930
- this.postboy
1931
- .subscribe(MapRenderedEvent.ID)
1932
- .pipe(operators.filter(function (m) { return !!m; }), operators.first())
1933
- .subscribe(function (m) { return _this.initLayer(); });
1934
- };
1935
1972
  Object.defineProperty(TileLayerComponent.prototype, "settings", {
1936
1973
  set: function (value) {
1937
1974
  if (!value || this._settings.isSame(value))
@@ -1942,6 +1979,13 @@
1942
1979
  enumerable: false,
1943
1980
  configurable: true
1944
1981
  });
1982
+ TileLayerComponent.prototype.ngOnInit = function () {
1983
+ var _this = this;
1984
+ this.postboy
1985
+ .subscribe(MapRenderedEvent.ID)
1986
+ .pipe(operators.filter(function (m) { return !!m; }), operators.first())
1987
+ .subscribe(function (m) { return _this.initLayer(); });
1988
+ };
1945
1989
  TileLayerComponent.prototype.initLayer = function () {
1946
1990
  this.removeLayer();
1947
1991
  this.layer = this.factory.build(this._settings);
@@ -2048,17 +2092,24 @@
2048
2092
  */
2049
2093
  this.zIndex = 1;
2050
2094
  /**
2051
- * The maximum zoom at which the layer is visible. 19 by default
2095
+ The maximum view zoom level (inclusive) at which this layer will be visible.
2096
+
2097
+ @type {number}
2098
+ @default 19
2052
2099
  */
2053
2100
  this.maxZoom = 19;
2054
2101
  /**
2055
- * The minimum zoom at which the layer is visible. 0 by default
2102
+ The minimum view zoom level (exclusive) at which this layer will be visible.
2103
+
2104
+ @type {number}
2056
2105
  */
2057
2106
  this.minZoom = 0;
2058
2107
  }
2059
2108
  /**
2060
- * Creates a clone of the existing settings
2061
- * @param model
2109
+ * Copies the given FeatureLayerSettings object
2110
+ *
2111
+ * @param {FeatureLayerSettings} model - The FeatureLayerSettings object to be copied
2112
+ * @returns {FeatureLayerSettings} - A copy of the FeatureLayerSettings object
2062
2113
  */
2063
2114
  FeatureLayerSettings.copy = function (model) {
2064
2115
  var result = new FeatureLayerSettings();
@@ -2070,43 +2121,56 @@
2070
2121
  return result;
2071
2122
  };
2072
2123
  /**
2073
- Setter for {@link FeatureLayerSettings.zIndex}
2074
- * @param zIndex
2124
+ * Sets the z-index value for the FeatureLayerSettings object.
2125
+ *
2126
+ * @param {number} zIndex - The new z-index value.
2127
+ * @return {FeatureLayerSettings} - The updated FeatureLayerSettings object.
2075
2128
  */
2076
2129
  FeatureLayerSettings.prototype.setZIndex = function (zIndex) {
2077
2130
  return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { zIndex: zIndex }));
2078
2131
  };
2079
2132
  /**
2080
- * Setter for {@link FeatureLayerSettings.name}
2081
- * @param name
2133
+ * Sets the name of the FeatureLayerSettings.
2134
+ *
2135
+ * @param {string} name - The name to set for the FeatureLayerSettings.
2136
+ *
2137
+ * @return {FeatureLayerSettings} - The updated FeatureLayerSettings object with the new name.
2082
2138
  */
2083
2139
  FeatureLayerSettings.prototype.setName = function (name) {
2084
2140
  return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { name: name }));
2085
2141
  };
2086
2142
  /**
2087
- * Setter for {@link FeatureLayerSettings.maxZoom}
2088
- * @param maxZoom
2143
+ * Sets the maximum zoom level for the FeatureLayerSettings.
2144
+ *
2145
+ * @param {number} maxZoom - The maximum zoom level.
2146
+ * @return {FeatureLayerSettings} - The updated FeatureLayerSettings object.
2089
2147
  */
2090
2148
  FeatureLayerSettings.prototype.setMaxZoom = function (maxZoom) {
2091
2149
  return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { maxZoom: maxZoom }));
2092
2150
  };
2093
2151
  /**
2094
- * Setter for {@link FeatureLayerSettings.minZoom}
2095
- * @param minZoom
2152
+ * Sets the minimum zoom level for the feature layer.
2153
+ *
2154
+ * @param {number} minZoom The minimum zoom level to be set.
2155
+ * @returns {FeatureLayerSettings} The updated feature layer settings object.
2096
2156
  */
2097
2157
  FeatureLayerSettings.prototype.setMinZoom = function (minZoom) {
2098
2158
  return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { minZoom: minZoom }));
2099
2159
  };
2100
2160
  /**
2101
- * Setter for {@link FeatureLayerSettings.style}
2102
- * @param style
2161
+ * Sets the style for the FeatureLayerSettings object.
2162
+ *
2163
+ * @param {Style | StyleFunction} style - The new style to set. It can be either a Style object or a StyleFunction.
2164
+ * @return {FeatureLayerSettings} - The updated FeatureLayerSettings object with the new style.
2103
2165
  */
2104
2166
  FeatureLayerSettings.prototype.setStyle = function (style) {
2105
2167
  return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { style: style }));
2106
2168
  };
2107
2169
  /**
2108
- * Checks if the model has the same content
2109
- * @param model - the object to compare
2170
+ * Checks if the given FeatureLayerSettings object is identical to the current object.
2171
+ *
2172
+ * @param {FeatureLayerSettings} model - The FeatureLayerSettings object to compare with.
2173
+ * @return {boolean} - Returns true if the given object is identical to the current object, otherwise false.
2110
2174
  */
2111
2175
  FeatureLayerSettings.prototype.isSame = function (model) {
2112
2176
  if (this.maxZoom !== model.maxZoom)
@@ -2162,13 +2226,6 @@
2162
2226
  _this.onDestroy = function () { return _this.removeLayer(); };
2163
2227
  return _this;
2164
2228
  }
2165
- FeatureLayerComponent.prototype.ngOnInit = function () {
2166
- var _this = this;
2167
- this.postboy
2168
- .subscribe(MapRenderedEvent.ID)
2169
- .pipe(operators.filter(function (m) { return !!m; }), operators.first())
2170
- .subscribe(function (m) { return _this.initLayer(); });
2171
- };
2172
2229
  Object.defineProperty(FeatureLayerComponent.prototype, "settings", {
2173
2230
  set: function (value) {
2174
2231
  if (!value || this._settings.isSame(value))
@@ -2179,6 +2236,13 @@
2179
2236
  enumerable: false,
2180
2237
  configurable: true
2181
2238
  });
2239
+ FeatureLayerComponent.prototype.ngOnInit = function () {
2240
+ var _this = this;
2241
+ this.postboy
2242
+ .subscribe(MapRenderedEvent.ID)
2243
+ .pipe(operators.filter(function (m) { return !!m; }), operators.first())
2244
+ .subscribe(function (m) { return _this.initLayer(); });
2245
+ };
2182
2246
  FeatureLayerComponent.prototype.initLayer = function () {
2183
2247
  this.removeLayer();
2184
2248
  this.layer = this.factory.build(this._settings);
@@ -2208,12 +2272,34 @@
2208
2272
  function ClusterLayerSettings() {
2209
2273
  this.name = IdGenerator.get();
2210
2274
  this.zIndex = 1;
2275
+ /**
2276
+ * The maximum view zoom level (inclusive) at which this layer will be visible.
2277
+ *
2278
+ * @type {number}
2279
+ * @default 19
2280
+ */
2211
2281
  this.maxZoom = 19;
2282
+ /**
2283
+ * The minimum view zoom level (exclusive) at which this layer will be visible.
2284
+ *
2285
+ * @type {number}
2286
+ */
2212
2287
  this.minZoom = 0;
2288
+ /**
2289
+ * Distance in pixels within which features will be clustered together.
2290
+ *
2291
+ * @type {number}
2292
+ */
2213
2293
  this.distance = 20;
2214
2294
  this.bbox = false;
2215
2295
  this.clusterCancel = 14;
2216
2296
  }
2297
+ /**
2298
+ * Creates a copy of the given ClusterLayerSettings object.
2299
+ *
2300
+ * @param {ClusterLayerSettings} model - The ClusterLayerSettings object to be copied.
2301
+ * @returns {ClusterLayerSettings} - A new ClusterLayerSettings object that is a copy of the original object.
2302
+ */
2217
2303
  ClusterLayerSettings.copy = function (model) {
2218
2304
  var result = new ClusterLayerSettings();
2219
2305
  result.name = model.name;
@@ -2226,30 +2312,86 @@
2226
2312
  result.style = model.style;
2227
2313
  return result;
2228
2314
  };
2315
+ /**
2316
+ * Set the z-index for the ClusterLayer.
2317
+ *
2318
+ * @param {number} zIndex - The new z-index for the ClusterLayer.
2319
+ * @return {ClusterLayerSettings} - The updated ClusterLayerSettings object.
2320
+ */
2229
2321
  ClusterLayerSettings.prototype.setZIndex = function (zIndex) {
2230
2322
  return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { zIndex: zIndex }));
2231
2323
  };
2324
+ /**
2325
+ * Sets the distance value for ClusterLayerSettings.
2326
+ *
2327
+ * @param {number} distance - The distance value to be set.
2328
+ * @return {ClusterLayerSettings} - The modified ClusterLayerSettings object.
2329
+ */
2232
2330
  ClusterLayerSettings.prototype.setDistance = function (distance) {
2233
2331
  return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { distance: distance }));
2234
2332
  };
2333
+ /**
2334
+ * Sets the name of the ClusterLayerSettings object.
2335
+ *
2336
+ * @param {string} name - The name to set for the ClusterLayerSettings.
2337
+ * @return {ClusterLayerSettings} - A new ClusterLayerSettings object with the updated name.
2338
+ */
2235
2339
  ClusterLayerSettings.prototype.setName = function (name) {
2236
2340
  return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { name: name }));
2237
2341
  };
2342
+ /**
2343
+ * Sets the maximum zoom level for the Cluster Layer.
2344
+ *
2345
+ * @param {number} maxZoom - The maximum zoom level to be set.
2346
+ * @return {ClusterLayerSettings} - The updated ClusterLayerSettings object.
2347
+ */
2238
2348
  ClusterLayerSettings.prototype.setMaxZoom = function (maxZoom) {
2239
2349
  return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { maxZoom: maxZoom }));
2240
2350
  };
2351
+ /**
2352
+ * Sets the minimum zoom level for the ClusterLayerSettings.
2353
+ *
2354
+ * @param {number} minZoom - The minimum zoom level to set.
2355
+ * @return {ClusterLayerSettings} - The updated ClusterLayerSettings object.
2356
+ */
2241
2357
  ClusterLayerSettings.prototype.setMinZoom = function (minZoom) {
2242
2358
  return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { minZoom: minZoom }));
2243
2359
  };
2360
+ /**
2361
+ * Sets the cluster cancel number for the ClusterLayerSettings.
2362
+ *
2363
+ * @param {number} clusterCancel - The new cluster cancel number.
2364
+ * @returns {ClusterLayerSettings} - The updated ClusterLayerSettings object.
2365
+ */
2244
2366
  ClusterLayerSettings.prototype.setClusterCancel = function (clusterCancel) {
2245
2367
  return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { clusterCancel: clusterCancel }));
2246
2368
  };
2369
+ /**
2370
+ * Sets the value of 'bbox' property in the ClusterLayerSettings object.
2371
+ *
2372
+ * @param {boolean} bbox - A boolean value indicating whether to include bounding box calculation in the cluster layer settings.
2373
+ * @returns {ClusterLayerSettings} - The updated ClusterLayerSettings object with the newly set 'bbox' value.
2374
+ */
2247
2375
  ClusterLayerSettings.prototype.setBbox = function (bbox) {
2248
2376
  return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { bbox: bbox }));
2249
2377
  };
2378
+ /**
2379
+ * Sets the style for the ClusterLayerSettings.
2380
+ *
2381
+ * @param {function} style - A function that takes an array of identified features as input and returns a Style or StyleFunction.
2382
+ *
2383
+ * @return {ClusterLayerSettings} - The updated ClusterLayerSettings object with the new style applied.
2384
+ */
2250
2385
  ClusterLayerSettings.prototype.setStyle = function (style) {
2251
2386
  return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { style: style }));
2252
2387
  };
2388
+ /**
2389
+ * Checks if the current ClusterLayerSettings object is the same as the specified model.
2390
+ *
2391
+ * @param {ClusterLayerSettings} model - The model to compare with the current object.
2392
+ *
2393
+ * @return {boolean} - Returns true if the current ClusterLayerSettings object is the same as the specified model, otherwise false.
2394
+ */
2253
2395
  ClusterLayerSettings.prototype.isSame = function (model) {
2254
2396
  if (this.maxZoom !== model.maxZoom)
2255
2397
  return false;
@@ -2362,6 +2504,9 @@
2362
2504
  }]
2363
2505
  }] });
2364
2506
 
2507
+ /**
2508
+ * Represents a cluster layer component.
2509
+ */
2365
2510
  var ClusterLayerComponent = /** @class */ (function (_super) {
2366
2511
  __extends(ClusterLayerComponent, _super);
2367
2512
  function ClusterLayerComponent(postboy, factory) {
@@ -2373,14 +2518,12 @@
2373
2518
  _this.onDestroy = function () { return _this.removeLayer(); };
2374
2519
  return _this;
2375
2520
  }
2376
- ClusterLayerComponent.prototype.ngOnInit = function () {
2377
- var _this = this;
2378
- this.postboy
2379
- .subscribe(MapRenderedEvent.ID)
2380
- .pipe(operators.filter(function (m) { return !!m; }), operators.first())
2381
- .subscribe(function (m) { return _this.initLayer(); });
2382
- };
2383
2521
  Object.defineProperty(ClusterLayerComponent.prototype, "settings", {
2522
+ /**
2523
+ * Sets the settings for the cluster layer.
2524
+ *
2525
+ * @param {ClusterLayerSettings | undefined} value - The settings for the cluster layer.
2526
+ */
2384
2527
  set: function (value) {
2385
2528
  if (!value || this._settings.isSame(value))
2386
2529
  return;
@@ -2390,6 +2533,13 @@
2390
2533
  enumerable: false,
2391
2534
  configurable: true
2392
2535
  });
2536
+ ClusterLayerComponent.prototype.ngOnInit = function () {
2537
+ var _this = this;
2538
+ this.postboy
2539
+ .subscribe(MapRenderedEvent.ID)
2540
+ .pipe(operators.filter(function (m) { return !!m; }), operators.first())
2541
+ .subscribe(function (m) { return _this.initLayer(); });
2542
+ };
2393
2543
  ClusterLayerComponent.prototype.initLayer = function () {
2394
2544
  this.removeLayer();
2395
2545
  this.manager = this.factory.build(this._settings, this.postboy);
@@ -2452,8 +2602,8 @@
2452
2602
  _this.registrator = registrator;
2453
2603
  _this.detector = detector;
2454
2604
  _this.osmUrl = '';
2455
- _this._settings = new MapSettings();
2456
2605
  _this.drawingLayerSettings = new FeatureLayerSettings().setName(MapConstants.DrawingLayerId);
2606
+ _this._settings = new MapSettings();
2457
2607
  _this.onDestroy = function () {
2458
2608
  _this.registrator.down();
2459
2609
  };
@@ -2528,6 +2678,11 @@
2528
2678
  type: i0.Input
2529
2679
  }] } });
2530
2680
 
2681
+ /**
2682
+ * MarkersComponent is a component that displays markers on a map.
2683
+ * It listens for changes in the `markers` input property and
2684
+ * automatically puts the markers on the map using the MapPostboyService.
2685
+ */
2531
2686
  var MarkersComponent = /** @class */ (function (_super) {
2532
2687
  __extends(MarkersComponent, _super);
2533
2688
  function MarkersComponent(postboy) {
@@ -2538,6 +2693,11 @@
2538
2693
  return _this;
2539
2694
  }
2540
2695
  Object.defineProperty(MarkersComponent.prototype, "markers", {
2696
+ /**
2697
+ * Sets the markers property.
2698
+ *
2699
+ * @param {MarkerModel[]} value - The array of MarkerModel objects to set as markers.
2700
+ */
2541
2701
  set: function (value) {
2542
2702
  this._markers = value !== null && value !== void 0 ? value : [];
2543
2703
  this.putMarkers();
@@ -2611,13 +2771,8 @@
2611
2771
  var _this = _super.call(this) || this;
2612
2772
  _this.postboy = postboy;
2613
2773
  _this.detector = detector;
2614
- _this._settings = new TooltipSettings();
2615
2774
  _this.show = false;
2616
- _this.removeOverlay = function () {
2617
- var _a;
2618
- !!_this.overlay && ((_a = _this.map) === null || _a === void 0 ? void 0 : _a.removeOverlay(_this.overlay));
2619
- _this.show = false;
2620
- };
2775
+ _this._settings = new TooltipSettings();
2621
2776
  _this.options = function (coordinates) {
2622
2777
  var _a;
2623
2778
  return {
@@ -2627,6 +2782,11 @@
2627
2782
  position: coordinates,
2628
2783
  };
2629
2784
  };
2785
+ _this.removeOverlay = function () {
2786
+ var _a;
2787
+ !!_this.overlay && ((_a = _this.map) === null || _a === void 0 ? void 0 : _a.removeOverlay(_this.overlay));
2788
+ _this.show = false;
2789
+ };
2630
2790
  return _this;
2631
2791
  }
2632
2792
  Object.defineProperty(TooltipComponent.prototype, "settings", {
@@ -2644,6 +2804,14 @@
2644
2804
  this.subs.push(this.observeMapClick());
2645
2805
  this.subs.push(this.observeClose());
2646
2806
  };
2807
+ TooltipComponent.prototype.addOverlay = function (coordinates) {
2808
+ var _a;
2809
+ this.removeOverlay();
2810
+ this.overlay = new Overlay__default["default"](this.options(coordinates));
2811
+ (_a = this.map) === null || _a === void 0 ? void 0 : _a.addOverlay(this.overlay);
2812
+ this.show = true;
2813
+ this.detector.detectChanges();
2814
+ };
2647
2815
  TooltipComponent.prototype.observeMapClick = function () {
2648
2816
  var _this = this;
2649
2817
  return this.postboy.subscribe(MapClickEvent.ID).subscribe(function (ev) {
@@ -2663,14 +2831,6 @@
2663
2831
  _this.map = m.map;
2664
2832
  });
2665
2833
  };
2666
- TooltipComponent.prototype.addOverlay = function (coordinates) {
2667
- var _a;
2668
- this.removeOverlay();
2669
- this.overlay = new Overlay__default["default"](this.options(coordinates));
2670
- (_a = this.map) === null || _a === void 0 ? void 0 : _a.addOverlay(this.overlay);
2671
- this.show = true;
2672
- this.detector.detectChanges();
2673
- };
2674
2834
  return TooltipComponent;
2675
2835
  }(DestructibleComponent));
2676
2836
  TooltipComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TooltipComponent, deps: [{ token: MapPostboyService }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
@@ -2690,6 +2850,11 @@
2690
2850
  type: i0.Input
2691
2851
  }] } });
2692
2852
 
2853
+ /**
2854
+ * Component for rendering polygons on a map.
2855
+ * It listens for changes in the `polygons` input property and
2856
+ * automatically puts the polygons on the map using the MapPostboyService.
2857
+ */
2693
2858
  var PolygonsComponent = /** @class */ (function (_super) {
2694
2859
  __extends(PolygonsComponent, _super);
2695
2860
  function PolygonsComponent(postboy) {
@@ -2700,6 +2865,11 @@
2700
2865
  return _this;
2701
2866
  }
2702
2867
  Object.defineProperty(PolygonsComponent.prototype, "polygons", {
2868
+ /**
2869
+ * Sets the value of polygons.
2870
+ *
2871
+ * @param {PolygonModel[]} value - The new value for polygons.
2872
+ */
2703
2873
  set: function (value) {
2704
2874
  this._polygons = value !== null && value !== void 0 ? value : [];
2705
2875
  this.putPolygons();
@@ -2737,14 +2907,47 @@
2737
2907
  type: i0.Input
2738
2908
  }] } });
2739
2909
 
2910
+ /**
2911
+ * Represents the settings for a zoom control.
2912
+ */
2740
2913
  var ZoomControlSettings = /** @class */ (function () {
2741
2914
  function ZoomControlSettings() {
2915
+ /**
2916
+ * The CSS class name of the control element.
2917
+ *
2918
+ * @type {string}
2919
+ */
2742
2920
  this.controlClass = 'ol-zoom';
2921
+ /**
2922
+ * The CSS class name for zoom in button.
2923
+ * @type {string}
2924
+ */
2743
2925
  this.zoomInClass = 'ol-zoom-in';
2926
+ /**
2927
+ * The CSS class name for the zoom out button element.
2928
+ *
2929
+ * @type {string}
2930
+ */
2744
2931
  this.zoomOutClass = 'ol-zoom-out';
2932
+ /**
2933
+ * The label for the zoom in action.
2934
+ *
2935
+ * @type {string}
2936
+ */
2745
2937
  this.zoomInLabel = 'Zoom In';
2938
+ /**
2939
+ * The label for the zoom out control.
2940
+ *
2941
+ * @type {string}
2942
+ */
2746
2943
  this.zoomOutLabel = 'Zoom Out';
2747
2944
  }
2945
+ /**
2946
+ * Copies the provided ZoomControlSettings object.
2947
+ *
2948
+ * @param {ZoomControlSettings} model - The ZoomControlSettings object to be copied.
2949
+ * @return {ZoomControlSettings} - The copied ZoomControlSettings object.
2950
+ */
2748
2951
  ZoomControlSettings.copy = function (model) {
2749
2952
  var result = new ZoomControlSettings();
2750
2953
  result.controlClass = model.controlClass;
@@ -2754,6 +2957,13 @@
2754
2957
  result.zoomOutLabel = model.zoomOutLabel;
2755
2958
  return result;
2756
2959
  };
2960
+ /**
2961
+ * Checks if the current ZoomControlSettings object is equal to the given model.
2962
+ *
2963
+ * @param {ZoomControlSettings} model - The ZoomControlSettings object to compare with.
2964
+ *
2965
+ * @return {boolean} - true if the current object is equal to the given model, false otherwise.
2966
+ */
2757
2967
  ZoomControlSettings.prototype.isSame = function (model) {
2758
2968
  if (this.zoomInClass !== model.zoomInClass)
2759
2969
  return false;
@@ -2767,24 +2977,61 @@
2767
2977
  return false;
2768
2978
  return true;
2769
2979
  };
2980
+ /**
2981
+ * Sets the zoom in label of the Zoom Control Settings.
2982
+ *
2983
+ * @param {string} zoomInLabel - The label for the zoom in button.
2984
+ * @return {ZoomControlSettings} - The new Zoom Control Settings object with the updated zoom in label.
2985
+ */
2770
2986
  ZoomControlSettings.prototype.setZoomInLabel = function (zoomInLabel) {
2771
2987
  return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomInLabel: zoomInLabel }));
2772
2988
  };
2989
+ /**
2990
+ * Sets the zoomOutClass property of the ZoomControlSettings object.
2991
+ *
2992
+ * @param {string} zoomOutClass - The CSS class to be assigned to the zoom out button.
2993
+ * @return {ZoomControlSettings} - The updated ZoomControlSettings object with the new zoomOutClass value.
2994
+ */
2773
2995
  ZoomControlSettings.prototype.setZoomOutClass = function (zoomOutClass) {
2774
2996
  return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomOutClass: zoomOutClass }));
2775
2997
  };
2998
+ /**
2999
+ * Sets the zoom in class for the zoom control settings.
3000
+ *
3001
+ * @param {string} zoomInClass - The new zoom in class to be set.
3002
+ * @return {ZoomControlSettings} - The updated zoom control settings.
3003
+ */
2776
3004
  ZoomControlSettings.prototype.setZoomInClass = function (zoomInClass) {
2777
3005
  return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomInClass: zoomInClass }));
2778
3006
  };
3007
+ /**
3008
+ * Set the label for the zoom out control.
3009
+ *
3010
+ * @param {string} zoomOutLabel - The label for the zoom out control.
3011
+ * @returns {ZoomControlSettings} - The updated zoom control settings.
3012
+ */
2779
3013
  ZoomControlSettings.prototype.setZoomOutLabel = function (zoomOutLabel) {
2780
3014
  return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomOutLabel: zoomOutLabel }));
2781
3015
  };
3016
+ /**
3017
+ * Sets the control class for the ZoomControlSettings.
3018
+ *
3019
+ * @param {string} controlClass - The class name of the control to be set.
3020
+ *
3021
+ * @return {ZoomControlSettings} - The modified ZoomControlSettings object.
3022
+ */
2782
3023
  ZoomControlSettings.prototype.setControlClass = function (controlClass) {
2783
3024
  return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { controlClass: controlClass }));
2784
3025
  };
2785
3026
  return ZoomControlSettings;
2786
3027
  }());
2787
3028
 
3029
+ /**
3030
+ * @class
3031
+ * @classdesc Represents a component for the Zoom control on a map.
3032
+ * @extends DestructibleComponent
3033
+ * @implements OnInit
3034
+ */
2788
3035
  var MapControlZoomComponent = /** @class */ (function (_super) {
2789
3036
  __extends(MapControlZoomComponent, _super);
2790
3037
  function MapControlZoomComponent(postboy) {
@@ -2798,6 +3045,17 @@
2798
3045
  return _this;
2799
3046
  }
2800
3047
  Object.defineProperty(MapControlZoomComponent.prototype, "settings", {
3048
+ /**
3049
+ * Sets the settings for the Zoom Control.
3050
+ *
3051
+ * @param {ZoomControlSettings | undefined} value - The new settings for the Zoom Control.
3052
+ *
3053
+ * @description
3054
+ * This method sets the settings for the Zoom Control. It takes a parameter `value` which should be an object of type `ZoomControlSettings` or `undefined`.
3055
+ *
3056
+ * If the `value` is `undefined` or the same as the current settings, the method will return without making any changes.
3057
+ *
3058
+ */
2801
3059
  set: function (value) {
2802
3060
  if (!value || this._settings.isSame(value))
2803
3061
  return;
@@ -2892,9 +3150,19 @@
2892
3150
  }]
2893
3151
  }] });
2894
3152
 
3153
+ /**
3154
+ * Helper class to create and modify marker styles.
3155
+ */
2895
3156
  var MarkerStyleHelper = /** @class */ (function () {
2896
3157
  function MarkerStyleHelper() {
2897
3158
  }
3159
+ /**
3160
+ * Creates a new Style object from an SVG.
3161
+ * @param {string} svg - The SVG string.
3162
+ * @param {Array<number>} [size=[30, 30]] - The size of the icon image.
3163
+ * @param {number} [zIndex=400] - The zIndex of the style.
3164
+ * @returns {Style} A new Style object.
3165
+ */
2898
3166
  MarkerStyleHelper.fromSvg = function (svg, size, zIndex) {
2899
3167
  if (size === void 0) { size = [30, 30]; }
2900
3168
  if (zIndex === void 0) { zIndex = 400; }
@@ -2908,6 +3176,15 @@
2908
3176
  zIndex: zIndex,
2909
3177
  });
2910
3178
  };
3179
+ /**
3180
+ * Returns a Style object with a circle style.
3181
+ *
3182
+ * @param {number} radius - The radius of the circle.
3183
+ * @param {string} fill - The fill color of the circle. Format: '#RRGGBB' or 'rgba(R, G, B, A)'.
3184
+ * @param {string} strokeColor - The stroke color of the circle. Format: '#RRGGBB' or 'rgba(R, G, B, A)'.
3185
+ * @param {number} [strokeWidth=1] - The width of the stroke. Default is 1.
3186
+ * @returns {Style} - A Style object with a Circle image.
3187
+ */
2911
3188
  MarkerStyleHelper.circle = function (radius, fill, strokeColor, strokeWidth) {
2912
3189
  if (strokeWidth === void 0) { strokeWidth = 1; }
2913
3190
  return new Style__default["default"]({
@@ -2918,6 +3195,13 @@
2918
3195
  }),
2919
3196
  });
2920
3197
  };
3198
+ /**
3199
+ * Applies the given Text to the provided Style.
3200
+ *
3201
+ * @param {Style} style - The Style to modify.
3202
+ * @param {Text} text - The Text to apply to the Style.
3203
+ * @return {Style} - The modified Style with the applied Text.
3204
+ */
2921
3205
  MarkerStyleHelper.withText = function (style, text) {
2922
3206
  style.setText(text);
2923
3207
  return style;
@@ -2925,9 +3209,21 @@
2925
3209
  return MarkerStyleHelper;
2926
3210
  }());
2927
3211
 
3212
+ /**
3213
+ * A helper class for creating polygon styles.
3214
+ * @class
3215
+ */
2928
3216
  var PolygonStyleHelper = /** @class */ (function () {
2929
3217
  function PolygonStyleHelper() {
2930
3218
  }
3219
+ /**
3220
+ * Creates a Style object with the given fill color, stroke color, and stroke width.
3221
+ *
3222
+ * @param {string} fill - The fill color in hexadecimal or RGB format.
3223
+ * @param {string} stroke - The stroke color in hexadecimal or RGB format.
3224
+ * @param {number} [strokeWidth=1] - The width of the stroke. Defaults to 1.
3225
+ * @return {Style} The created Style object.
3226
+ */
2931
3227
  PolygonStyleHelper.simple = function (fill, stroke, strokeWidth) {
2932
3228
  if (strokeWidth === void 0) { strokeWidth = 1; }
2933
3229
  return new Style__default["default"]({
@@ -2940,6 +3236,15 @@
2940
3236
  }),
2941
3237
  });
2942
3238
  };
3239
+ /**
3240
+ * Creates a new Style object with the given fill, stroke, stroke width, and pin radius.
3241
+ *
3242
+ * @param {string} fill - The color to use for the fill of the style.
3243
+ * @param {string} stroke - The color to use for the stroke of the style.
3244
+ * @param {number} [strokeWidth=1] - The width of the stroke. Defaults to 1.
3245
+ * @param {number} [pinRadius=5] - The radius of the circle used as the image for the style. Defaults to 5.
3246
+ * @returns {Style} - The newly created Style object.
3247
+ */
2943
3248
  PolygonStyleHelper.edit = function (fill, stroke, strokeWidth, pinRadius) {
2944
3249
  if (strokeWidth === void 0) { strokeWidth = 1; }
2945
3250
  if (pinRadius === void 0) { pinRadius = 5; }
@@ -2962,9 +3267,20 @@
2962
3267
  return PolygonStyleHelper;
2963
3268
  }());
2964
3269
 
3270
+ /**
3271
+ * Helper class for creating text styles.
3272
+ */
2965
3273
  var TextStyleHelper = /** @class */ (function () {
2966
3274
  function TextStyleHelper() {
2967
3275
  }
3276
+ /**
3277
+ * Creates a new instance of the Text class with the specified properties.
3278
+ *
3279
+ * @param {string} text - The text content of the Text object.
3280
+ * @param {string} font - The font style of the Text object.
3281
+ * @param {string} color - The color of the Text object.
3282
+ * @return {Text} A new instance of the Text class.
3283
+ */
2968
3284
  TextStyleHelper.get = function (text, font, color) {
2969
3285
  return new style.Text({
2970
3286
  text: text,
@@ -2978,6 +3294,9 @@
2978
3294
  return TextStyleHelper;
2979
3295
  }());
2980
3296
 
3297
+ /**
3298
+ * A helper class for converting and stringify features.
3299
+ */
2981
3300
  var StringifyFeatureHelper = /** @class */ (function () {
2982
3301
  function StringifyFeatureHelper() {
2983
3302
  }
@@ -2987,29 +3306,30 @@
2987
3306
  ? new format.GeoJSON().writeFeature(feature)
2988
3307
  : new format.WKT().writeFeature(feature);
2989
3308
  };
3309
+ /**
3310
+ * Creates a polygon feature representing a circle based on a given feature with a circle geometry.
3311
+ *
3312
+ * @param {Feature<Geometry>} feature - The input feature with a circle geometry.
3313
+ * @param {FeatureOutputFormat} format - The format for outputting the polygon feature. (default: FeatureOutputFormat.GeoJson)
3314
+ *
3315
+ * @return {string} - The string representation of the polygon feature.
3316
+ */
2990
3317
  StringifyFeatureHelper.circle = function (feature, format) {
2991
3318
  if (format === void 0) { format = exports.FeatureOutputFormat.GeoJson; }
2992
- // const clone = feature.clone();
2993
- // clone.setGeometry(fromCircle(feature.getGeometry()! as Circle));
2994
- var tetemp = feature.getGeometryName();
2995
3319
  var circle = feature.getGeometry();
2996
- // const temp = StringifyFeatureHelper.drawCircle(circle.getCenter(), circle.getRadius());
2997
- var ttt = feature.getGeometry().getExtent();
2998
- var eastPoint = [ttt[2], (ttt[1] + ttt[3]) / 2];
2999
- var aaa = __spreadArray(__spreadArray([], __read(proj.transform([ttt[0], ttt[1]], 'EPSG:4326', 'EPSG:3857'))), __read(proj.transform([ttt[2], ttt[3]], 'EPSG:4326', 'EPSG:3857')));
3000
- var radius = (aaa[2] - aaa[0]) / 2;
3001
- var radius2 = new geom.LineString([circle.getCenter(), eastPoint]).getLength();
3320
+ var ext = feature.getGeometry().getExtent();
3321
+ var coords = __spreadArray(__spreadArray([], __read(proj.transform([ext[0], ext[1]], 'EPSG:4326', 'EPSG:3857'))), __read(proj.transform([ext[2], ext[3]], 'EPSG:4326', 'EPSG:3857')));
3322
+ var radius = (coords[2] - coords[0]) / 2;
3002
3323
  var polygonGeom = new Polygon__default["default"](StringifyFeatureHelper.drawCircle(circle.getCenter(), radius));
3003
- // var edgeCoordinate = [circle.getCenter()[0] + radius, circle.getCenter()[1]];
3004
- // var wgs84Sphere = new Sphere(6378137);
3005
3324
  return StringifyFeatureHelper.polygon(new ol.Feature(polygonGeom), format);
3006
- // const rad = circle.getRadius();
3007
- // const degrees = 180 / Math.PI; // radians to degrees
3008
- // const radians = Math.PI / 180; // degrees to radians
3009
- // const rlat = rad * degrees * 1000;
3010
- // const rlng = rad * radians;
3011
- // return StringifyFeatureHelper.polygon(new Feature<Geometry>(circular(circle.getCenter(),circle.getRadius() * METERS_PER_UNIT)), format);
3012
3325
  };
3326
+ /**
3327
+ * Draw a circle based on a center point and radius.
3328
+ *
3329
+ * @param {number[]} point - The center point coordinates in EPSG:4326 format.
3330
+ * @param {number} radius - The radius of the circle in meters.
3331
+ * @return {Coordinate[][]} - The coordinates of the circle boundary in EPSG:4326 format.
3332
+ */
3013
3333
  StringifyFeatureHelper.drawCircle = function (point, radius) {
3014
3334
  var tetetemp = proj.transform(point, 'EPSG:4326', 'EPSG:3857');
3015
3335
  // const tetetemp = point;
@@ -3046,10 +3366,10 @@
3046
3366
  exports.CloseTooltipCommand = CloseTooltipCommand;
3047
3367
  exports.ClusterLayerComponent = ClusterLayerComponent;
3048
3368
  exports.ClusterLayerSettings = ClusterLayerSettings;
3049
- exports.Dictionary = Dictionary;
3050
3369
  exports.DrawSelectionAreaCommand = DrawSelectionAreaCommand;
3051
3370
  exports.FeatureLayerComponent = FeatureLayerComponent;
3052
3371
  exports.FeatureLayerSettings = FeatureLayerSettings;
3372
+ exports.FitToPolygonsCommand = FitToPolygonsCommand;
3053
3373
  exports.MapClickEvent = MapClickEvent;
3054
3374
  exports.MapControl = MapControl;
3055
3375
  exports.MapControlZoomComponent = MapControlZoomComponent;