@artstesh/maps 1.1.7 → 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 (101) hide show
  1. package/dist/bundles/maps-components-src-map.umd.js +443 -92
  2. package/dist/bundles/maps-components-src-map.umd.js.map +1 -1
  3. package/dist/bundles/maps-components.umd.js +443 -92
  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/fit-to-polygons.command.js +1 -1
  23. package/dist/esm2015/map/models/map-control.js +2 -2
  24. package/dist/esm2015/map/models/marker-model.js +1 -1
  25. package/dist/esm2015/map/models/polygon.model.js +4 -4
  26. package/dist/esm2015/map/services/feature.service.js +6 -6
  27. package/dist/esm2015/map/services/map-click.service.js +10 -10
  28. package/dist/esm2015/map/services/map-feature.service.js +1 -1
  29. package/dist/esm2015/map/services/map-state.service.js +2 -3
  30. package/dist/esm2015/src/map/helpers/marker-style.helper.js +27 -1
  31. package/dist/esm2015/src/map/helpers/polygon-style.helper.js +22 -1
  32. package/dist/esm2015/src/map/helpers/stringify-feature.helper.js +24 -21
  33. package/dist/esm2015/src/map/helpers/text-style.helper.js +12 -1
  34. package/dist/esm2015/src/map/map-plate/controls/map-control-zoom/map-control-zoom.component.js +18 -1
  35. package/dist/esm2015/src/map/map-plate/controls/map-control-zoom/zoom-control.settings.js +72 -1
  36. package/dist/esm2015/src/map/map-plate/features/markers/markers.component.js +11 -1
  37. package/dist/esm2015/src/map/map-plate/features/polygons/polygons.component.js +11 -1
  38. package/dist/esm2015/src/map/map-plate/layers/cluster-layer/cluster-layer.component.js +15 -7
  39. package/dist/esm2015/src/map/map-plate/layers/cluster-layer/cluster-layer.settings.js +79 -1
  40. package/dist/esm2015/src/map/map-plate/layers/feature-layer/feature-layer.component.js +7 -7
  41. package/dist/esm2015/src/map/map-plate/layers/feature-layer/feature-layer.settings.js +37 -17
  42. package/dist/esm2015/src/map/map-plate/layers/tile-layer/tile-layer.component.js +7 -7
  43. package/dist/esm2015/src/map/map-plate/layers/tile-layer/tile-layer.settings.js +76 -1
  44. package/dist/esm2015/src/map/map-plate/map-plate.component.js +2 -2
  45. package/dist/esm2015/src/map/map-plate/tooltips/tooltip/tooltip.component.js +15 -15
  46. package/dist/esm2015/src/map/map-plate/tooltips/tooltip/tooltip.settings.js +1 -1
  47. package/dist/esm2015/src/map/messages/commands/fit-to-polygons.command.js +1 -1
  48. package/dist/esm2015/src/map/models/map-control.js +2 -2
  49. package/dist/esm2015/src/map/models/marker-model.js +1 -1
  50. package/dist/esm2015/src/map/models/polygon.model.js +4 -4
  51. package/dist/esm2015/src/map/services/feature.service.js +6 -6
  52. package/dist/esm2015/src/map/services/map-click.service.js +10 -10
  53. package/dist/esm2015/src/map/services/map-feature.service.js +1 -1
  54. package/dist/esm2015/src/map/services/map-state.service.js +2 -3
  55. package/dist/fesm2015/maps-components-src-map.js +438 -87
  56. package/dist/fesm2015/maps-components-src-map.js.map +1 -1
  57. package/dist/fesm2015/maps-components.js +438 -87
  58. package/dist/fesm2015/maps-components.js.map +1 -1
  59. package/dist/map/helpers/marker-style.helper.d.ts +26 -0
  60. package/dist/map/helpers/polygon-style.helper.d.ts +21 -0
  61. package/dist/map/helpers/stringify-feature.helper.d.ts +18 -0
  62. package/dist/map/helpers/text-style.helper.d.ts +11 -0
  63. package/dist/map/map-plate/controls/map-control-zoom/map-control-zoom.component.d.ts +20 -3
  64. package/dist/map/map-plate/controls/map-control-zoom/zoom-control.settings.d.ts +71 -0
  65. package/dist/map/map-plate/features/markers/markers.component.d.ts +10 -0
  66. package/dist/map/map-plate/features/polygons/polygons.component.d.ts +10 -0
  67. package/dist/map/map-plate/layers/cluster-layer/cluster-layer.component.d.ts +10 -2
  68. package/dist/map/map-plate/layers/cluster-layer/cluster-layer.settings.d.ts +78 -0
  69. package/dist/map/map-plate/layers/feature-layer/feature-layer.component.d.ts +2 -2
  70. package/dist/map/map-plate/layers/feature-layer/feature-layer.settings.d.ts +36 -16
  71. package/dist/map/map-plate/layers/tile-layer/tile-layer.component.d.ts +1 -1
  72. package/dist/map/map-plate/layers/tile-layer/tile-layer.settings.d.ts +75 -0
  73. package/dist/map/map-plate/map-plate.component.d.ts +2 -2
  74. package/dist/map/map-plate/tooltips/tooltip/tooltip.component.d.ts +5 -5
  75. package/dist/map/map-plate/tooltips/tooltip/tooltip.settings.d.ts +1 -1
  76. package/dist/map/models/map-control.d.ts +1 -1
  77. package/dist/map/models/polygon.model.d.ts +2 -2
  78. package/dist/map/services/feature.service.d.ts +1 -1
  79. package/dist/map/services/map-click.service.d.ts +1 -1
  80. package/dist/src/map/helpers/marker-style.helper.d.ts +26 -0
  81. package/dist/src/map/helpers/polygon-style.helper.d.ts +21 -0
  82. package/dist/src/map/helpers/stringify-feature.helper.d.ts +18 -0
  83. package/dist/src/map/helpers/text-style.helper.d.ts +11 -0
  84. package/dist/src/map/map-plate/controls/map-control-zoom/map-control-zoom.component.d.ts +20 -3
  85. package/dist/src/map/map-plate/controls/map-control-zoom/zoom-control.settings.d.ts +71 -0
  86. package/dist/src/map/map-plate/features/markers/markers.component.d.ts +10 -0
  87. package/dist/src/map/map-plate/features/polygons/polygons.component.d.ts +10 -0
  88. package/dist/src/map/map-plate/layers/cluster-layer/cluster-layer.component.d.ts +10 -2
  89. package/dist/src/map/map-plate/layers/cluster-layer/cluster-layer.settings.d.ts +78 -0
  90. package/dist/src/map/map-plate/layers/feature-layer/feature-layer.component.d.ts +2 -2
  91. package/dist/src/map/map-plate/layers/feature-layer/feature-layer.settings.d.ts +36 -16
  92. package/dist/src/map/map-plate/layers/tile-layer/tile-layer.component.d.ts +1 -1
  93. package/dist/src/map/map-plate/layers/tile-layer/tile-layer.settings.d.ts +75 -0
  94. package/dist/src/map/map-plate/map-plate.component.d.ts +2 -2
  95. package/dist/src/map/map-plate/tooltips/tooltip/tooltip.component.d.ts +5 -5
  96. package/dist/src/map/map-plate/tooltips/tooltip/tooltip.settings.d.ts +1 -1
  97. package/dist/src/map/models/map-control.d.ts +1 -1
  98. package/dist/src/map/models/polygon.model.d.ts +2 -2
  99. package/dist/src/map/services/feature.service.d.ts +1 -1
  100. package/dist/src/map/services/map-click.service.d.ts +1 -1
  101. package/package.json +1 -1
@@ -3,7 +3,7 @@ import { Component, Injectable, ChangeDetectionStrategy, Input, ViewChild, NgMod
3
3
  import * as i6 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';
@@ -166,6 +166,9 @@ class PolygonModel {
166
166
  (_a = this._feature) === null || _a === void 0 ? void 0 : _a.set(MapConstants.FeatureInfo, this.info);
167
167
  [this.lng, this.lat] = getCenter((_b = this._feature.getGeometry()) === null || _b === void 0 ? void 0 : _b.getExtent());
168
168
  }
169
+ get feature() {
170
+ return this._feature;
171
+ }
169
172
  static fromGeoJson(id, json, info) {
170
173
  let feature = new GeoJSON().readFeature(json);
171
174
  feature.setId(id);
@@ -176,9 +179,6 @@ class PolygonModel {
176
179
  feature.setId(id);
177
180
  return new PolygonModel(feature, id, info);
178
181
  }
179
- get feature() {
180
- return this._feature;
181
- }
182
182
  }
183
183
 
184
184
  var DrawingType;
@@ -197,7 +197,7 @@ var FeatureOutputFormat;
197
197
 
198
198
  /**
199
199
  *
200
- * 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.
200
+ * 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.
201
201
  * This is the base class for controls. You can use it for simple custom controls by creating the element with listeners, creating an instance:
202
202
  * var myControl = new Control({element: myElement}); and then adding this to the map.
203
203
  * 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.
@@ -492,6 +492,11 @@ class FeatureService {
492
492
  static filterFeaturesInArea(query) {
493
493
  return query.features.filter((f) => FeatureService.booleanIntersects(query.area, f.getGeometry()));
494
494
  }
495
+ static calculateArea(g) {
496
+ if (!g)
497
+ return 0;
498
+ return Sphere.getArea(g, { projection: 'EPSG:4326' });
499
+ }
495
500
  static booleanIntersects(g1, g2) {
496
501
  if (g2.getType() === 'Point')
497
502
  return g1.intersectsCoordinate(g2.getCoordinates());
@@ -501,11 +506,6 @@ class FeatureService {
501
506
  return g1.intersectsCoordinate(g2.getInteriorPoint().getCoordinates());
502
507
  return false;
503
508
  }
504
- static calculateArea(g) {
505
- if (!g)
506
- return 0;
507
- return Sphere.getArea(g, { projection: 'EPSG:4326' });
508
- }
509
509
  }
510
510
 
511
511
  class GetFeaturesInAreaQuery extends PostboyCallbackMessage {
@@ -760,15 +760,6 @@ class MapClickService {
760
760
  up() {
761
761
  this.observeMapRender();
762
762
  }
763
- observeMapRender() {
764
- this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
765
- var _a;
766
- this.map = m.map;
767
- (_a = this.map) === null || _a === void 0 ? void 0 : _a.on('singleclick', (e) => {
768
- this.postboy.fire(this.onClick(e));
769
- });
770
- });
771
- }
772
763
  onClick(ev) {
773
764
  var _a;
774
765
  const model = new MapClickEvent(ev.coordinate, {}, {});
@@ -787,6 +778,15 @@ class MapClickService {
787
778
  });
788
779
  return model;
789
780
  }
781
+ observeMapRender() {
782
+ this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
783
+ var _a;
784
+ this.map = m.map;
785
+ (_a = this.map) === null || _a === void 0 ? void 0 : _a.on('singleclick', (e) => {
786
+ this.postboy.fire(this.onClick(e));
787
+ });
788
+ });
789
+ }
790
790
  getFeatureCollectionWithInner(features) {
791
791
  const result = [];
792
792
  features === null || features === void 0 ? void 0 : features.forEach((f) => {
@@ -1051,14 +1051,53 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
1051
1051
  type: Injectable
1052
1052
  }], ctorParameters: function () { return [{ type: MapPostboyService }, { type: MapManagementService }, { type: MapStateService }, { type: MapFeatureService }, { type: MapClickService }, { type: DrawingService }, { type: FeatureModificationService }, { type: ControlsService }]; } });
1053
1053
 
1054
+ /**
1055
+ * Class representing settings for a tile layer.
1056
+ */
1054
1057
  class TileLayerSettings {
1055
1058
  constructor() {
1059
+ /**
1060
+ * The maximum zoom level for a map view.
1061
+ *
1062
+ * @type {number}
1063
+ * @default 19
1064
+ */
1056
1065
  this.maxZoom = 19;
1066
+ /**
1067
+ * The minimum zoom level allowed.
1068
+ *
1069
+ * @type {number}
1070
+ */
1057
1071
  this.minZoom = 0;
1072
+ /**
1073
+ * The opacity of an element.
1074
+ *
1075
+ * @type {number}
1076
+ * @default 0.6
1077
+ */
1058
1078
  this.opacity = 0.6;
1079
+ /**
1080
+ * Represents the tiles URL.
1081
+ * @typedef {string} url
1082
+ *
1083
+ * @example
1084
+ * 'https://example.ex/{z}/{x}/{y}.png'
1085
+ */
1059
1086
  this.url = '';
1087
+ /**
1088
+ * The projection of the coordinate system.
1089
+ *
1090
+ * @type {string}
1091
+ * @default 'EPSG:3857'
1092
+ */
1060
1093
  this.projection = 'EPSG:3857';
1061
1094
  }
1095
+ /**
1096
+ * Creates a copy of the given tile layer settings.
1097
+ *
1098
+ * @param {TileLayerSettings} model - The tile layer settings to be copied.
1099
+ * @return {TileLayerSettings} - A new instance of TileLayerSettings with the same properties as the model.
1100
+ */
1062
1101
  static copy(model) {
1063
1102
  const result = new TileLayerSettings();
1064
1103
  result.maxZoom = model.maxZoom;
@@ -1068,21 +1107,57 @@ class TileLayerSettings {
1068
1107
  result.url = model.url;
1069
1108
  return result;
1070
1109
  }
1110
+ /**
1111
+ * Sets the URL of the TileLayerSettings object.
1112
+ *
1113
+ * @param {string} url - The URL to be set.
1114
+ * @return {TileLayerSettings} - The updated TileLayerSettings object.
1115
+ */
1071
1116
  setUrl(url) {
1072
1117
  return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { url }));
1073
1118
  }
1119
+ /**
1120
+ * Sets the maximum zoom level for the tile layer.
1121
+ *
1122
+ * @param {number} maxZoom - The maximum zoom level.
1123
+ * @returns {TileLayerSettings} - The updated tile layer settings object.
1124
+ */
1074
1125
  setMaxZoom(maxZoom) {
1075
1126
  return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { maxZoom }));
1076
1127
  }
1128
+ /**
1129
+ * Sets the minimum zoom level for the Tile Layer.
1130
+ *
1131
+ * @param {number} minZoom - The minimum zoom level to be set.
1132
+ * @return {TileLayerSettings} The modified TileLayerSettings object with the updated minimum zoom level.
1133
+ */
1077
1134
  setMinZoom(minZoom) {
1078
1135
  return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { minZoom }));
1079
1136
  }
1137
+ /**
1138
+ * Sets the opacity of the TileLayerSettings.
1139
+ *
1140
+ * @param {number} opacity - The opacity value to set. Must be a number between 0 and 1.
1141
+ * @return {TileLayerSettings} - A new instance of TileLayerSettings with the opacity set.
1142
+ */
1080
1143
  setOpacity(opacity) {
1081
1144
  return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { opacity }));
1082
1145
  }
1146
+ /**
1147
+ * Sets the projection for the tile layer settings.
1148
+ *
1149
+ * @param {string} projection - The desired projection for the tile layer settings.
1150
+ * @return {TileLayerSettings} - The updated tile layer settings with the new projection.
1151
+ */
1083
1152
  setProjection(projection) {
1084
1153
  return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { projection }));
1085
1154
  }
1155
+ /**
1156
+ * Checks if the current instance of TileLayerSettings is equal to the given model.
1157
+ * @param {TileLayerSettings} model - The model to compare against.
1158
+ * @return {boolean} - True if all properties of the current instance matches the properties of the model;
1159
+ * otherwise, false.
1160
+ */
1086
1161
  isSame(model) {
1087
1162
  if (this.maxZoom !== model.maxZoom)
1088
1163
  return false;
@@ -1151,18 +1226,18 @@ class TileLayerComponent extends DestructibleComponent {
1151
1226
  this._settings = new TileLayerSettings();
1152
1227
  this.onDestroy = () => this.removeLayer();
1153
1228
  }
1154
- ngOnInit() {
1155
- this.postboy
1156
- .subscribe(MapRenderedEvent.ID)
1157
- .pipe(filter((m) => !!m), first())
1158
- .subscribe((m) => this.initLayer());
1159
- }
1160
1229
  set settings(value) {
1161
1230
  if (!value || this._settings.isSame(value))
1162
1231
  return;
1163
1232
  this._settings = value;
1164
1233
  this.initLayer();
1165
1234
  }
1235
+ ngOnInit() {
1236
+ this.postboy
1237
+ .subscribe(MapRenderedEvent.ID)
1238
+ .pipe(filter((m) => !!m), first())
1239
+ .subscribe((m) => this.initLayer());
1240
+ }
1166
1241
  initLayer() {
1167
1242
  this.removeLayer();
1168
1243
  this.layer = this.factory.build(this._settings);
@@ -1257,17 +1332,24 @@ class FeatureLayerSettings {
1257
1332
  */
1258
1333
  this.zIndex = 1;
1259
1334
  /**
1260
- * The maximum zoom at which the layer is visible. 19 by default
1335
+ The maximum view zoom level (inclusive) at which this layer will be visible.
1336
+
1337
+ @type {number}
1338
+ @default 19
1261
1339
  */
1262
1340
  this.maxZoom = 19;
1263
1341
  /**
1264
- * The minimum zoom at which the layer is visible. 0 by default
1342
+ The minimum view zoom level (exclusive) at which this layer will be visible.
1343
+
1344
+ @type {number}
1265
1345
  */
1266
1346
  this.minZoom = 0;
1267
1347
  }
1268
1348
  /**
1269
- * Creates a clone of the existing settings
1270
- * @param model
1349
+ * Copies the given FeatureLayerSettings object
1350
+ *
1351
+ * @param {FeatureLayerSettings} model - The FeatureLayerSettings object to be copied
1352
+ * @returns {FeatureLayerSettings} - A copy of the FeatureLayerSettings object
1271
1353
  */
1272
1354
  static copy(model) {
1273
1355
  const result = new FeatureLayerSettings();
@@ -1279,43 +1361,56 @@ class FeatureLayerSettings {
1279
1361
  return result;
1280
1362
  }
1281
1363
  /**
1282
- Setter for {@link FeatureLayerSettings.zIndex}
1283
- * @param zIndex
1364
+ * Sets the z-index value for the FeatureLayerSettings object.
1365
+ *
1366
+ * @param {number} zIndex - The new z-index value.
1367
+ * @return {FeatureLayerSettings} - The updated FeatureLayerSettings object.
1284
1368
  */
1285
1369
  setZIndex(zIndex) {
1286
1370
  return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { zIndex }));
1287
1371
  }
1288
1372
  /**
1289
- * Setter for {@link FeatureLayerSettings.name}
1290
- * @param name
1373
+ * Sets the name of the FeatureLayerSettings.
1374
+ *
1375
+ * @param {string} name - The name to set for the FeatureLayerSettings.
1376
+ *
1377
+ * @return {FeatureLayerSettings} - The updated FeatureLayerSettings object with the new name.
1291
1378
  */
1292
1379
  setName(name) {
1293
1380
  return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { name }));
1294
1381
  }
1295
1382
  /**
1296
- * Setter for {@link FeatureLayerSettings.maxZoom}
1297
- * @param maxZoom
1383
+ * Sets the maximum zoom level for the FeatureLayerSettings.
1384
+ *
1385
+ * @param {number} maxZoom - The maximum zoom level.
1386
+ * @return {FeatureLayerSettings} - The updated FeatureLayerSettings object.
1298
1387
  */
1299
1388
  setMaxZoom(maxZoom) {
1300
1389
  return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { maxZoom }));
1301
1390
  }
1302
1391
  /**
1303
- * Setter for {@link FeatureLayerSettings.minZoom}
1304
- * @param minZoom
1392
+ * Sets the minimum zoom level for the feature layer.
1393
+ *
1394
+ * @param {number} minZoom The minimum zoom level to be set.
1395
+ * @returns {FeatureLayerSettings} The updated feature layer settings object.
1305
1396
  */
1306
1397
  setMinZoom(minZoom) {
1307
1398
  return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { minZoom }));
1308
1399
  }
1309
1400
  /**
1310
- * Setter for {@link FeatureLayerSettings.style}
1311
- * @param style
1401
+ * Sets the style for the FeatureLayerSettings object.
1402
+ *
1403
+ * @param {Style | StyleFunction} style - The new style to set. It can be either a Style object or a StyleFunction.
1404
+ * @return {FeatureLayerSettings} - The updated FeatureLayerSettings object with the new style.
1312
1405
  */
1313
1406
  setStyle(style) {
1314
1407
  return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { style }));
1315
1408
  }
1316
1409
  /**
1317
- * Checks if the model has the same content
1318
- * @param model - the object to compare
1410
+ * Checks if the given FeatureLayerSettings object is identical to the current object.
1411
+ *
1412
+ * @param {FeatureLayerSettings} model - The FeatureLayerSettings object to compare with.
1413
+ * @return {boolean} - Returns true if the given object is identical to the current object, otherwise false.
1319
1414
  */
1320
1415
  isSame(model) {
1321
1416
  if (this.maxZoom !== model.maxZoom)
@@ -1365,18 +1460,18 @@ class FeatureLayerComponent extends DestructibleComponent {
1365
1460
  this._settings = new FeatureLayerSettings();
1366
1461
  this.onDestroy = () => this.removeLayer();
1367
1462
  }
1368
- ngOnInit() {
1369
- this.postboy
1370
- .subscribe(MapRenderedEvent.ID)
1371
- .pipe(filter((m) => !!m), first())
1372
- .subscribe((m) => this.initLayer());
1373
- }
1374
1463
  set settings(value) {
1375
1464
  if (!value || this._settings.isSame(value))
1376
1465
  return;
1377
1466
  this._settings = value;
1378
1467
  this.initLayer();
1379
1468
  }
1469
+ ngOnInit() {
1470
+ this.postboy
1471
+ .subscribe(MapRenderedEvent.ID)
1472
+ .pipe(filter((m) => !!m), first())
1473
+ .subscribe((m) => this.initLayer());
1474
+ }
1380
1475
  initLayer() {
1381
1476
  this.removeLayer();
1382
1477
  this.layer = this.factory.build(this._settings);
@@ -1405,12 +1500,34 @@ class ClusterLayerSettings {
1405
1500
  constructor() {
1406
1501
  this.name = IdGenerator.get();
1407
1502
  this.zIndex = 1;
1503
+ /**
1504
+ * The maximum view zoom level (inclusive) at which this layer will be visible.
1505
+ *
1506
+ * @type {number}
1507
+ * @default 19
1508
+ */
1408
1509
  this.maxZoom = 19;
1510
+ /**
1511
+ * The minimum view zoom level (exclusive) at which this layer will be visible.
1512
+ *
1513
+ * @type {number}
1514
+ */
1409
1515
  this.minZoom = 0;
1516
+ /**
1517
+ * Distance in pixels within which features will be clustered together.
1518
+ *
1519
+ * @type {number}
1520
+ */
1410
1521
  this.distance = 20;
1411
1522
  this.bbox = false;
1412
1523
  this.clusterCancel = 14;
1413
1524
  }
1525
+ /**
1526
+ * Creates a copy of the given ClusterLayerSettings object.
1527
+ *
1528
+ * @param {ClusterLayerSettings} model - The ClusterLayerSettings object to be copied.
1529
+ * @returns {ClusterLayerSettings} - A new ClusterLayerSettings object that is a copy of the original object.
1530
+ */
1414
1531
  static copy(model) {
1415
1532
  const result = new ClusterLayerSettings();
1416
1533
  result.name = model.name;
@@ -1423,30 +1540,86 @@ class ClusterLayerSettings {
1423
1540
  result.style = model.style;
1424
1541
  return result;
1425
1542
  }
1543
+ /**
1544
+ * Set the z-index for the ClusterLayer.
1545
+ *
1546
+ * @param {number} zIndex - The new z-index for the ClusterLayer.
1547
+ * @return {ClusterLayerSettings} - The updated ClusterLayerSettings object.
1548
+ */
1426
1549
  setZIndex(zIndex) {
1427
1550
  return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { zIndex }));
1428
1551
  }
1552
+ /**
1553
+ * Sets the distance value for ClusterLayerSettings.
1554
+ *
1555
+ * @param {number} distance - The distance value to be set.
1556
+ * @return {ClusterLayerSettings} - The modified ClusterLayerSettings object.
1557
+ */
1429
1558
  setDistance(distance) {
1430
1559
  return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { distance }));
1431
1560
  }
1561
+ /**
1562
+ * Sets the name of the ClusterLayerSettings object.
1563
+ *
1564
+ * @param {string} name - The name to set for the ClusterLayerSettings.
1565
+ * @return {ClusterLayerSettings} - A new ClusterLayerSettings object with the updated name.
1566
+ */
1432
1567
  setName(name) {
1433
1568
  return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { name }));
1434
1569
  }
1570
+ /**
1571
+ * Sets the maximum zoom level for the Cluster Layer.
1572
+ *
1573
+ * @param {number} maxZoom - The maximum zoom level to be set.
1574
+ * @return {ClusterLayerSettings} - The updated ClusterLayerSettings object.
1575
+ */
1435
1576
  setMaxZoom(maxZoom) {
1436
1577
  return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { maxZoom }));
1437
1578
  }
1579
+ /**
1580
+ * Sets the minimum zoom level for the ClusterLayerSettings.
1581
+ *
1582
+ * @param {number} minZoom - The minimum zoom level to set.
1583
+ * @return {ClusterLayerSettings} - The updated ClusterLayerSettings object.
1584
+ */
1438
1585
  setMinZoom(minZoom) {
1439
1586
  return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { minZoom }));
1440
1587
  }
1588
+ /**
1589
+ * Sets the cluster cancel number for the ClusterLayerSettings.
1590
+ *
1591
+ * @param {number} clusterCancel - The new cluster cancel number.
1592
+ * @returns {ClusterLayerSettings} - The updated ClusterLayerSettings object.
1593
+ */
1441
1594
  setClusterCancel(clusterCancel) {
1442
1595
  return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { clusterCancel }));
1443
1596
  }
1597
+ /**
1598
+ * Sets the value of 'bbox' property in the ClusterLayerSettings object.
1599
+ *
1600
+ * @param {boolean} bbox - A boolean value indicating whether to include bounding box calculation in the cluster layer settings.
1601
+ * @returns {ClusterLayerSettings} - The updated ClusterLayerSettings object with the newly set 'bbox' value.
1602
+ */
1444
1603
  setBbox(bbox) {
1445
1604
  return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { bbox }));
1446
1605
  }
1606
+ /**
1607
+ * Sets the style for the ClusterLayerSettings.
1608
+ *
1609
+ * @param {function} style - A function that takes an array of identified features as input and returns a Style or StyleFunction.
1610
+ *
1611
+ * @return {ClusterLayerSettings} - The updated ClusterLayerSettings object with the new style applied.
1612
+ */
1447
1613
  setStyle(style) {
1448
1614
  return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { style }));
1449
1615
  }
1616
+ /**
1617
+ * Checks if the current ClusterLayerSettings object is the same as the specified model.
1618
+ *
1619
+ * @param {ClusterLayerSettings} model - The model to compare with the current object.
1620
+ *
1621
+ * @return {boolean} - Returns true if the current ClusterLayerSettings object is the same as the specified model, otherwise false.
1622
+ */
1450
1623
  isSame(model) {
1451
1624
  if (this.maxZoom !== model.maxZoom)
1452
1625
  return false;
@@ -1551,6 +1724,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
1551
1724
  }]
1552
1725
  }] });
1553
1726
 
1727
+ /**
1728
+ * Represents a cluster layer component.
1729
+ */
1554
1730
  class ClusterLayerComponent extends DestructibleComponent {
1555
1731
  constructor(postboy, factory) {
1556
1732
  super();
@@ -1560,18 +1736,23 @@ class ClusterLayerComponent extends DestructibleComponent {
1560
1736
  this._settings = new ClusterLayerSettings();
1561
1737
  this.onDestroy = () => this.removeLayer();
1562
1738
  }
1563
- ngOnInit() {
1564
- this.postboy
1565
- .subscribe(MapRenderedEvent.ID)
1566
- .pipe(filter((m) => !!m), first())
1567
- .subscribe((m) => this.initLayer());
1568
- }
1739
+ /**
1740
+ * Sets the settings for the cluster layer.
1741
+ *
1742
+ * @param {ClusterLayerSettings | undefined} value - The settings for the cluster layer.
1743
+ */
1569
1744
  set settings(value) {
1570
1745
  if (!value || this._settings.isSame(value))
1571
1746
  return;
1572
1747
  this._settings = value;
1573
1748
  this.initLayer();
1574
1749
  }
1750
+ ngOnInit() {
1751
+ this.postboy
1752
+ .subscribe(MapRenderedEvent.ID)
1753
+ .pipe(filter((m) => !!m), first())
1754
+ .subscribe((m) => this.initLayer());
1755
+ }
1575
1756
  initLayer() {
1576
1757
  this.removeLayer();
1577
1758
  this.manager = this.factory.build(this._settings, this.postboy);
@@ -1629,8 +1810,8 @@ class MapPlateComponent extends DestructibleComponent {
1629
1810
  this.registrator = registrator;
1630
1811
  this.detector = detector;
1631
1812
  this.osmUrl = '';
1632
- this._settings = new MapSettings();
1633
1813
  this.drawingLayerSettings = new FeatureLayerSettings().setName(MapConstants.DrawingLayerId);
1814
+ this._settings = new MapSettings();
1634
1815
  this.onDestroy = () => {
1635
1816
  this.registrator.down();
1636
1817
  };
@@ -1698,6 +1879,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
1698
1879
  type: Input
1699
1880
  }] } });
1700
1881
 
1882
+ /**
1883
+ * MarkersComponent is a component that displays markers on a map.
1884
+ * It listens for changes in the `markers` input property and
1885
+ * automatically puts the markers on the map using the MapPostboyService.
1886
+ */
1701
1887
  class MarkersComponent extends DestructibleComponent {
1702
1888
  constructor(postboy) {
1703
1889
  super();
@@ -1705,6 +1891,11 @@ class MarkersComponent extends DestructibleComponent {
1705
1891
  this.layerName = '';
1706
1892
  this._markers = [];
1707
1893
  }
1894
+ /**
1895
+ * Sets the markers property.
1896
+ *
1897
+ * @param {MarkerModel[]} value - The array of MarkerModel objects to set as markers.
1898
+ */
1708
1899
  set markers(value) {
1709
1900
  this._markers = value !== null && value !== void 0 ? value : [];
1710
1901
  this.putMarkers();
@@ -1771,13 +1962,8 @@ class TooltipComponent extends DestructibleComponent {
1771
1962
  super();
1772
1963
  this.postboy = postboy;
1773
1964
  this.detector = detector;
1774
- this._settings = new TooltipSettings();
1775
1965
  this.show = false;
1776
- this.removeOverlay = () => {
1777
- var _a;
1778
- !!this.overlay && ((_a = this.map) === null || _a === void 0 ? void 0 : _a.removeOverlay(this.overlay));
1779
- this.show = false;
1780
- };
1966
+ this._settings = new TooltipSettings();
1781
1967
  this.options = (coordinates) => {
1782
1968
  var _a;
1783
1969
  return {
@@ -1787,6 +1973,11 @@ class TooltipComponent extends DestructibleComponent {
1787
1973
  position: coordinates,
1788
1974
  };
1789
1975
  };
1976
+ this.removeOverlay = () => {
1977
+ var _a;
1978
+ !!this.overlay && ((_a = this.map) === null || _a === void 0 ? void 0 : _a.removeOverlay(this.overlay));
1979
+ this.show = false;
1980
+ };
1790
1981
  }
1791
1982
  set settings(value) {
1792
1983
  if (!value || this._settings.isSame(value))
@@ -1799,6 +1990,14 @@ class TooltipComponent extends DestructibleComponent {
1799
1990
  this.subs.push(this.observeMapClick());
1800
1991
  this.subs.push(this.observeClose());
1801
1992
  }
1993
+ addOverlay(coordinates) {
1994
+ var _a;
1995
+ this.removeOverlay();
1996
+ this.overlay = new Overlay(this.options(coordinates));
1997
+ (_a = this.map) === null || _a === void 0 ? void 0 : _a.addOverlay(this.overlay);
1998
+ this.show = true;
1999
+ this.detector.detectChanges();
2000
+ }
1802
2001
  observeMapClick() {
1803
2002
  return this.postboy.subscribe(MapClickEvent.ID).subscribe((ev) => {
1804
2003
  this._settings.show(ev) ? this.addOverlay(ev.coordinates) : this.removeOverlay();
@@ -1815,14 +2014,6 @@ class TooltipComponent extends DestructibleComponent {
1815
2014
  this.map = m.map;
1816
2015
  });
1817
2016
  }
1818
- addOverlay(coordinates) {
1819
- var _a;
1820
- this.removeOverlay();
1821
- this.overlay = new Overlay(this.options(coordinates));
1822
- (_a = this.map) === null || _a === void 0 ? void 0 : _a.addOverlay(this.overlay);
1823
- this.show = true;
1824
- this.detector.detectChanges();
1825
- }
1826
2017
  }
1827
2018
  TooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TooltipComponent, deps: [{ token: MapPostboyService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1828
2019
  TooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", 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 });
@@ -1841,6 +2032,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
1841
2032
  type: Input
1842
2033
  }] } });
1843
2034
 
2035
+ /**
2036
+ * Component for rendering polygons on a map.
2037
+ * It listens for changes in the `polygons` input property and
2038
+ * automatically puts the polygons on the map using the MapPostboyService.
2039
+ */
1844
2040
  class PolygonsComponent extends DestructibleComponent {
1845
2041
  constructor(postboy) {
1846
2042
  super();
@@ -1848,6 +2044,11 @@ class PolygonsComponent extends DestructibleComponent {
1848
2044
  this.layerName = '';
1849
2045
  this._polygons = [];
1850
2046
  }
2047
+ /**
2048
+ * Sets the value of polygons.
2049
+ *
2050
+ * @param {PolygonModel[]} value - The new value for polygons.
2051
+ */
1851
2052
  set polygons(value) {
1852
2053
  this._polygons = value !== null && value !== void 0 ? value : [];
1853
2054
  this.putPolygons();
@@ -1880,14 +2081,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
1880
2081
  type: Input
1881
2082
  }] } });
1882
2083
 
2084
+ /**
2085
+ * Represents the settings for a zoom control.
2086
+ */
1883
2087
  class ZoomControlSettings {
1884
2088
  constructor() {
2089
+ /**
2090
+ * The CSS class name of the control element.
2091
+ *
2092
+ * @type {string}
2093
+ */
1885
2094
  this.controlClass = 'ol-zoom';
2095
+ /**
2096
+ * The CSS class name for zoom in button.
2097
+ * @type {string}
2098
+ */
1886
2099
  this.zoomInClass = 'ol-zoom-in';
2100
+ /**
2101
+ * The CSS class name for the zoom out button element.
2102
+ *
2103
+ * @type {string}
2104
+ */
1887
2105
  this.zoomOutClass = 'ol-zoom-out';
2106
+ /**
2107
+ * The label for the zoom in action.
2108
+ *
2109
+ * @type {string}
2110
+ */
1888
2111
  this.zoomInLabel = 'Zoom In';
2112
+ /**
2113
+ * The label for the zoom out control.
2114
+ *
2115
+ * @type {string}
2116
+ */
1889
2117
  this.zoomOutLabel = 'Zoom Out';
1890
2118
  }
2119
+ /**
2120
+ * Copies the provided ZoomControlSettings object.
2121
+ *
2122
+ * @param {ZoomControlSettings} model - The ZoomControlSettings object to be copied.
2123
+ * @return {ZoomControlSettings} - The copied ZoomControlSettings object.
2124
+ */
1891
2125
  static copy(model) {
1892
2126
  const result = new ZoomControlSettings();
1893
2127
  result.controlClass = model.controlClass;
@@ -1897,6 +2131,13 @@ class ZoomControlSettings {
1897
2131
  result.zoomOutLabel = model.zoomOutLabel;
1898
2132
  return result;
1899
2133
  }
2134
+ /**
2135
+ * Checks if the current ZoomControlSettings object is equal to the given model.
2136
+ *
2137
+ * @param {ZoomControlSettings} model - The ZoomControlSettings object to compare with.
2138
+ *
2139
+ * @return {boolean} - true if the current object is equal to the given model, false otherwise.
2140
+ */
1900
2141
  isSame(model) {
1901
2142
  if (this.zoomInClass !== model.zoomInClass)
1902
2143
  return false;
@@ -1910,23 +2151,60 @@ class ZoomControlSettings {
1910
2151
  return false;
1911
2152
  return true;
1912
2153
  }
2154
+ /**
2155
+ * Sets the zoom in label of the Zoom Control Settings.
2156
+ *
2157
+ * @param {string} zoomInLabel - The label for the zoom in button.
2158
+ * @return {ZoomControlSettings} - The new Zoom Control Settings object with the updated zoom in label.
2159
+ */
1913
2160
  setZoomInLabel(zoomInLabel) {
1914
2161
  return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomInLabel }));
1915
2162
  }
2163
+ /**
2164
+ * Sets the zoomOutClass property of the ZoomControlSettings object.
2165
+ *
2166
+ * @param {string} zoomOutClass - The CSS class to be assigned to the zoom out button.
2167
+ * @return {ZoomControlSettings} - The updated ZoomControlSettings object with the new zoomOutClass value.
2168
+ */
1916
2169
  setZoomOutClass(zoomOutClass) {
1917
2170
  return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomOutClass }));
1918
2171
  }
2172
+ /**
2173
+ * Sets the zoom in class for the zoom control settings.
2174
+ *
2175
+ * @param {string} zoomInClass - The new zoom in class to be set.
2176
+ * @return {ZoomControlSettings} - The updated zoom control settings.
2177
+ */
1919
2178
  setZoomInClass(zoomInClass) {
1920
2179
  return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomInClass }));
1921
2180
  }
2181
+ /**
2182
+ * Set the label for the zoom out control.
2183
+ *
2184
+ * @param {string} zoomOutLabel - The label for the zoom out control.
2185
+ * @returns {ZoomControlSettings} - The updated zoom control settings.
2186
+ */
1922
2187
  setZoomOutLabel(zoomOutLabel) {
1923
2188
  return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomOutLabel }));
1924
2189
  }
2190
+ /**
2191
+ * Sets the control class for the ZoomControlSettings.
2192
+ *
2193
+ * @param {string} controlClass - The class name of the control to be set.
2194
+ *
2195
+ * @return {ZoomControlSettings} - The modified ZoomControlSettings object.
2196
+ */
1925
2197
  setControlClass(controlClass) {
1926
2198
  return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { controlClass }));
1927
2199
  }
1928
2200
  }
1929
2201
 
2202
+ /**
2203
+ * @class
2204
+ * @classdesc Represents a component for the Zoom control on a map.
2205
+ * @extends DestructibleComponent
2206
+ * @implements OnInit
2207
+ */
1930
2208
  class MapControlZoomComponent extends DestructibleComponent {
1931
2209
  constructor(postboy) {
1932
2210
  super();
@@ -1937,6 +2215,17 @@ class MapControlZoomComponent extends DestructibleComponent {
1937
2215
  };
1938
2216
  this.eliminate = () => !!this.map && !!this.control && this.map.removeControl(this.control);
1939
2217
  }
2218
+ /**
2219
+ * Sets the settings for the Zoom Control.
2220
+ *
2221
+ * @param {ZoomControlSettings | undefined} value - The new settings for the Zoom Control.
2222
+ *
2223
+ * @description
2224
+ * This method sets the settings for the Zoom Control. It takes a parameter `value` which should be an object of type `ZoomControlSettings` or `undefined`.
2225
+ *
2226
+ * If the `value` is `undefined` or the same as the current settings, the method will return without making any changes.
2227
+ *
2228
+ */
1940
2229
  set settings(value) {
1941
2230
  if (!value || this._settings.isSame(value))
1942
2231
  return;
@@ -2023,7 +2312,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
2023
2312
  }]
2024
2313
  }] });
2025
2314
 
2315
+ /**
2316
+ * Helper class to create and modify marker styles.
2317
+ */
2026
2318
  class MarkerStyleHelper {
2319
+ /**
2320
+ * Creates a new Style object from an SVG.
2321
+ * @param {string} svg - The SVG string.
2322
+ * @param {Array<number>} [size=[30, 30]] - The size of the icon image.
2323
+ * @param {number} [zIndex=400] - The zIndex of the style.
2324
+ * @returns {Style} A new Style object.
2325
+ */
2027
2326
  static fromSvg(svg, size = [30, 30], zIndex = 400) {
2028
2327
  let image = new Image();
2029
2328
  image.src = 'data:image/svg+xml,' + escape(svg);
@@ -2035,6 +2334,15 @@ class MarkerStyleHelper {
2035
2334
  zIndex,
2036
2335
  });
2037
2336
  }
2337
+ /**
2338
+ * Returns a Style object with a circle style.
2339
+ *
2340
+ * @param {number} radius - The radius of the circle.
2341
+ * @param {string} fill - The fill color of the circle. Format: '#RRGGBB' or 'rgba(R, G, B, A)'.
2342
+ * @param {string} strokeColor - The stroke color of the circle. Format: '#RRGGBB' or 'rgba(R, G, B, A)'.
2343
+ * @param {number} [strokeWidth=1] - The width of the stroke. Default is 1.
2344
+ * @returns {Style} - A Style object with a Circle image.
2345
+ */
2038
2346
  static circle(radius, fill, strokeColor, strokeWidth = 1) {
2039
2347
  return new Style({
2040
2348
  image: new Circle({
@@ -2044,13 +2352,32 @@ class MarkerStyleHelper {
2044
2352
  }),
2045
2353
  });
2046
2354
  }
2355
+ /**
2356
+ * Applies the given Text to the provided Style.
2357
+ *
2358
+ * @param {Style} style - The Style to modify.
2359
+ * @param {Text} text - The Text to apply to the Style.
2360
+ * @return {Style} - The modified Style with the applied Text.
2361
+ */
2047
2362
  static withText(style, text) {
2048
2363
  style.setText(text);
2049
2364
  return style;
2050
2365
  }
2051
2366
  }
2052
2367
 
2368
+ /**
2369
+ * A helper class for creating polygon styles.
2370
+ * @class
2371
+ */
2053
2372
  class PolygonStyleHelper {
2373
+ /**
2374
+ * Creates a Style object with the given fill color, stroke color, and stroke width.
2375
+ *
2376
+ * @param {string} fill - The fill color in hexadecimal or RGB format.
2377
+ * @param {string} stroke - The stroke color in hexadecimal or RGB format.
2378
+ * @param {number} [strokeWidth=1] - The width of the stroke. Defaults to 1.
2379
+ * @return {Style} The created Style object.
2380
+ */
2054
2381
  static simple(fill, stroke, strokeWidth = 1) {
2055
2382
  return new Style({
2056
2383
  fill: new Fill({
@@ -2062,6 +2389,15 @@ class PolygonStyleHelper {
2062
2389
  }),
2063
2390
  });
2064
2391
  }
2392
+ /**
2393
+ * Creates a new Style object with the given fill, stroke, stroke width, and pin radius.
2394
+ *
2395
+ * @param {string} fill - The color to use for the fill of the style.
2396
+ * @param {string} stroke - The color to use for the stroke of the style.
2397
+ * @param {number} [strokeWidth=1] - The width of the stroke. Defaults to 1.
2398
+ * @param {number} [pinRadius=5] - The radius of the circle used as the image for the style. Defaults to 5.
2399
+ * @returns {Style} - The newly created Style object.
2400
+ */
2065
2401
  static edit(fill, stroke, strokeWidth = 1, pinRadius = 5) {
2066
2402
  return new Style({
2067
2403
  image: new Circle({
@@ -2081,7 +2417,18 @@ class PolygonStyleHelper {
2081
2417
  }
2082
2418
  }
2083
2419
 
2420
+ /**
2421
+ * Helper class for creating text styles.
2422
+ */
2084
2423
  class TextStyleHelper {
2424
+ /**
2425
+ * Creates a new instance of the Text class with the specified properties.
2426
+ *
2427
+ * @param {string} text - The text content of the Text object.
2428
+ * @param {string} font - The font style of the Text object.
2429
+ * @param {string} color - The color of the Text object.
2430
+ * @return {Text} A new instance of the Text class.
2431
+ */
2085
2432
  static get(text, font, color) {
2086
2433
  return new Text({
2087
2434
  text: text,
@@ -2094,37 +2441,41 @@ class TextStyleHelper {
2094
2441
  }
2095
2442
  }
2096
2443
 
2444
+ /**
2445
+ * A helper class for converting and stringify features.
2446
+ */
2097
2447
  class StringifyFeatureHelper {
2098
2448
  static polygon(feature, format = FeatureOutputFormat.GeoJson) {
2099
2449
  return format === FeatureOutputFormat.GeoJson
2100
2450
  ? new GeoJSON().writeFeature(feature)
2101
2451
  : new WKT().writeFeature(feature);
2102
2452
  }
2453
+ /**
2454
+ * Creates a polygon feature representing a circle based on a given feature with a circle geometry.
2455
+ *
2456
+ * @param {Feature<Geometry>} feature - The input feature with a circle geometry.
2457
+ * @param {FeatureOutputFormat} format - The format for outputting the polygon feature. (default: FeatureOutputFormat.GeoJson)
2458
+ *
2459
+ * @return {string} - The string representation of the polygon feature.
2460
+ */
2103
2461
  static circle(feature, format = FeatureOutputFormat.GeoJson) {
2104
- // const clone = feature.clone();
2105
- // clone.setGeometry(fromCircle(feature.getGeometry()! as Circle));
2106
- const tetemp = feature.getGeometryName();
2107
2462
  const circle = feature.getGeometry();
2108
- // const temp = StringifyFeatureHelper.drawCircle(circle.getCenter(), circle.getRadius());
2109
- const ttt = feature.getGeometry().getExtent();
2110
- const eastPoint = [ttt[2], (ttt[1] + ttt[3]) / 2];
2111
- const aaa = [
2112
- ...transform([ttt[0], ttt[1]], 'EPSG:4326', 'EPSG:3857'),
2113
- ...transform([ttt[2], ttt[3]], 'EPSG:4326', 'EPSG:3857'),
2463
+ const ext = feature.getGeometry().getExtent();
2464
+ const coords = [
2465
+ ...transform([ext[0], ext[1]], 'EPSG:4326', 'EPSG:3857'),
2466
+ ...transform([ext[2], ext[3]], 'EPSG:4326', 'EPSG:3857'),
2114
2467
  ];
2115
- const radius = (aaa[2] - aaa[0]) / 2;
2116
- const radius2 = new LineString([circle.getCenter(), eastPoint]).getLength();
2468
+ const radius = (coords[2] - coords[0]) / 2;
2117
2469
  const polygonGeom = new Polygon(StringifyFeatureHelper.drawCircle(circle.getCenter(), radius));
2118
- // var edgeCoordinate = [circle.getCenter()[0] + radius, circle.getCenter()[1]];
2119
- // var wgs84Sphere = new Sphere(6378137);
2120
2470
  return StringifyFeatureHelper.polygon(new Feature(polygonGeom), format);
2121
- // const rad = circle.getRadius();
2122
- // const degrees = 180 / Math.PI; // radians to degrees
2123
- // const radians = Math.PI / 180; // degrees to radians
2124
- // const rlat = rad * degrees * 1000;
2125
- // const rlng = rad * radians;
2126
- // return StringifyFeatureHelper.polygon(new Feature<Geometry>(circular(circle.getCenter(),circle.getRadius() * METERS_PER_UNIT)), format);
2127
2471
  }
2472
+ /**
2473
+ * Draw a circle based on a center point and radius.
2474
+ *
2475
+ * @param {number[]} point - The center point coordinates in EPSG:4326 format.
2476
+ * @param {number} radius - The radius of the circle in meters.
2477
+ * @return {Coordinate[][]} - The coordinates of the circle boundary in EPSG:4326 format.
2478
+ */
2128
2479
  static drawCircle(point, radius) {
2129
2480
  const tetetemp = transform(point, 'EPSG:4326', 'EPSG:3857');
2130
2481
  // const tetetemp = point;