@artstesh/maps 6.0.1 → 6.0.2

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 (97) hide show
  1. package/dist/esm2022/map/helpers/marker-style.helper.mjs +27 -1
  2. package/dist/esm2022/map/helpers/polygon-style.helper.mjs +22 -1
  3. package/dist/esm2022/map/helpers/stringify-feature.helper.mjs +24 -21
  4. package/dist/esm2022/map/helpers/text-style.helper.mjs +12 -1
  5. package/dist/esm2022/map/map-plate/controls/map-control-zoom/map-control-zoom.component.mjs +26 -9
  6. package/dist/esm2022/map/map-plate/controls/map-control-zoom/zoom-control.settings.mjs +72 -1
  7. package/dist/esm2022/map/map-plate/features/markers/markers.component.mjs +11 -1
  8. package/dist/esm2022/map/map-plate/features/polygons/polygons.component.mjs +11 -1
  9. package/dist/esm2022/map/map-plate/layers/cluster-layer/cluster-layer.component.mjs +16 -8
  10. package/dist/esm2022/map/map-plate/layers/cluster-layer/cluster-layer.settings.mjs +79 -1
  11. package/dist/esm2022/map/map-plate/layers/feature-layer/feature-layer.component.mjs +8 -8
  12. package/dist/esm2022/map/map-plate/layers/feature-layer/feature-layer.settings.mjs +37 -17
  13. package/dist/esm2022/map/map-plate/layers/tile-layer/tile-layer.component.mjs +7 -7
  14. package/dist/esm2022/map/map-plate/layers/tile-layer/tile-layer.settings.mjs +76 -1
  15. package/dist/esm2022/map/map-plate/map-plate.component.mjs +5 -5
  16. package/dist/esm2022/map/map-plate/tooltips/tooltip/tooltip.component.mjs +23 -23
  17. package/dist/esm2022/map/map-plate/tooltips/tooltip/tooltip.settings.mjs +2 -2
  18. package/dist/esm2022/map/messages/commands/fit-to-polygons.command.mjs +1 -1
  19. package/dist/esm2022/map/models/map-control.mjs +2 -2
  20. package/dist/esm2022/map/models/marker-model.mjs +1 -1
  21. package/dist/esm2022/map/models/polygon.model.mjs +12 -12
  22. package/dist/esm2022/map/services/feature.service.mjs +6 -6
  23. package/dist/esm2022/map/services/map-click.service.mjs +9 -9
  24. package/dist/esm2022/map/services/map-feature.service.mjs +1 -1
  25. package/dist/esm2022/map/services/map-state.service.mjs +2 -3
  26. package/dist/esm2022/src/map/helpers/marker-style.helper.mjs +27 -1
  27. package/dist/esm2022/src/map/helpers/polygon-style.helper.mjs +22 -1
  28. package/dist/esm2022/src/map/helpers/stringify-feature.helper.mjs +24 -21
  29. package/dist/esm2022/src/map/helpers/text-style.helper.mjs +12 -1
  30. package/dist/esm2022/src/map/map-plate/controls/map-control-zoom/map-control-zoom.component.mjs +26 -9
  31. package/dist/esm2022/src/map/map-plate/controls/map-control-zoom/zoom-control.settings.mjs +72 -1
  32. package/dist/esm2022/src/map/map-plate/features/markers/markers.component.mjs +11 -1
  33. package/dist/esm2022/src/map/map-plate/features/polygons/polygons.component.mjs +11 -1
  34. package/dist/esm2022/src/map/map-plate/layers/cluster-layer/cluster-layer.component.mjs +16 -8
  35. package/dist/esm2022/src/map/map-plate/layers/cluster-layer/cluster-layer.settings.mjs +79 -1
  36. package/dist/esm2022/src/map/map-plate/layers/feature-layer/feature-layer.component.mjs +8 -8
  37. package/dist/esm2022/src/map/map-plate/layers/feature-layer/feature-layer.settings.mjs +37 -17
  38. package/dist/esm2022/src/map/map-plate/layers/tile-layer/tile-layer.component.mjs +7 -7
  39. package/dist/esm2022/src/map/map-plate/layers/tile-layer/tile-layer.settings.mjs +76 -1
  40. package/dist/esm2022/src/map/map-plate/map-plate.component.mjs +5 -5
  41. package/dist/esm2022/src/map/map-plate/tooltips/tooltip/tooltip.component.mjs +23 -23
  42. package/dist/esm2022/src/map/map-plate/tooltips/tooltip/tooltip.settings.mjs +2 -2
  43. package/dist/esm2022/src/map/messages/commands/fit-to-polygons.command.mjs +1 -1
  44. package/dist/esm2022/src/map/models/map-control.mjs +2 -2
  45. package/dist/esm2022/src/map/models/marker-model.mjs +1 -1
  46. package/dist/esm2022/src/map/models/polygon.model.mjs +12 -12
  47. package/dist/esm2022/src/map/services/feature.service.mjs +6 -6
  48. package/dist/esm2022/src/map/services/map-click.service.mjs +9 -9
  49. package/dist/esm2022/src/map/services/map-feature.service.mjs +1 -1
  50. package/dist/esm2022/src/map/services/map-state.service.mjs +2 -3
  51. package/dist/fesm2022/maps-components-src-map.mjs +467 -116
  52. package/dist/fesm2022/maps-components-src-map.mjs.map +1 -1
  53. package/dist/fesm2022/maps-components.mjs +467 -116
  54. package/dist/fesm2022/maps-components.mjs.map +1 -1
  55. package/dist/map/helpers/marker-style.helper.d.ts +26 -0
  56. package/dist/map/helpers/polygon-style.helper.d.ts +21 -0
  57. package/dist/map/helpers/stringify-feature.helper.d.ts +18 -0
  58. package/dist/map/helpers/text-style.helper.d.ts +11 -0
  59. package/dist/map/map-plate/controls/map-control-zoom/map-control-zoom.component.d.ts +20 -3
  60. package/dist/map/map-plate/controls/map-control-zoom/zoom-control.settings.d.ts +71 -0
  61. package/dist/map/map-plate/features/markers/markers.component.d.ts +10 -0
  62. package/dist/map/map-plate/features/polygons/polygons.component.d.ts +10 -0
  63. package/dist/map/map-plate/layers/cluster-layer/cluster-layer.component.d.ts +10 -2
  64. package/dist/map/map-plate/layers/cluster-layer/cluster-layer.settings.d.ts +78 -0
  65. package/dist/map/map-plate/layers/feature-layer/feature-layer.component.d.ts +2 -2
  66. package/dist/map/map-plate/layers/feature-layer/feature-layer.settings.d.ts +36 -16
  67. package/dist/map/map-plate/layers/tile-layer/tile-layer.component.d.ts +1 -1
  68. package/dist/map/map-plate/layers/tile-layer/tile-layer.settings.d.ts +75 -0
  69. package/dist/map/map-plate/map-plate.component.d.ts +2 -2
  70. package/dist/map/map-plate/tooltips/tooltip/tooltip.component.d.ts +5 -5
  71. package/dist/map/map-plate/tooltips/tooltip/tooltip.settings.d.ts +1 -1
  72. package/dist/map/models/map-control.d.ts +1 -1
  73. package/dist/map/models/polygon.model.d.ts +2 -2
  74. package/dist/map/services/feature.service.d.ts +1 -1
  75. package/dist/map/services/map-click.service.d.ts +1 -1
  76. package/dist/src/map/helpers/marker-style.helper.d.ts +26 -0
  77. package/dist/src/map/helpers/polygon-style.helper.d.ts +21 -0
  78. package/dist/src/map/helpers/stringify-feature.helper.d.ts +18 -0
  79. package/dist/src/map/helpers/text-style.helper.d.ts +11 -0
  80. package/dist/src/map/map-plate/controls/map-control-zoom/map-control-zoom.component.d.ts +20 -3
  81. package/dist/src/map/map-plate/controls/map-control-zoom/zoom-control.settings.d.ts +71 -0
  82. package/dist/src/map/map-plate/features/markers/markers.component.d.ts +10 -0
  83. package/dist/src/map/map-plate/features/polygons/polygons.component.d.ts +10 -0
  84. package/dist/src/map/map-plate/layers/cluster-layer/cluster-layer.component.d.ts +10 -2
  85. package/dist/src/map/map-plate/layers/cluster-layer/cluster-layer.settings.d.ts +78 -0
  86. package/dist/src/map/map-plate/layers/feature-layer/feature-layer.component.d.ts +2 -2
  87. package/dist/src/map/map-plate/layers/feature-layer/feature-layer.settings.d.ts +36 -16
  88. package/dist/src/map/map-plate/layers/tile-layer/tile-layer.component.d.ts +1 -1
  89. package/dist/src/map/map-plate/layers/tile-layer/tile-layer.settings.d.ts +75 -0
  90. package/dist/src/map/map-plate/map-plate.component.d.ts +2 -2
  91. package/dist/src/map/map-plate/tooltips/tooltip/tooltip.component.d.ts +5 -5
  92. package/dist/src/map/map-plate/tooltips/tooltip/tooltip.settings.d.ts +1 -1
  93. package/dist/src/map/models/map-control.d.ts +1 -1
  94. package/dist/src/map/models/polygon.model.d.ts +2 -2
  95. package/dist/src/map/services/feature.service.d.ts +1 -1
  96. package/dist/src/map/services/map-click.service.d.ts +1 -1
  97. package/package.json +1 -1
@@ -3,7 +3,7 @@ import { Component, Injectable, ChangeDetectionStrategy, Input, ViewChild, NgMod
3
3
  import * as i4 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import { Feature, Collection } from 'ol';
6
- import { Point, LineString } from 'ol/geom';
6
+ import { Point } from 'ol/geom';
7
7
  import { GeoJSON, WKT } from 'ol/format';
8
8
  import { getCenter, createEmpty, extend } from 'ol/extent';
9
9
  import { Control, Zoom } from 'ol/control';
@@ -163,17 +163,6 @@ class PolygonModel {
163
163
  id;
164
164
  lat;
165
165
  lng;
166
- _feature;
167
- static fromGeoJson(id, json, info) {
168
- let feature = new GeoJSON().readFeature(json);
169
- feature.setId(id);
170
- return new PolygonModel(feature, id, info);
171
- }
172
- static fromWKT(id, wkt, info) {
173
- let feature = new WKT().readFeature(wkt);
174
- feature.setId(id);
175
- return new PolygonModel(feature, id, info);
176
- }
177
166
  constructor(feature, id, info) {
178
167
  this.info = info;
179
168
  this.id = id == null ? IdGenerator.get() : id;
@@ -182,9 +171,20 @@ class PolygonModel {
182
171
  this._feature?.set(MapConstants.FeatureInfo, this.info);
183
172
  [this.lng, this.lat] = getCenter(this._feature.getGeometry()?.getExtent());
184
173
  }
174
+ _feature;
185
175
  get feature() {
186
176
  return this._feature;
187
177
  }
178
+ static fromGeoJson(id, json, info) {
179
+ let feature = new GeoJSON().readFeature(json);
180
+ feature.setId(id);
181
+ return new PolygonModel(feature, id, info);
182
+ }
183
+ static fromWKT(id, wkt, info) {
184
+ let feature = new WKT().readFeature(wkt);
185
+ feature.setId(id);
186
+ return new PolygonModel(feature, id, info);
187
+ }
188
188
  }
189
189
 
190
190
  var DrawingType;
@@ -203,7 +203,7 @@ var FeatureOutputFormat;
203
203
 
204
204
  /**
205
205
  *
206
- * A control is a visible widget with a DOM element in a fixed position on the screen. They can involve user input (buttons), or be informational only; the position is determined using CSS. By default these are placed in the container with CSS class name ol-overlaycontainer-stopevent, but can use any outside DOM element.
206
+ * A control is a visible widget with a DOM element in a fixed position on the screen. They can involve user input (buttons), or be informational only; the position is determined using CSS. By default, these are placed in the container with CSS class name ol-overlaycontainer-stopevent, but can use any outside DOM element.
207
207
  * This is the base class for controls. You can use it for simple custom controls by creating the element with listeners, creating an instance:
208
208
  * var myControl = new Control({element: myElement}); and then adding this to the map.
209
209
  * The main advantage of having this as a control rather than a simple separate DOM element is that preventing propagation is handled for you. Controls will also be objects in a module:ol/Collection~Collection, so you can use their methods.
@@ -531,6 +531,11 @@ class FeatureService {
531
531
  static filterFeaturesInArea(query) {
532
532
  return query.features.filter((f) => FeatureService.booleanIntersects(query.area, f.getGeometry()));
533
533
  }
534
+ static calculateArea(g) {
535
+ if (!g)
536
+ return 0;
537
+ return Sphere.getArea(g, { projection: 'EPSG:4326' });
538
+ }
534
539
  static booleanIntersects(g1, g2) {
535
540
  if (g2.getType() === 'Point')
536
541
  return g1.intersectsCoordinate(g2.getCoordinates());
@@ -540,11 +545,6 @@ class FeatureService {
540
545
  return g1.intersectsCoordinate(g2.getInteriorPoint().getCoordinates());
541
546
  return false;
542
547
  }
543
- static calculateArea(g) {
544
- if (!g)
545
- return 0;
546
- return Sphere.getArea(g, { projection: 'EPSG:4326' });
547
- }
548
548
  }
549
549
 
550
550
  class GetFeaturesInAreaQuery extends PostboyCallbackMessage {
@@ -811,14 +811,6 @@ class MapClickService {
811
811
  up() {
812
812
  this.observeMapRender();
813
813
  }
814
- observeMapRender() {
815
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
816
- this.map = m.map;
817
- this.map?.on('singleclick', (e) => {
818
- this.postboy.fire(this.onClick(e));
819
- });
820
- });
821
- }
822
814
  onClick(ev) {
823
815
  const model = new MapClickEvent(ev.coordinate, {}, {});
824
816
  this.map?.forEachFeatureAtPixel(ev.pixel, (f, l) => {
@@ -836,6 +828,14 @@ class MapClickService {
836
828
  });
837
829
  return model;
838
830
  }
831
+ observeMapRender() {
832
+ this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
833
+ this.map = m.map;
834
+ this.map?.on('singleclick', (e) => {
835
+ this.postboy.fire(this.onClick(e));
836
+ });
837
+ });
838
+ }
839
839
  getFeatureCollectionWithInner(features) {
840
840
  const result = [];
841
841
  features?.forEach((f) => {
@@ -1102,12 +1102,51 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImpor
1102
1102
  type: Injectable
1103
1103
  }], ctorParameters: () => [{ type: MapPostboyService }, { type: MapManagementService }, { type: MapStateService }, { type: MapFeatureService }, { type: MapClickService }, { type: DrawingService }, { type: FeatureModificationService }, { type: ControlsService }] });
1104
1104
 
1105
+ /**
1106
+ * Class representing settings for a tile layer.
1107
+ */
1105
1108
  class TileLayerSettings {
1109
+ /**
1110
+ * The maximum zoom level for a map view.
1111
+ *
1112
+ * @type {number}
1113
+ * @default 19
1114
+ */
1106
1115
  maxZoom = 19;
1116
+ /**
1117
+ * The minimum zoom level allowed.
1118
+ *
1119
+ * @type {number}
1120
+ */
1107
1121
  minZoom = 0;
1122
+ /**
1123
+ * The opacity of an element.
1124
+ *
1125
+ * @type {number}
1126
+ * @default 0.6
1127
+ */
1108
1128
  opacity = 0.6;
1129
+ /**
1130
+ * Represents the tiles URL.
1131
+ * @typedef {string} url
1132
+ *
1133
+ * @example
1134
+ * 'https://example.ex/{z}/{x}/{y}.png'
1135
+ */
1109
1136
  url = '';
1137
+ /**
1138
+ * The projection of the coordinate system.
1139
+ *
1140
+ * @type {string}
1141
+ * @default 'EPSG:3857'
1142
+ */
1110
1143
  projection = 'EPSG:3857';
1144
+ /**
1145
+ * Creates a copy of the given tile layer settings.
1146
+ *
1147
+ * @param {TileLayerSettings} model - The tile layer settings to be copied.
1148
+ * @return {TileLayerSettings} - A new instance of TileLayerSettings with the same properties as the model.
1149
+ */
1111
1150
  static copy(model) {
1112
1151
  const result = new TileLayerSettings();
1113
1152
  result.maxZoom = model.maxZoom;
@@ -1117,21 +1156,57 @@ class TileLayerSettings {
1117
1156
  result.url = model.url;
1118
1157
  return result;
1119
1158
  }
1159
+ /**
1160
+ * Sets the URL of the TileLayerSettings object.
1161
+ *
1162
+ * @param {string} url - The URL to be set.
1163
+ * @return {TileLayerSettings} - The updated TileLayerSettings object.
1164
+ */
1120
1165
  setUrl(url) {
1121
1166
  return TileLayerSettings.copy({ ...this, url });
1122
1167
  }
1168
+ /**
1169
+ * Sets the maximum zoom level for the tile layer.
1170
+ *
1171
+ * @param {number} maxZoom - The maximum zoom level.
1172
+ * @returns {TileLayerSettings} - The updated tile layer settings object.
1173
+ */
1123
1174
  setMaxZoom(maxZoom) {
1124
1175
  return TileLayerSettings.copy({ ...this, maxZoom });
1125
1176
  }
1177
+ /**
1178
+ * Sets the minimum zoom level for the Tile Layer.
1179
+ *
1180
+ * @param {number} minZoom - The minimum zoom level to be set.
1181
+ * @return {TileLayerSettings} The modified TileLayerSettings object with the updated minimum zoom level.
1182
+ */
1126
1183
  setMinZoom(minZoom) {
1127
1184
  return TileLayerSettings.copy({ ...this, minZoom });
1128
1185
  }
1186
+ /**
1187
+ * Sets the opacity of the TileLayerSettings.
1188
+ *
1189
+ * @param {number} opacity - The opacity value to set. Must be a number between 0 and 1.
1190
+ * @return {TileLayerSettings} - A new instance of TileLayerSettings with the opacity set.
1191
+ */
1129
1192
  setOpacity(opacity) {
1130
1193
  return TileLayerSettings.copy({ ...this, opacity });
1131
1194
  }
1195
+ /**
1196
+ * Sets the projection for the tile layer settings.
1197
+ *
1198
+ * @param {string} projection - The desired projection for the tile layer settings.
1199
+ * @return {TileLayerSettings} - The updated tile layer settings with the new projection.
1200
+ */
1132
1201
  setProjection(projection) {
1133
1202
  return TileLayerSettings.copy({ ...this, projection });
1134
1203
  }
1204
+ /**
1205
+ * Checks if the current instance of TileLayerSettings is equal to the given model.
1206
+ * @param {TileLayerSettings} model - The model to compare against.
1207
+ * @return {boolean} - True if all properties of the current instance matches the properties of the model;
1208
+ * otherwise, false.
1209
+ */
1135
1210
  isSame(model) {
1136
1211
  if (this.maxZoom !== model.maxZoom)
1137
1212
  return false;
@@ -1201,12 +1276,6 @@ class TileLayerComponent extends DestructibleComponent {
1201
1276
  this.postboy = postboy;
1202
1277
  this.factory = factory;
1203
1278
  }
1204
- ngOnInit() {
1205
- this.postboy
1206
- .subscribe(MapRenderedEvent.ID)
1207
- .pipe(filter((m) => !!m), first())
1208
- .subscribe((m) => this.initLayer());
1209
- }
1210
1279
  _settings = new TileLayerSettings();
1211
1280
  set settings(value) {
1212
1281
  if (!value || this._settings.isSame(value))
@@ -1214,6 +1283,12 @@ class TileLayerComponent extends DestructibleComponent {
1214
1283
  this._settings = value;
1215
1284
  this.initLayer();
1216
1285
  }
1286
+ ngOnInit() {
1287
+ this.postboy
1288
+ .subscribe(MapRenderedEvent.ID)
1289
+ .pipe(filter((m) => !!m), first())
1290
+ .subscribe((m) => this.initLayer());
1291
+ }
1217
1292
  onDestroy = () => this.removeLayer();
1218
1293
  initLayer() {
1219
1294
  this.removeLayer();
@@ -1299,11 +1374,16 @@ class FeatureLayerSettings {
1299
1374
  */
1300
1375
  zIndex = 1;
1301
1376
  /**
1302
- * The maximum zoom at which the layer is visible. 19 by default
1377
+ The maximum view zoom level (inclusive) at which this layer will be visible.
1378
+
1379
+ @type {number}
1380
+ @default 19
1303
1381
  */
1304
1382
  maxZoom = 19;
1305
1383
  /**
1306
- * The minimum zoom at which the layer is visible. 0 by default
1384
+ The minimum view zoom level (exclusive) at which this layer will be visible.
1385
+
1386
+ @type {number}
1307
1387
  */
1308
1388
  minZoom = 0;
1309
1389
  /**
@@ -1311,8 +1391,10 @@ class FeatureLayerSettings {
1311
1391
  */
1312
1392
  style;
1313
1393
  /**
1314
- * Creates a clone of the existing settings
1315
- * @param model
1394
+ * Copies the given FeatureLayerSettings object
1395
+ *
1396
+ * @param {FeatureLayerSettings} model - The FeatureLayerSettings object to be copied
1397
+ * @returns {FeatureLayerSettings} - A copy of the FeatureLayerSettings object
1316
1398
  */
1317
1399
  static copy(model) {
1318
1400
  const result = new FeatureLayerSettings();
@@ -1324,43 +1406,56 @@ class FeatureLayerSettings {
1324
1406
  return result;
1325
1407
  }
1326
1408
  /**
1327
- Setter for {@link FeatureLayerSettings.zIndex}
1328
- * @param zIndex
1409
+ * Sets the z-index value for the FeatureLayerSettings object.
1410
+ *
1411
+ * @param {number} zIndex - The new z-index value.
1412
+ * @return {FeatureLayerSettings} - The updated FeatureLayerSettings object.
1329
1413
  */
1330
1414
  setZIndex(zIndex) {
1331
1415
  return FeatureLayerSettings.copy({ ...this, zIndex });
1332
1416
  }
1333
1417
  /**
1334
- * Setter for {@link FeatureLayerSettings.name}
1335
- * @param name
1418
+ * Sets the name of the FeatureLayerSettings.
1419
+ *
1420
+ * @param {string} name - The name to set for the FeatureLayerSettings.
1421
+ *
1422
+ * @return {FeatureLayerSettings} - The updated FeatureLayerSettings object with the new name.
1336
1423
  */
1337
1424
  setName(name) {
1338
1425
  return FeatureLayerSettings.copy({ ...this, name });
1339
1426
  }
1340
1427
  /**
1341
- * Setter for {@link FeatureLayerSettings.maxZoom}
1342
- * @param maxZoom
1428
+ * Sets the maximum zoom level for the FeatureLayerSettings.
1429
+ *
1430
+ * @param {number} maxZoom - The maximum zoom level.
1431
+ * @return {FeatureLayerSettings} - The updated FeatureLayerSettings object.
1343
1432
  */
1344
1433
  setMaxZoom(maxZoom) {
1345
1434
  return FeatureLayerSettings.copy({ ...this, maxZoom });
1346
1435
  }
1347
1436
  /**
1348
- * Setter for {@link FeatureLayerSettings.minZoom}
1349
- * @param minZoom
1437
+ * Sets the minimum zoom level for the feature layer.
1438
+ *
1439
+ * @param {number} minZoom The minimum zoom level to be set.
1440
+ * @returns {FeatureLayerSettings} The updated feature layer settings object.
1350
1441
  */
1351
1442
  setMinZoom(minZoom) {
1352
1443
  return FeatureLayerSettings.copy({ ...this, minZoom });
1353
1444
  }
1354
1445
  /**
1355
- * Setter for {@link FeatureLayerSettings.style}
1356
- * @param style
1446
+ * Sets the style for the FeatureLayerSettings object.
1447
+ *
1448
+ * @param {Style | StyleFunction} style - The new style to set. It can be either a Style object or a StyleFunction.
1449
+ * @return {FeatureLayerSettings} - The updated FeatureLayerSettings object with the new style.
1357
1450
  */
1358
1451
  setStyle(style) {
1359
1452
  return FeatureLayerSettings.copy({ ...this, style });
1360
1453
  }
1361
1454
  /**
1362
- * Checks if the model has the same content
1363
- * @param model - the object to compare
1455
+ * Checks if the given FeatureLayerSettings object is identical to the current object.
1456
+ *
1457
+ * @param {FeatureLayerSettings} model - The FeatureLayerSettings object to compare with.
1458
+ * @return {boolean} - Returns true if the given object is identical to the current object, otherwise false.
1364
1459
  */
1365
1460
  isSame(model) {
1366
1461
  if (this.maxZoom !== model.maxZoom)
@@ -1405,24 +1500,24 @@ class FeatureLayerComponent extends DestructibleComponent {
1405
1500
  postboy;
1406
1501
  factory;
1407
1502
  layer = null;
1408
- _settings = new FeatureLayerSettings();
1409
1503
  constructor(postboy, factory) {
1410
1504
  super();
1411
1505
  this.postboy = postboy;
1412
1506
  this.factory = factory;
1413
1507
  }
1414
- ngOnInit() {
1415
- this.postboy
1416
- .subscribe(MapRenderedEvent.ID)
1417
- .pipe(filter((m) => !!m), first())
1418
- .subscribe((m) => this.initLayer());
1419
- }
1508
+ _settings = new FeatureLayerSettings();
1420
1509
  set settings(value) {
1421
1510
  if (!value || this._settings.isSame(value))
1422
1511
  return;
1423
1512
  this._settings = value;
1424
1513
  this.initLayer();
1425
1514
  }
1515
+ ngOnInit() {
1516
+ this.postboy
1517
+ .subscribe(MapRenderedEvent.ID)
1518
+ .pipe(filter((m) => !!m), first())
1519
+ .subscribe((m) => this.initLayer());
1520
+ }
1426
1521
  onDestroy = () => this.removeLayer();
1427
1522
  initLayer() {
1428
1523
  this.removeLayer();
@@ -1446,12 +1541,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImpor
1446
1541
  class ClusterLayerSettings {
1447
1542
  name = IdGenerator.get();
1448
1543
  zIndex = 1;
1544
+ /**
1545
+ * The maximum view zoom level (inclusive) at which this layer will be visible.
1546
+ *
1547
+ * @type {number}
1548
+ * @default 19
1549
+ */
1449
1550
  maxZoom = 19;
1551
+ /**
1552
+ * The minimum view zoom level (exclusive) at which this layer will be visible.
1553
+ *
1554
+ * @type {number}
1555
+ */
1450
1556
  minZoom = 0;
1557
+ /**
1558
+ * Distance in pixels within which features will be clustered together.
1559
+ *
1560
+ * @type {number}
1561
+ */
1451
1562
  distance = 20;
1452
1563
  bbox = false;
1453
1564
  clusterCancel = 14;
1454
1565
  style;
1566
+ /**
1567
+ * Creates a copy of the given ClusterLayerSettings object.
1568
+ *
1569
+ * @param {ClusterLayerSettings} model - The ClusterLayerSettings object to be copied.
1570
+ * @returns {ClusterLayerSettings} - A new ClusterLayerSettings object that is a copy of the original object.
1571
+ */
1455
1572
  static copy(model) {
1456
1573
  const result = new ClusterLayerSettings();
1457
1574
  result.name = model.name;
@@ -1464,30 +1581,86 @@ class ClusterLayerSettings {
1464
1581
  result.style = model.style;
1465
1582
  return result;
1466
1583
  }
1584
+ /**
1585
+ * Set the z-index for the ClusterLayer.
1586
+ *
1587
+ * @param {number} zIndex - The new z-index for the ClusterLayer.
1588
+ * @return {ClusterLayerSettings} - The updated ClusterLayerSettings object.
1589
+ */
1467
1590
  setZIndex(zIndex) {
1468
1591
  return ClusterLayerSettings.copy({ ...this, zIndex });
1469
1592
  }
1593
+ /**
1594
+ * Sets the distance value for ClusterLayerSettings.
1595
+ *
1596
+ * @param {number} distance - The distance value to be set.
1597
+ * @return {ClusterLayerSettings} - The modified ClusterLayerSettings object.
1598
+ */
1470
1599
  setDistance(distance) {
1471
1600
  return ClusterLayerSettings.copy({ ...this, distance });
1472
1601
  }
1602
+ /**
1603
+ * Sets the name of the ClusterLayerSettings object.
1604
+ *
1605
+ * @param {string} name - The name to set for the ClusterLayerSettings.
1606
+ * @return {ClusterLayerSettings} - A new ClusterLayerSettings object with the updated name.
1607
+ */
1473
1608
  setName(name) {
1474
1609
  return ClusterLayerSettings.copy({ ...this, name });
1475
1610
  }
1611
+ /**
1612
+ * Sets the maximum zoom level for the Cluster Layer.
1613
+ *
1614
+ * @param {number} maxZoom - The maximum zoom level to be set.
1615
+ * @return {ClusterLayerSettings} - The updated ClusterLayerSettings object.
1616
+ */
1476
1617
  setMaxZoom(maxZoom) {
1477
1618
  return ClusterLayerSettings.copy({ ...this, maxZoom });
1478
1619
  }
1620
+ /**
1621
+ * Sets the minimum zoom level for the ClusterLayerSettings.
1622
+ *
1623
+ * @param {number} minZoom - The minimum zoom level to set.
1624
+ * @return {ClusterLayerSettings} - The updated ClusterLayerSettings object.
1625
+ */
1479
1626
  setMinZoom(minZoom) {
1480
1627
  return ClusterLayerSettings.copy({ ...this, minZoom });
1481
1628
  }
1629
+ /**
1630
+ * Sets the cluster cancel number for the ClusterLayerSettings.
1631
+ *
1632
+ * @param {number} clusterCancel - The new cluster cancel number.
1633
+ * @returns {ClusterLayerSettings} - The updated ClusterLayerSettings object.
1634
+ */
1482
1635
  setClusterCancel(clusterCancel) {
1483
1636
  return ClusterLayerSettings.copy({ ...this, clusterCancel });
1484
1637
  }
1638
+ /**
1639
+ * Sets the value of 'bbox' property in the ClusterLayerSettings object.
1640
+ *
1641
+ * @param {boolean} bbox - A boolean value indicating whether to include bounding box calculation in the cluster layer settings.
1642
+ * @returns {ClusterLayerSettings} - The updated ClusterLayerSettings object with the newly set 'bbox' value.
1643
+ */
1485
1644
  setBbox(bbox) {
1486
1645
  return ClusterLayerSettings.copy({ ...this, bbox });
1487
1646
  }
1647
+ /**
1648
+ * Sets the style for the ClusterLayerSettings.
1649
+ *
1650
+ * @param {function} style - A function that takes an array of identified features as input and returns a Style or StyleFunction.
1651
+ *
1652
+ * @return {ClusterLayerSettings} - The updated ClusterLayerSettings object with the new style applied.
1653
+ */
1488
1654
  setStyle(style) {
1489
1655
  return ClusterLayerSettings.copy({ ...this, style });
1490
1656
  }
1657
+ /**
1658
+ * Checks if the current ClusterLayerSettings object is the same as the specified model.
1659
+ *
1660
+ * @param {ClusterLayerSettings} model - The model to compare with the current object.
1661
+ *
1662
+ * @return {boolean} - Returns true if the current ClusterLayerSettings object is the same as the specified model, otherwise false.
1663
+ */
1491
1664
  isSame(model) {
1492
1665
  if (this.maxZoom !== model.maxZoom)
1493
1666
  return false;
@@ -1592,28 +1765,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImpor
1592
1765
  }]
1593
1766
  }] });
1594
1767
 
1768
+ /**
1769
+ * Represents a cluster layer component.
1770
+ */
1595
1771
  class ClusterLayerComponent extends DestructibleComponent {
1596
1772
  postboy;
1597
1773
  factory;
1598
1774
  manager = null;
1599
- _settings = new ClusterLayerSettings();
1600
1775
  constructor(postboy, factory) {
1601
1776
  super();
1602
1777
  this.postboy = postboy;
1603
1778
  this.factory = factory;
1604
1779
  }
1605
- ngOnInit() {
1606
- this.postboy
1607
- .subscribe(MapRenderedEvent.ID)
1608
- .pipe(filter((m) => !!m), first())
1609
- .subscribe((m) => this.initLayer());
1610
- }
1780
+ _settings = new ClusterLayerSettings();
1781
+ /**
1782
+ * Sets the settings for the cluster layer.
1783
+ *
1784
+ * @param {ClusterLayerSettings | undefined} value - The settings for the cluster layer.
1785
+ */
1611
1786
  set settings(value) {
1612
1787
  if (!value || this._settings.isSame(value))
1613
1788
  return;
1614
1789
  this._settings = value;
1615
1790
  this.initLayer();
1616
1791
  }
1792
+ ngOnInit() {
1793
+ this.postboy
1794
+ .subscribe(MapRenderedEvent.ID)
1795
+ .pipe(filter((m) => !!m), first())
1796
+ .subscribe((m) => this.initLayer());
1797
+ }
1617
1798
  onDestroy = () => this.removeLayer();
1618
1799
  initLayer() {
1619
1800
  this.removeLayer();
@@ -1665,6 +1846,7 @@ class MapPlateComponent extends DestructibleComponent {
1665
1846
  detector;
1666
1847
  map;
1667
1848
  osmUrl = '';
1849
+ drawingLayerSettings = new FeatureLayerSettings().setName(MapConstants.DrawingLayerId);
1668
1850
  constructor(elementRef, postboy, mapFactory, registrator, detector) {
1669
1851
  super();
1670
1852
  this.elementRef = elementRef;
@@ -1675,7 +1857,6 @@ class MapPlateComponent extends DestructibleComponent {
1675
1857
  registrator.up();
1676
1858
  }
1677
1859
  _settings = new MapSettings();
1678
- drawingLayerSettings = new FeatureLayerSettings().setName(MapConstants.DrawingLayerId);
1679
1860
  set settings(value) {
1680
1861
  if (!value || this._settings.isSame(value))
1681
1862
  return;
@@ -1693,6 +1874,9 @@ class MapPlateComponent extends DestructibleComponent {
1693
1874
  });
1694
1875
  this.setOsm();
1695
1876
  }
1877
+ onDestroy = () => {
1878
+ this.registrator.down();
1879
+ };
1696
1880
  setOsm() {
1697
1881
  if (!this.map)
1698
1882
  return;
@@ -1700,9 +1884,6 @@ class MapPlateComponent extends DestructibleComponent {
1700
1884
  this.detector.detectChanges();
1701
1885
  this.map.updateSize();
1702
1886
  }
1703
- onDestroy = () => {
1704
- this.registrator.down();
1705
- };
1706
1887
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapPlateComponent, deps: [{ token: i0.ElementRef }, { token: MapPostboyService }, { token: MapPlateFactory }, { token: MessageRegistratorService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1707
1888
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: MapPlateComponent, selector: "art-map-plate", inputs: { settings: "settings" }, providers: [
1708
1889
  MessageRegistratorService,
@@ -1735,6 +1916,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImpor
1735
1916
  type: Input
1736
1917
  }] } });
1737
1918
 
1919
+ /**
1920
+ * MarkersComponent is a component that displays markers on a map.
1921
+ * It listens for changes in the `markers` input property and
1922
+ * automatically puts the markers on the map using the MapPostboyService.
1923
+ */
1738
1924
  class MarkersComponent extends DestructibleComponent {
1739
1925
  postboy;
1740
1926
  layerName = '';
@@ -1743,6 +1929,11 @@ class MarkersComponent extends DestructibleComponent {
1743
1929
  this.postboy = postboy;
1744
1930
  }
1745
1931
  _markers = [];
1932
+ /**
1933
+ * Sets the markers property.
1934
+ *
1935
+ * @param {MarkerModel[]} value - The array of MarkerModel objects to set as markers.
1936
+ */
1746
1937
  set markers(value) {
1747
1938
  this._markers = value ?? [];
1748
1939
  this.putMarkers();
@@ -1773,7 +1964,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImpor
1773
1964
  class TooltipSettings {
1774
1965
  id;
1775
1966
  containerClass = 'custom-tooltip-class';
1776
- show = (e) => true;
1777
1967
  constructor(id) {
1778
1968
  this.id = id ?? IdGenerator.get();
1779
1969
  }
@@ -1783,6 +1973,7 @@ class TooltipSettings {
1783
1973
  result.containerClass = model.containerClass;
1784
1974
  return result;
1785
1975
  }
1976
+ show = (e) => true;
1786
1977
  setShow(show) {
1787
1978
  return TooltipSettings.copy({ ...this, show });
1788
1979
  }
@@ -1804,26 +1995,41 @@ class TooltipComponent extends DestructibleComponent {
1804
1995
  postboy;
1805
1996
  detector;
1806
1997
  container;
1807
- _settings = new TooltipSettings();
1808
- map;
1809
1998
  overlay;
1810
1999
  show = false;
2000
+ map;
2001
+ constructor(postboy, detector) {
2002
+ super();
2003
+ this.postboy = postboy;
2004
+ this.detector = detector;
2005
+ }
2006
+ _settings = new TooltipSettings();
1811
2007
  set settings(value) {
1812
2008
  if (!value || this._settings.isSame(value))
1813
2009
  return;
1814
2010
  this._settings = value;
1815
2011
  this.detector.detectChanges();
1816
2012
  }
1817
- constructor(postboy, detector) {
1818
- super();
1819
- this.postboy = postboy;
1820
- this.detector = detector;
1821
- }
1822
2013
  ngOnInit() {
1823
2014
  this.subs.push(this.observeMapRender());
1824
2015
  this.subs.push(this.observeMapClick());
1825
2016
  this.subs.push(this.observeClose());
1826
2017
  }
2018
+ addOverlay(coordinates) {
2019
+ this.removeOverlay();
2020
+ this.overlay = new Overlay(this.options(coordinates));
2021
+ this.map?.addOverlay(this.overlay);
2022
+ this.show = true;
2023
+ this.detector.detectChanges();
2024
+ }
2025
+ options = (coordinates) => {
2026
+ return {
2027
+ element: this.container?.nativeElement,
2028
+ autoPan: false,
2029
+ autoPanAnimation: { duration: 0 },
2030
+ position: coordinates,
2031
+ };
2032
+ };
1827
2033
  observeMapClick() {
1828
2034
  return this.postboy.subscribe(MapClickEvent.ID).subscribe((ev) => {
1829
2035
  this._settings.show(ev) ? this.addOverlay(ev.coordinates) : this.removeOverlay();
@@ -1844,21 +2050,6 @@ class TooltipComponent extends DestructibleComponent {
1844
2050
  !!this.overlay && this.map?.removeOverlay(this.overlay);
1845
2051
  this.show = false;
1846
2052
  };
1847
- addOverlay(coordinates) {
1848
- this.removeOverlay();
1849
- this.overlay = new Overlay(this.options(coordinates));
1850
- this.map?.addOverlay(this.overlay);
1851
- this.show = true;
1852
- this.detector.detectChanges();
1853
- }
1854
- options = (coordinates) => {
1855
- return {
1856
- element: this.container?.nativeElement,
1857
- autoPan: false,
1858
- autoPanAnimation: { duration: 0 },
1859
- position: coordinates,
1860
- };
1861
- };
1862
2053
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: TooltipComponent, deps: [{ token: MapPostboyService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1863
2054
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: TooltipComponent, selector: "art-tooltip", inputs: { settings: "settings" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["tip"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div #tip [class]=\"['tooltip-wrapper', _settings.containerClass]\" [hidden]=\"!show\">\r\n <ng-content></ng-content>\r\n</div>\r\n", styles: [".tooltip-wrapper{position:absolute}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1864
2055
  }
@@ -1872,6 +2063,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImpor
1872
2063
  type: Input
1873
2064
  }] } });
1874
2065
 
2066
+ /**
2067
+ * Component for rendering polygons on a map.
2068
+ * It listens for changes in the `polygons` input property and
2069
+ * automatically puts the polygons on the map using the MapPostboyService.
2070
+ */
1875
2071
  class PolygonsComponent extends DestructibleComponent {
1876
2072
  postboy;
1877
2073
  layerName = '';
@@ -1880,6 +2076,11 @@ class PolygonsComponent extends DestructibleComponent {
1880
2076
  this.postboy = postboy;
1881
2077
  }
1882
2078
  _polygons = [];
2079
+ /**
2080
+ * Sets the value of polygons.
2081
+ *
2082
+ * @param {PolygonModel[]} value - The new value for polygons.
2083
+ */
1883
2084
  set polygons(value) {
1884
2085
  this._polygons = value ?? [];
1885
2086
  this.putPolygons();
@@ -1907,12 +2108,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImpor
1907
2108
  type: Input
1908
2109
  }] } });
1909
2110
 
2111
+ /**
2112
+ * Represents the settings for a zoom control.
2113
+ */
1910
2114
  class ZoomControlSettings {
2115
+ /**
2116
+ * The CSS class name of the control element.
2117
+ *
2118
+ * @type {string}
2119
+ */
1911
2120
  controlClass = 'ol-zoom';
2121
+ /**
2122
+ * The CSS class name for zoom in button.
2123
+ * @type {string}
2124
+ */
1912
2125
  zoomInClass = 'ol-zoom-in';
2126
+ /**
2127
+ * The CSS class name for the zoom out button element.
2128
+ *
2129
+ * @type {string}
2130
+ */
1913
2131
  zoomOutClass = 'ol-zoom-out';
2132
+ /**
2133
+ * The label for the zoom in action.
2134
+ *
2135
+ * @type {string}
2136
+ */
1914
2137
  zoomInLabel = 'Zoom In';
2138
+ /**
2139
+ * The label for the zoom out control.
2140
+ *
2141
+ * @type {string}
2142
+ */
1915
2143
  zoomOutLabel = 'Zoom Out';
2144
+ /**
2145
+ * Copies the provided ZoomControlSettings object.
2146
+ *
2147
+ * @param {ZoomControlSettings} model - The ZoomControlSettings object to be copied.
2148
+ * @return {ZoomControlSettings} - The copied ZoomControlSettings object.
2149
+ */
1916
2150
  static copy(model) {
1917
2151
  const result = new ZoomControlSettings();
1918
2152
  result.controlClass = model.controlClass;
@@ -1922,6 +2156,13 @@ class ZoomControlSettings {
1922
2156
  result.zoomOutLabel = model.zoomOutLabel;
1923
2157
  return result;
1924
2158
  }
2159
+ /**
2160
+ * Checks if the current ZoomControlSettings object is equal to the given model.
2161
+ *
2162
+ * @param {ZoomControlSettings} model - The ZoomControlSettings object to compare with.
2163
+ *
2164
+ * @return {boolean} - true if the current object is equal to the given model, false otherwise.
2165
+ */
1925
2166
  isSame(model) {
1926
2167
  if (this.zoomInClass !== model.zoomInClass)
1927
2168
  return false;
@@ -1935,38 +2176,86 @@ class ZoomControlSettings {
1935
2176
  return false;
1936
2177
  return true;
1937
2178
  }
2179
+ /**
2180
+ * Sets the zoom in label of the Zoom Control Settings.
2181
+ *
2182
+ * @param {string} zoomInLabel - The label for the zoom in button.
2183
+ * @return {ZoomControlSettings} - The new Zoom Control Settings object with the updated zoom in label.
2184
+ */
1938
2185
  setZoomInLabel(zoomInLabel) {
1939
2186
  return ZoomControlSettings.copy({ ...this, zoomInLabel });
1940
2187
  }
2188
+ /**
2189
+ * Sets the zoomOutClass property of the ZoomControlSettings object.
2190
+ *
2191
+ * @param {string} zoomOutClass - The CSS class to be assigned to the zoom out button.
2192
+ * @return {ZoomControlSettings} - The updated ZoomControlSettings object with the new zoomOutClass value.
2193
+ */
1941
2194
  setZoomOutClass(zoomOutClass) {
1942
2195
  return ZoomControlSettings.copy({ ...this, zoomOutClass });
1943
2196
  }
2197
+ /**
2198
+ * Sets the zoom in class for the zoom control settings.
2199
+ *
2200
+ * @param {string} zoomInClass - The new zoom in class to be set.
2201
+ * @return {ZoomControlSettings} - The updated zoom control settings.
2202
+ */
1944
2203
  setZoomInClass(zoomInClass) {
1945
2204
  return ZoomControlSettings.copy({ ...this, zoomInClass });
1946
2205
  }
2206
+ /**
2207
+ * Set the label for the zoom out control.
2208
+ *
2209
+ * @param {string} zoomOutLabel - The label for the zoom out control.
2210
+ * @returns {ZoomControlSettings} - The updated zoom control settings.
2211
+ */
1947
2212
  setZoomOutLabel(zoomOutLabel) {
1948
2213
  return ZoomControlSettings.copy({ ...this, zoomOutLabel });
1949
2214
  }
2215
+ /**
2216
+ * Sets the control class for the ZoomControlSettings.
2217
+ *
2218
+ * @param {string} controlClass - The class name of the control to be set.
2219
+ *
2220
+ * @return {ZoomControlSettings} - The modified ZoomControlSettings object.
2221
+ */
1950
2222
  setControlClass(controlClass) {
1951
2223
  return ZoomControlSettings.copy({ ...this, controlClass });
1952
2224
  }
1953
2225
  }
1954
2226
 
2227
+ /**
2228
+ * @class
2229
+ * @classdesc Represents a component for the Zoom control on a map.
2230
+ * @extends DestructibleComponent
2231
+ * @implements OnInit
2232
+ */
1955
2233
  class MapControlZoomComponent extends DestructibleComponent {
1956
2234
  postboy;
1957
- _settings = new ZoomControlSettings();
1958
2235
  map;
1959
2236
  control;
2237
+ constructor(postboy) {
2238
+ super();
2239
+ this.postboy = postboy;
2240
+ }
2241
+ _settings = new ZoomControlSettings();
2242
+ /**
2243
+ * Sets the settings for the Zoom Control.
2244
+ *
2245
+ * @param {ZoomControlSettings | undefined} value - The new settings for the Zoom Control.
2246
+ *
2247
+ * @description
2248
+ * This method sets the settings for the Zoom Control. It takes a parameter `value` which should be an object of type `ZoomControlSettings` or `undefined`.
2249
+ *
2250
+ * If the `value` is `undefined` or the same as the current settings, the method will return without making any changes.
2251
+ *
2252
+ */
1960
2253
  set settings(value) {
1961
2254
  if (!value || this._settings.isSame(value))
1962
2255
  return;
1963
2256
  this._settings = value;
1964
2257
  this.setControl();
1965
2258
  }
1966
- constructor(postboy) {
1967
- super();
1968
- this.postboy = postboy;
1969
- }
1970
2259
  ngOnInit() {
1971
2260
  this.postboy
1972
2261
  .subscribe(MapRenderedEvent.ID)
@@ -1976,15 +2265,15 @@ class MapControlZoomComponent extends DestructibleComponent {
1976
2265
  this.setControl();
1977
2266
  });
1978
2267
  }
2268
+ onDestroy = () => {
2269
+ this.eliminate();
2270
+ };
1979
2271
  setControl() {
1980
2272
  if (!this.map)
1981
2273
  return;
1982
2274
  this.control = this.postboy.execute(new GenerateZoomControlExecutor(this._settings));
1983
2275
  this.map.addControl(this.control);
1984
2276
  }
1985
- onDestroy = () => {
1986
- this.eliminate();
1987
- };
1988
2277
  eliminate = () => !!this.map && !!this.control && this.map.removeControl(this.control);
1989
2278
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapControlZoomComponent, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Component });
1990
2279
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: MapControlZoomComponent, selector: "art-map-control-zoom", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
@@ -2046,7 +2335,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImpor
2046
2335
  }]
2047
2336
  }] });
2048
2337
 
2338
+ /**
2339
+ * Helper class to create and modify marker styles.
2340
+ */
2049
2341
  class MarkerStyleHelper {
2342
+ /**
2343
+ * Creates a new Style object from an SVG.
2344
+ * @param {string} svg - The SVG string.
2345
+ * @param {Array<number>} [size=[30, 30]] - The size of the icon image.
2346
+ * @param {number} [zIndex=400] - The zIndex of the style.
2347
+ * @returns {Style} A new Style object.
2348
+ */
2050
2349
  static fromSvg(svg, size = [30, 30], zIndex = 400) {
2051
2350
  let image = new Image();
2052
2351
  image.src = 'data:image/svg+xml,' + escape(svg);
@@ -2058,6 +2357,15 @@ class MarkerStyleHelper {
2058
2357
  zIndex,
2059
2358
  });
2060
2359
  }
2360
+ /**
2361
+ * Returns a Style object with a circle style.
2362
+ *
2363
+ * @param {number} radius - The radius of the circle.
2364
+ * @param {string} fill - The fill color of the circle. Format: '#RRGGBB' or 'rgba(R, G, B, A)'.
2365
+ * @param {string} strokeColor - The stroke color of the circle. Format: '#RRGGBB' or 'rgba(R, G, B, A)'.
2366
+ * @param {number} [strokeWidth=1] - The width of the stroke. Default is 1.
2367
+ * @returns {Style} - A Style object with a Circle image.
2368
+ */
2061
2369
  static circle(radius, fill, strokeColor, strokeWidth = 1) {
2062
2370
  return new Style({
2063
2371
  image: new Circle({
@@ -2067,13 +2375,32 @@ class MarkerStyleHelper {
2067
2375
  }),
2068
2376
  });
2069
2377
  }
2378
+ /**
2379
+ * Applies the given Text to the provided Style.
2380
+ *
2381
+ * @param {Style} style - The Style to modify.
2382
+ * @param {Text} text - The Text to apply to the Style.
2383
+ * @return {Style} - The modified Style with the applied Text.
2384
+ */
2070
2385
  static withText(style, text) {
2071
2386
  style.setText(text);
2072
2387
  return style;
2073
2388
  }
2074
2389
  }
2075
2390
 
2391
+ /**
2392
+ * A helper class for creating polygon styles.
2393
+ * @class
2394
+ */
2076
2395
  class PolygonStyleHelper {
2396
+ /**
2397
+ * Creates a Style object with the given fill color, stroke color, and stroke width.
2398
+ *
2399
+ * @param {string} fill - The fill color in hexadecimal or RGB format.
2400
+ * @param {string} stroke - The stroke color in hexadecimal or RGB format.
2401
+ * @param {number} [strokeWidth=1] - The width of the stroke. Defaults to 1.
2402
+ * @return {Style} The created Style object.
2403
+ */
2077
2404
  static simple(fill, stroke, strokeWidth = 1) {
2078
2405
  return new Style({
2079
2406
  fill: new Fill({
@@ -2085,6 +2412,15 @@ class PolygonStyleHelper {
2085
2412
  }),
2086
2413
  });
2087
2414
  }
2415
+ /**
2416
+ * Creates a new Style object with the given fill, stroke, stroke width, and pin radius.
2417
+ *
2418
+ * @param {string} fill - The color to use for the fill of the style.
2419
+ * @param {string} stroke - The color to use for the stroke of the style.
2420
+ * @param {number} [strokeWidth=1] - The width of the stroke. Defaults to 1.
2421
+ * @param {number} [pinRadius=5] - The radius of the circle used as the image for the style. Defaults to 5.
2422
+ * @returns {Style} - The newly created Style object.
2423
+ */
2088
2424
  static edit(fill, stroke, strokeWidth = 1, pinRadius = 5) {
2089
2425
  return new Style({
2090
2426
  image: new Circle({
@@ -2104,7 +2440,18 @@ class PolygonStyleHelper {
2104
2440
  }
2105
2441
  }
2106
2442
 
2443
+ /**
2444
+ * Helper class for creating text styles.
2445
+ */
2107
2446
  class TextStyleHelper {
2447
+ /**
2448
+ * Creates a new instance of the Text class with the specified properties.
2449
+ *
2450
+ * @param {string} text - The text content of the Text object.
2451
+ * @param {string} font - The font style of the Text object.
2452
+ * @param {string} color - The color of the Text object.
2453
+ * @return {Text} A new instance of the Text class.
2454
+ */
2108
2455
  static get(text, font, color) {
2109
2456
  return new Text({
2110
2457
  text: text,
@@ -2117,37 +2464,41 @@ class TextStyleHelper {
2117
2464
  }
2118
2465
  }
2119
2466
 
2467
+ /**
2468
+ * A helper class for converting and stringify features.
2469
+ */
2120
2470
  class StringifyFeatureHelper {
2121
2471
  static polygon(feature, format = FeatureOutputFormat.GeoJson) {
2122
2472
  return format === FeatureOutputFormat.GeoJson
2123
2473
  ? new GeoJSON().writeFeature(feature)
2124
2474
  : new WKT().writeFeature(feature);
2125
2475
  }
2476
+ /**
2477
+ * Creates a polygon feature representing a circle based on a given feature with a circle geometry.
2478
+ *
2479
+ * @param {Feature<Geometry>} feature - The input feature with a circle geometry.
2480
+ * @param {FeatureOutputFormat} format - The format for outputting the polygon feature. (default: FeatureOutputFormat.GeoJson)
2481
+ *
2482
+ * @return {string} - The string representation of the polygon feature.
2483
+ */
2126
2484
  static circle(feature, format = FeatureOutputFormat.GeoJson) {
2127
- // const clone = feature.clone();
2128
- // clone.setGeometry(fromCircle(feature.getGeometry()! as Circle));
2129
- const tetemp = feature.getGeometryName();
2130
2485
  const circle = feature.getGeometry();
2131
- // const temp = StringifyFeatureHelper.drawCircle(circle.getCenter(), circle.getRadius());
2132
- const ttt = feature.getGeometry().getExtent();
2133
- const eastPoint = [ttt[2], (ttt[1] + ttt[3]) / 2];
2134
- const aaa = [
2135
- ...transform([ttt[0], ttt[1]], 'EPSG:4326', 'EPSG:3857'),
2136
- ...transform([ttt[2], ttt[3]], 'EPSG:4326', 'EPSG:3857'),
2486
+ const ext = feature.getGeometry().getExtent();
2487
+ const coords = [
2488
+ ...transform([ext[0], ext[1]], 'EPSG:4326', 'EPSG:3857'),
2489
+ ...transform([ext[2], ext[3]], 'EPSG:4326', 'EPSG:3857'),
2137
2490
  ];
2138
- const radius = (aaa[2] - aaa[0]) / 2;
2139
- const radius2 = new LineString([circle.getCenter(), eastPoint]).getLength();
2491
+ const radius = (coords[2] - coords[0]) / 2;
2140
2492
  const polygonGeom = new Polygon(StringifyFeatureHelper.drawCircle(circle.getCenter(), radius));
2141
- // var edgeCoordinate = [circle.getCenter()[0] + radius, circle.getCenter()[1]];
2142
- // var wgs84Sphere = new Sphere(6378137);
2143
2493
  return StringifyFeatureHelper.polygon(new Feature(polygonGeom), format);
2144
- // const rad = circle.getRadius();
2145
- // const degrees = 180 / Math.PI; // radians to degrees
2146
- // const radians = Math.PI / 180; // degrees to radians
2147
- // const rlat = rad * degrees * 1000;
2148
- // const rlng = rad * radians;
2149
- // return StringifyFeatureHelper.polygon(new Feature<Geometry>(circular(circle.getCenter(),circle.getRadius() * METERS_PER_UNIT)), format);
2150
2494
  }
2495
+ /**
2496
+ * Draw a circle based on a center point and radius.
2497
+ *
2498
+ * @param {number[]} point - The center point coordinates in EPSG:4326 format.
2499
+ * @param {number} radius - The radius of the circle in meters.
2500
+ * @return {Coordinate[][]} - The coordinates of the circle boundary in EPSG:4326 format.
2501
+ */
2151
2502
  static drawCircle(point, radius) {
2152
2503
  const tetetemp = transform(point, 'EPSG:4326', 'EPSG:3857');
2153
2504
  // const tetetemp = point;