@artstesh/maps 4.1.8 → 4.1.9

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/esm2020/map/helpers/marker-style.helper.mjs +27 -1
  2. package/dist/esm2020/map/helpers/polygon-style.helper.mjs +22 -1
  3. package/dist/esm2020/map/helpers/stringify-feature.helper.mjs +24 -21
  4. package/dist/esm2020/map/helpers/text-style.helper.mjs +12 -1
  5. package/dist/esm2020/map/map-plate/controls/map-control-zoom/map-control-zoom.component.mjs +24 -7
  6. package/dist/esm2020/map/map-plate/controls/map-control-zoom/zoom-control.settings.mjs +72 -1
  7. package/dist/esm2020/map/map-plate/features/markers/markers.component.mjs +11 -1
  8. package/dist/esm2020/map/map-plate/features/polygons/polygons.component.mjs +11 -1
  9. package/dist/esm2020/map/map-plate/layers/cluster-layer/cluster-layer.component.mjs +15 -7
  10. package/dist/esm2020/map/map-plate/layers/cluster-layer/cluster-layer.settings.mjs +79 -1
  11. package/dist/esm2020/map/map-plate/layers/feature-layer/feature-layer.component.mjs +7 -7
  12. package/dist/esm2020/map/map-plate/layers/feature-layer/feature-layer.settings.mjs +37 -17
  13. package/dist/esm2020/map/map-plate/layers/tile-layer/tile-layer.component.mjs +7 -7
  14. package/dist/esm2020/map/map-plate/layers/tile-layer/tile-layer.settings.mjs +76 -1
  15. package/dist/esm2020/map/map-plate/map-plate.component.mjs +2 -2
  16. package/dist/esm2020/map/map-plate/tooltips/tooltip/tooltip.component.mjs +19 -19
  17. package/dist/esm2020/map/map-plate/tooltips/tooltip/tooltip.settings.mjs +1 -1
  18. package/dist/esm2020/map/messages/commands/fit-to-polygons.command.mjs +1 -1
  19. package/dist/esm2020/map/models/map-control.mjs +2 -2
  20. package/dist/esm2020/map/models/marker-model.mjs +1 -1
  21. package/dist/esm2020/map/models/polygon.model.mjs +11 -11
  22. package/dist/esm2020/map/services/feature.service.mjs +6 -6
  23. package/dist/esm2020/map/services/map-click.service.mjs +9 -9
  24. package/dist/esm2020/map/services/map-feature.service.mjs +1 -1
  25. package/dist/esm2020/map/services/map-state.service.mjs +2 -3
  26. package/dist/esm2020/src/map/helpers/marker-style.helper.mjs +27 -1
  27. package/dist/esm2020/src/map/helpers/polygon-style.helper.mjs +22 -1
  28. package/dist/esm2020/src/map/helpers/stringify-feature.helper.mjs +24 -21
  29. package/dist/esm2020/src/map/helpers/text-style.helper.mjs +12 -1
  30. package/dist/esm2020/src/map/map-plate/controls/map-control-zoom/map-control-zoom.component.mjs +24 -7
  31. package/dist/esm2020/src/map/map-plate/controls/map-control-zoom/zoom-control.settings.mjs +72 -1
  32. package/dist/esm2020/src/map/map-plate/features/markers/markers.component.mjs +11 -1
  33. package/dist/esm2020/src/map/map-plate/features/polygons/polygons.component.mjs +11 -1
  34. package/dist/esm2020/src/map/map-plate/layers/cluster-layer/cluster-layer.component.mjs +15 -7
  35. package/dist/esm2020/src/map/map-plate/layers/cluster-layer/cluster-layer.settings.mjs +79 -1
  36. package/dist/esm2020/src/map/map-plate/layers/feature-layer/feature-layer.component.mjs +7 -7
  37. package/dist/esm2020/src/map/map-plate/layers/feature-layer/feature-layer.settings.mjs +37 -17
  38. package/dist/esm2020/src/map/map-plate/layers/tile-layer/tile-layer.component.mjs +7 -7
  39. package/dist/esm2020/src/map/map-plate/layers/tile-layer/tile-layer.settings.mjs +76 -1
  40. package/dist/esm2020/src/map/map-plate/map-plate.component.mjs +2 -2
  41. package/dist/esm2020/src/map/map-plate/tooltips/tooltip/tooltip.component.mjs +19 -19
  42. package/dist/esm2020/src/map/map-plate/tooltips/tooltip/tooltip.settings.mjs +1 -1
  43. package/dist/esm2020/src/map/messages/commands/fit-to-polygons.command.mjs +1 -1
  44. package/dist/esm2020/src/map/models/map-control.mjs +2 -2
  45. package/dist/esm2020/src/map/models/marker-model.mjs +1 -1
  46. package/dist/esm2020/src/map/models/polygon.model.mjs +11 -11
  47. package/dist/esm2020/src/map/services/feature.service.mjs +6 -6
  48. package/dist/esm2020/src/map/services/map-click.service.mjs +9 -9
  49. package/dist/esm2020/src/map/services/map-feature.service.mjs +1 -1
  50. package/dist/esm2020/src/map/services/map-state.service.mjs +2 -3
  51. package/dist/fesm2015/maps-components-src-map.mjs +457 -106
  52. package/dist/fesm2015/maps-components-src-map.mjs.map +1 -1
  53. package/dist/fesm2015/maps-components.mjs +457 -106
  54. package/dist/fesm2015/maps-components.mjs.map +1 -1
  55. package/dist/fesm2020/maps-components-src-map.mjs +454 -103
  56. package/dist/fesm2020/maps-components-src-map.mjs.map +1 -1
  57. package/dist/fesm2020/maps-components.mjs +454 -103
  58. package/dist/fesm2020/maps-components.mjs.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 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';
@@ -157,16 +157,6 @@ class MarkerModel {
157
157
  }
158
158
 
159
159
  class PolygonModel {
160
- static fromGeoJson(id, json, info) {
161
- let feature = new GeoJSON().readFeature(json);
162
- feature.setId(id);
163
- return new PolygonModel(feature, id, info);
164
- }
165
- static fromWKT(id, wkt, info) {
166
- let feature = new WKT().readFeature(wkt);
167
- feature.setId(id);
168
- return new PolygonModel(feature, id, info);
169
- }
170
160
  constructor(feature, id, info) {
171
161
  var _a, _b;
172
162
  this.info = info;
@@ -179,6 +169,16 @@ class PolygonModel {
179
169
  get feature() {
180
170
  return this._feature;
181
171
  }
172
+ static fromGeoJson(id, json, info) {
173
+ let feature = new GeoJSON().readFeature(json);
174
+ feature.setId(id);
175
+ return new PolygonModel(feature, id, info);
176
+ }
177
+ static fromWKT(id, wkt, info) {
178
+ let feature = new WKT().readFeature(wkt);
179
+ feature.setId(id);
180
+ return new PolygonModel(feature, id, info);
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: "15.2.10", 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);
@@ -1247,17 +1322,24 @@ class FeatureLayerSettings {
1247
1322
  */
1248
1323
  this.zIndex = 1;
1249
1324
  /**
1250
- * The maximum zoom at which the layer is visible. 19 by default
1325
+ The maximum view zoom level (inclusive) at which this layer will be visible.
1326
+
1327
+ @type {number}
1328
+ @default 19
1251
1329
  */
1252
1330
  this.maxZoom = 19;
1253
1331
  /**
1254
- * The minimum zoom at which the layer is visible. 0 by default
1332
+ The minimum view zoom level (exclusive) at which this layer will be visible.
1333
+
1334
+ @type {number}
1255
1335
  */
1256
1336
  this.minZoom = 0;
1257
1337
  }
1258
1338
  /**
1259
- * Creates a clone of the existing settings
1260
- * @param model
1339
+ * Copies the given FeatureLayerSettings object
1340
+ *
1341
+ * @param {FeatureLayerSettings} model - The FeatureLayerSettings object to be copied
1342
+ * @returns {FeatureLayerSettings} - A copy of the FeatureLayerSettings object
1261
1343
  */
1262
1344
  static copy(model) {
1263
1345
  const result = new FeatureLayerSettings();
@@ -1269,43 +1351,56 @@ class FeatureLayerSettings {
1269
1351
  return result;
1270
1352
  }
1271
1353
  /**
1272
- Setter for {@link FeatureLayerSettings.zIndex}
1273
- * @param zIndex
1354
+ * Sets the z-index value for the FeatureLayerSettings object.
1355
+ *
1356
+ * @param {number} zIndex - The new z-index value.
1357
+ * @return {FeatureLayerSettings} - The updated FeatureLayerSettings object.
1274
1358
  */
1275
1359
  setZIndex(zIndex) {
1276
1360
  return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { zIndex }));
1277
1361
  }
1278
1362
  /**
1279
- * Setter for {@link FeatureLayerSettings.name}
1280
- * @param name
1363
+ * Sets the name of the FeatureLayerSettings.
1364
+ *
1365
+ * @param {string} name - The name to set for the FeatureLayerSettings.
1366
+ *
1367
+ * @return {FeatureLayerSettings} - The updated FeatureLayerSettings object with the new name.
1281
1368
  */
1282
1369
  setName(name) {
1283
1370
  return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { name }));
1284
1371
  }
1285
1372
  /**
1286
- * Setter for {@link FeatureLayerSettings.maxZoom}
1287
- * @param maxZoom
1373
+ * Sets the maximum zoom level for the FeatureLayerSettings.
1374
+ *
1375
+ * @param {number} maxZoom - The maximum zoom level.
1376
+ * @return {FeatureLayerSettings} - The updated FeatureLayerSettings object.
1288
1377
  */
1289
1378
  setMaxZoom(maxZoom) {
1290
1379
  return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { maxZoom }));
1291
1380
  }
1292
1381
  /**
1293
- * Setter for {@link FeatureLayerSettings.minZoom}
1294
- * @param minZoom
1382
+ * Sets the minimum zoom level for the feature layer.
1383
+ *
1384
+ * @param {number} minZoom The minimum zoom level to be set.
1385
+ * @returns {FeatureLayerSettings} The updated feature layer settings object.
1295
1386
  */
1296
1387
  setMinZoom(minZoom) {
1297
1388
  return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { minZoom }));
1298
1389
  }
1299
1390
  /**
1300
- * Setter for {@link FeatureLayerSettings.style}
1301
- * @param style
1391
+ * Sets the style for the FeatureLayerSettings object.
1392
+ *
1393
+ * @param {Style | StyleFunction} style - The new style to set. It can be either a Style object or a StyleFunction.
1394
+ * @return {FeatureLayerSettings} - The updated FeatureLayerSettings object with the new style.
1302
1395
  */
1303
1396
  setStyle(style) {
1304
1397
  return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { style }));
1305
1398
  }
1306
1399
  /**
1307
- * Checks if the model has the same content
1308
- * @param model - the object to compare
1400
+ * Checks if the given FeatureLayerSettings object is identical to the current object.
1401
+ *
1402
+ * @param {FeatureLayerSettings} model - The FeatureLayerSettings object to compare with.
1403
+ * @return {boolean} - Returns true if the given object is identical to the current object, otherwise false.
1309
1404
  */
1310
1405
  isSame(model) {
1311
1406
  if (this.maxZoom !== model.maxZoom)
@@ -1355,18 +1450,18 @@ class FeatureLayerComponent extends DestructibleComponent {
1355
1450
  this._settings = new FeatureLayerSettings();
1356
1451
  this.onDestroy = () => this.removeLayer();
1357
1452
  }
1358
- ngOnInit() {
1359
- this.postboy
1360
- .subscribe(MapRenderedEvent.ID)
1361
- .pipe(filter((m) => !!m), first())
1362
- .subscribe((m) => this.initLayer());
1363
- }
1364
1453
  set settings(value) {
1365
1454
  if (!value || this._settings.isSame(value))
1366
1455
  return;
1367
1456
  this._settings = value;
1368
1457
  this.initLayer();
1369
1458
  }
1459
+ ngOnInit() {
1460
+ this.postboy
1461
+ .subscribe(MapRenderedEvent.ID)
1462
+ .pipe(filter((m) => !!m), first())
1463
+ .subscribe((m) => this.initLayer());
1464
+ }
1370
1465
  initLayer() {
1371
1466
  this.removeLayer();
1372
1467
  this.layer = this.factory.build(this._settings);
@@ -1390,12 +1485,34 @@ class ClusterLayerSettings {
1390
1485
  constructor() {
1391
1486
  this.name = IdGenerator.get();
1392
1487
  this.zIndex = 1;
1488
+ /**
1489
+ * The maximum view zoom level (inclusive) at which this layer will be visible.
1490
+ *
1491
+ * @type {number}
1492
+ * @default 19
1493
+ */
1393
1494
  this.maxZoom = 19;
1495
+ /**
1496
+ * The minimum view zoom level (exclusive) at which this layer will be visible.
1497
+ *
1498
+ * @type {number}
1499
+ */
1394
1500
  this.minZoom = 0;
1501
+ /**
1502
+ * Distance in pixels within which features will be clustered together.
1503
+ *
1504
+ * @type {number}
1505
+ */
1395
1506
  this.distance = 20;
1396
1507
  this.bbox = false;
1397
1508
  this.clusterCancel = 14;
1398
1509
  }
1510
+ /**
1511
+ * Creates a copy of the given ClusterLayerSettings object.
1512
+ *
1513
+ * @param {ClusterLayerSettings} model - The ClusterLayerSettings object to be copied.
1514
+ * @returns {ClusterLayerSettings} - A new ClusterLayerSettings object that is a copy of the original object.
1515
+ */
1399
1516
  static copy(model) {
1400
1517
  const result = new ClusterLayerSettings();
1401
1518
  result.name = model.name;
@@ -1408,30 +1525,86 @@ class ClusterLayerSettings {
1408
1525
  result.style = model.style;
1409
1526
  return result;
1410
1527
  }
1528
+ /**
1529
+ * Set the z-index for the ClusterLayer.
1530
+ *
1531
+ * @param {number} zIndex - The new z-index for the ClusterLayer.
1532
+ * @return {ClusterLayerSettings} - The updated ClusterLayerSettings object.
1533
+ */
1411
1534
  setZIndex(zIndex) {
1412
1535
  return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { zIndex }));
1413
1536
  }
1537
+ /**
1538
+ * Sets the distance value for ClusterLayerSettings.
1539
+ *
1540
+ * @param {number} distance - The distance value to be set.
1541
+ * @return {ClusterLayerSettings} - The modified ClusterLayerSettings object.
1542
+ */
1414
1543
  setDistance(distance) {
1415
1544
  return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { distance }));
1416
1545
  }
1546
+ /**
1547
+ * Sets the name of the ClusterLayerSettings object.
1548
+ *
1549
+ * @param {string} name - The name to set for the ClusterLayerSettings.
1550
+ * @return {ClusterLayerSettings} - A new ClusterLayerSettings object with the updated name.
1551
+ */
1417
1552
  setName(name) {
1418
1553
  return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { name }));
1419
1554
  }
1555
+ /**
1556
+ * Sets the maximum zoom level for the Cluster Layer.
1557
+ *
1558
+ * @param {number} maxZoom - The maximum zoom level to be set.
1559
+ * @return {ClusterLayerSettings} - The updated ClusterLayerSettings object.
1560
+ */
1420
1561
  setMaxZoom(maxZoom) {
1421
1562
  return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { maxZoom }));
1422
1563
  }
1564
+ /**
1565
+ * Sets the minimum zoom level for the ClusterLayerSettings.
1566
+ *
1567
+ * @param {number} minZoom - The minimum zoom level to set.
1568
+ * @return {ClusterLayerSettings} - The updated ClusterLayerSettings object.
1569
+ */
1423
1570
  setMinZoom(minZoom) {
1424
1571
  return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { minZoom }));
1425
1572
  }
1573
+ /**
1574
+ * Sets the cluster cancel number for the ClusterLayerSettings.
1575
+ *
1576
+ * @param {number} clusterCancel - The new cluster cancel number.
1577
+ * @returns {ClusterLayerSettings} - The updated ClusterLayerSettings object.
1578
+ */
1426
1579
  setClusterCancel(clusterCancel) {
1427
1580
  return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { clusterCancel }));
1428
1581
  }
1582
+ /**
1583
+ * Sets the value of 'bbox' property in the ClusterLayerSettings object.
1584
+ *
1585
+ * @param {boolean} bbox - A boolean value indicating whether to include bounding box calculation in the cluster layer settings.
1586
+ * @returns {ClusterLayerSettings} - The updated ClusterLayerSettings object with the newly set 'bbox' value.
1587
+ */
1429
1588
  setBbox(bbox) {
1430
1589
  return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { bbox }));
1431
1590
  }
1591
+ /**
1592
+ * Sets the style for the ClusterLayerSettings.
1593
+ *
1594
+ * @param {function} style - A function that takes an array of identified features as input and returns a Style or StyleFunction.
1595
+ *
1596
+ * @return {ClusterLayerSettings} - The updated ClusterLayerSettings object with the new style applied.
1597
+ */
1432
1598
  setStyle(style) {
1433
1599
  return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { style }));
1434
1600
  }
1601
+ /**
1602
+ * Checks if the current ClusterLayerSettings object is the same as the specified model.
1603
+ *
1604
+ * @param {ClusterLayerSettings} model - The model to compare with the current object.
1605
+ *
1606
+ * @return {boolean} - Returns true if the current ClusterLayerSettings object is the same as the specified model, otherwise false.
1607
+ */
1435
1608
  isSame(model) {
1436
1609
  if (this.maxZoom !== model.maxZoom)
1437
1610
  return false;
@@ -1536,6 +1709,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1536
1709
  }]
1537
1710
  }] });
1538
1711
 
1712
+ /**
1713
+ * Represents a cluster layer component.
1714
+ */
1539
1715
  class ClusterLayerComponent extends DestructibleComponent {
1540
1716
  constructor(postboy, factory) {
1541
1717
  super();
@@ -1545,18 +1721,23 @@ class ClusterLayerComponent extends DestructibleComponent {
1545
1721
  this._settings = new ClusterLayerSettings();
1546
1722
  this.onDestroy = () => this.removeLayer();
1547
1723
  }
1548
- ngOnInit() {
1549
- this.postboy
1550
- .subscribe(MapRenderedEvent.ID)
1551
- .pipe(filter((m) => !!m), first())
1552
- .subscribe((m) => this.initLayer());
1553
- }
1724
+ /**
1725
+ * Sets the settings for the cluster layer.
1726
+ *
1727
+ * @param {ClusterLayerSettings | undefined} value - The settings for the cluster layer.
1728
+ */
1554
1729
  set settings(value) {
1555
1730
  if (!value || this._settings.isSame(value))
1556
1731
  return;
1557
1732
  this._settings = value;
1558
1733
  this.initLayer();
1559
1734
  }
1735
+ ngOnInit() {
1736
+ this.postboy
1737
+ .subscribe(MapRenderedEvent.ID)
1738
+ .pipe(filter((m) => !!m), first())
1739
+ .subscribe((m) => this.initLayer());
1740
+ }
1560
1741
  initLayer() {
1561
1742
  this.removeLayer();
1562
1743
  this.manager = this.factory.build(this._settings, this.postboy);
@@ -1609,8 +1790,8 @@ class MapPlateComponent extends DestructibleComponent {
1609
1790
  this.registrator = registrator;
1610
1791
  this.detector = detector;
1611
1792
  this.osmUrl = '';
1612
- this._settings = new MapSettings();
1613
1793
  this.drawingLayerSettings = new FeatureLayerSettings().setName(MapConstants.DrawingLayerId);
1794
+ this._settings = new MapSettings();
1614
1795
  this.onDestroy = () => {
1615
1796
  this.registrator.down();
1616
1797
  };
@@ -1672,6 +1853,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1672
1853
  type: Input
1673
1854
  }] } });
1674
1855
 
1856
+ /**
1857
+ * MarkersComponent is a component that displays markers on a map.
1858
+ * It listens for changes in the `markers` input property and
1859
+ * automatically puts the markers on the map using the MapPostboyService.
1860
+ */
1675
1861
  class MarkersComponent extends DestructibleComponent {
1676
1862
  constructor(postboy) {
1677
1863
  super();
@@ -1679,6 +1865,11 @@ class MarkersComponent extends DestructibleComponent {
1679
1865
  this.layerName = '';
1680
1866
  this._markers = [];
1681
1867
  }
1868
+ /**
1869
+ * Sets the markers property.
1870
+ *
1871
+ * @param {MarkerModel[]} value - The array of MarkerModel objects to set as markers.
1872
+ */
1682
1873
  set markers(value) {
1683
1874
  this._markers = value !== null && value !== void 0 ? value : [];
1684
1875
  this.putMarkers();
@@ -1736,23 +1927,12 @@ class TooltipSettings {
1736
1927
  }
1737
1928
 
1738
1929
  class TooltipComponent extends DestructibleComponent {
1739
- set settings(value) {
1740
- if (!value || this._settings.isSame(value))
1741
- return;
1742
- this._settings = value;
1743
- this.detector.detectChanges();
1744
- }
1745
1930
  constructor(postboy, detector) {
1746
1931
  super();
1747
1932
  this.postboy = postboy;
1748
1933
  this.detector = detector;
1749
- this._settings = new TooltipSettings();
1750
1934
  this.show = false;
1751
- this.removeOverlay = () => {
1752
- var _a;
1753
- !!this.overlay && ((_a = this.map) === null || _a === void 0 ? void 0 : _a.removeOverlay(this.overlay));
1754
- this.show = false;
1755
- };
1935
+ this._settings = new TooltipSettings();
1756
1936
  this.options = (coordinates) => {
1757
1937
  var _a;
1758
1938
  return {
@@ -1762,12 +1942,31 @@ class TooltipComponent extends DestructibleComponent {
1762
1942
  position: coordinates,
1763
1943
  };
1764
1944
  };
1945
+ this.removeOverlay = () => {
1946
+ var _a;
1947
+ !!this.overlay && ((_a = this.map) === null || _a === void 0 ? void 0 : _a.removeOverlay(this.overlay));
1948
+ this.show = false;
1949
+ };
1950
+ }
1951
+ set settings(value) {
1952
+ if (!value || this._settings.isSame(value))
1953
+ return;
1954
+ this._settings = value;
1955
+ this.detector.detectChanges();
1765
1956
  }
1766
1957
  ngOnInit() {
1767
1958
  this.subs.push(this.observeMapRender());
1768
1959
  this.subs.push(this.observeMapClick());
1769
1960
  this.subs.push(this.observeClose());
1770
1961
  }
1962
+ addOverlay(coordinates) {
1963
+ var _a;
1964
+ this.removeOverlay();
1965
+ this.overlay = new Overlay(this.options(coordinates));
1966
+ (_a = this.map) === null || _a === void 0 ? void 0 : _a.addOverlay(this.overlay);
1967
+ this.show = true;
1968
+ this.detector.detectChanges();
1969
+ }
1771
1970
  observeMapClick() {
1772
1971
  return this.postboy.subscribe(MapClickEvent.ID).subscribe((ev) => {
1773
1972
  this._settings.show(ev) ? this.addOverlay(ev.coordinates) : this.removeOverlay();
@@ -1784,14 +1983,6 @@ class TooltipComponent extends DestructibleComponent {
1784
1983
  this.map = m.map;
1785
1984
  });
1786
1985
  }
1787
- addOverlay(coordinates) {
1788
- var _a;
1789
- this.removeOverlay();
1790
- this.overlay = new Overlay(this.options(coordinates));
1791
- (_a = this.map) === null || _a === void 0 ? void 0 : _a.addOverlay(this.overlay);
1792
- this.show = true;
1793
- this.detector.detectChanges();
1794
- }
1795
1986
  }
1796
1987
  TooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TooltipComponent, deps: [{ token: MapPostboyService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1797
1988
  TooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", 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 });
@@ -1805,6 +1996,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1805
1996
  type: Input
1806
1997
  }] } });
1807
1998
 
1999
+ /**
2000
+ * Component for rendering polygons on a map.
2001
+ * It listens for changes in the `polygons` input property and
2002
+ * automatically puts the polygons on the map using the MapPostboyService.
2003
+ */
1808
2004
  class PolygonsComponent extends DestructibleComponent {
1809
2005
  constructor(postboy) {
1810
2006
  super();
@@ -1812,6 +2008,11 @@ class PolygonsComponent extends DestructibleComponent {
1812
2008
  this.layerName = '';
1813
2009
  this._polygons = [];
1814
2010
  }
2011
+ /**
2012
+ * Sets the value of polygons.
2013
+ *
2014
+ * @param {PolygonModel[]} value - The new value for polygons.
2015
+ */
1815
2016
  set polygons(value) {
1816
2017
  this._polygons = value !== null && value !== void 0 ? value : [];
1817
2018
  this.putPolygons();
@@ -1839,14 +2040,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1839
2040
  type: Input
1840
2041
  }] } });
1841
2042
 
2043
+ /**
2044
+ * Represents the settings for a zoom control.
2045
+ */
1842
2046
  class ZoomControlSettings {
1843
2047
  constructor() {
2048
+ /**
2049
+ * The CSS class name of the control element.
2050
+ *
2051
+ * @type {string}
2052
+ */
1844
2053
  this.controlClass = 'ol-zoom';
2054
+ /**
2055
+ * The CSS class name for zoom in button.
2056
+ * @type {string}
2057
+ */
1845
2058
  this.zoomInClass = 'ol-zoom-in';
2059
+ /**
2060
+ * The CSS class name for the zoom out button element.
2061
+ *
2062
+ * @type {string}
2063
+ */
1846
2064
  this.zoomOutClass = 'ol-zoom-out';
2065
+ /**
2066
+ * The label for the zoom in action.
2067
+ *
2068
+ * @type {string}
2069
+ */
1847
2070
  this.zoomInLabel = 'Zoom In';
2071
+ /**
2072
+ * The label for the zoom out control.
2073
+ *
2074
+ * @type {string}
2075
+ */
1848
2076
  this.zoomOutLabel = 'Zoom Out';
1849
2077
  }
2078
+ /**
2079
+ * Copies the provided ZoomControlSettings object.
2080
+ *
2081
+ * @param {ZoomControlSettings} model - The ZoomControlSettings object to be copied.
2082
+ * @return {ZoomControlSettings} - The copied ZoomControlSettings object.
2083
+ */
1850
2084
  static copy(model) {
1851
2085
  const result = new ZoomControlSettings();
1852
2086
  result.controlClass = model.controlClass;
@@ -1856,6 +2090,13 @@ class ZoomControlSettings {
1856
2090
  result.zoomOutLabel = model.zoomOutLabel;
1857
2091
  return result;
1858
2092
  }
2093
+ /**
2094
+ * Checks if the current ZoomControlSettings object is equal to the given model.
2095
+ *
2096
+ * @param {ZoomControlSettings} model - The ZoomControlSettings object to compare with.
2097
+ *
2098
+ * @return {boolean} - true if the current object is equal to the given model, false otherwise.
2099
+ */
1859
2100
  isSame(model) {
1860
2101
  if (this.zoomInClass !== model.zoomInClass)
1861
2102
  return false;
@@ -1869,30 +2110,61 @@ class ZoomControlSettings {
1869
2110
  return false;
1870
2111
  return true;
1871
2112
  }
2113
+ /**
2114
+ * Sets the zoom in label of the Zoom Control Settings.
2115
+ *
2116
+ * @param {string} zoomInLabel - The label for the zoom in button.
2117
+ * @return {ZoomControlSettings} - The new Zoom Control Settings object with the updated zoom in label.
2118
+ */
1872
2119
  setZoomInLabel(zoomInLabel) {
1873
2120
  return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomInLabel }));
1874
2121
  }
2122
+ /**
2123
+ * Sets the zoomOutClass property of the ZoomControlSettings object.
2124
+ *
2125
+ * @param {string} zoomOutClass - The CSS class to be assigned to the zoom out button.
2126
+ * @return {ZoomControlSettings} - The updated ZoomControlSettings object with the new zoomOutClass value.
2127
+ */
1875
2128
  setZoomOutClass(zoomOutClass) {
1876
2129
  return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomOutClass }));
1877
2130
  }
2131
+ /**
2132
+ * Sets the zoom in class for the zoom control settings.
2133
+ *
2134
+ * @param {string} zoomInClass - The new zoom in class to be set.
2135
+ * @return {ZoomControlSettings} - The updated zoom control settings.
2136
+ */
1878
2137
  setZoomInClass(zoomInClass) {
1879
2138
  return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomInClass }));
1880
2139
  }
2140
+ /**
2141
+ * Set the label for the zoom out control.
2142
+ *
2143
+ * @param {string} zoomOutLabel - The label for the zoom out control.
2144
+ * @returns {ZoomControlSettings} - The updated zoom control settings.
2145
+ */
1881
2146
  setZoomOutLabel(zoomOutLabel) {
1882
2147
  return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomOutLabel }));
1883
2148
  }
2149
+ /**
2150
+ * Sets the control class for the ZoomControlSettings.
2151
+ *
2152
+ * @param {string} controlClass - The class name of the control to be set.
2153
+ *
2154
+ * @return {ZoomControlSettings} - The modified ZoomControlSettings object.
2155
+ */
1884
2156
  setControlClass(controlClass) {
1885
2157
  return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { controlClass }));
1886
2158
  }
1887
2159
  }
1888
2160
 
2161
+ /**
2162
+ * @class
2163
+ * @classdesc Represents a component for the Zoom control on a map.
2164
+ * @extends DestructibleComponent
2165
+ * @implements OnInit
2166
+ */
1889
2167
  class MapControlZoomComponent extends DestructibleComponent {
1890
- set settings(value) {
1891
- if (!value || this._settings.isSame(value))
1892
- return;
1893
- this._settings = value;
1894
- this.setControl();
1895
- }
1896
2168
  constructor(postboy) {
1897
2169
  super();
1898
2170
  this.postboy = postboy;
@@ -1902,6 +2174,23 @@ class MapControlZoomComponent extends DestructibleComponent {
1902
2174
  };
1903
2175
  this.eliminate = () => !!this.map && !!this.control && this.map.removeControl(this.control);
1904
2176
  }
2177
+ /**
2178
+ * Sets the settings for the Zoom Control.
2179
+ *
2180
+ * @param {ZoomControlSettings | undefined} value - The new settings for the Zoom Control.
2181
+ *
2182
+ * @description
2183
+ * This method sets the settings for the Zoom Control. It takes a parameter `value` which should be an object of type `ZoomControlSettings` or `undefined`.
2184
+ *
2185
+ * If the `value` is `undefined` or the same as the current settings, the method will return without making any changes.
2186
+ *
2187
+ */
2188
+ set settings(value) {
2189
+ if (!value || this._settings.isSame(value))
2190
+ return;
2191
+ this._settings = value;
2192
+ this.setControl();
2193
+ }
1905
2194
  ngOnInit() {
1906
2195
  this.postboy
1907
2196
  .subscribe(MapRenderedEvent.ID)
@@ -1977,7 +2266,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1977
2266
  }]
1978
2267
  }] });
1979
2268
 
2269
+ /**
2270
+ * Helper class to create and modify marker styles.
2271
+ */
1980
2272
  class MarkerStyleHelper {
2273
+ /**
2274
+ * Creates a new Style object from an SVG.
2275
+ * @param {string} svg - The SVG string.
2276
+ * @param {Array<number>} [size=[30, 30]] - The size of the icon image.
2277
+ * @param {number} [zIndex=400] - The zIndex of the style.
2278
+ * @returns {Style} A new Style object.
2279
+ */
1981
2280
  static fromSvg(svg, size = [30, 30], zIndex = 400) {
1982
2281
  let image = new Image();
1983
2282
  image.src = 'data:image/svg+xml,' + escape(svg);
@@ -1989,6 +2288,15 @@ class MarkerStyleHelper {
1989
2288
  zIndex,
1990
2289
  });
1991
2290
  }
2291
+ /**
2292
+ * Returns a Style object with a circle style.
2293
+ *
2294
+ * @param {number} radius - The radius of the circle.
2295
+ * @param {string} fill - The fill color of the circle. Format: '#RRGGBB' or 'rgba(R, G, B, A)'.
2296
+ * @param {string} strokeColor - The stroke color of the circle. Format: '#RRGGBB' or 'rgba(R, G, B, A)'.
2297
+ * @param {number} [strokeWidth=1] - The width of the stroke. Default is 1.
2298
+ * @returns {Style} - A Style object with a Circle image.
2299
+ */
1992
2300
  static circle(radius, fill, strokeColor, strokeWidth = 1) {
1993
2301
  return new Style({
1994
2302
  image: new Circle({
@@ -1998,13 +2306,32 @@ class MarkerStyleHelper {
1998
2306
  }),
1999
2307
  });
2000
2308
  }
2309
+ /**
2310
+ * Applies the given Text to the provided Style.
2311
+ *
2312
+ * @param {Style} style - The Style to modify.
2313
+ * @param {Text} text - The Text to apply to the Style.
2314
+ * @return {Style} - The modified Style with the applied Text.
2315
+ */
2001
2316
  static withText(style, text) {
2002
2317
  style.setText(text);
2003
2318
  return style;
2004
2319
  }
2005
2320
  }
2006
2321
 
2322
+ /**
2323
+ * A helper class for creating polygon styles.
2324
+ * @class
2325
+ */
2007
2326
  class PolygonStyleHelper {
2327
+ /**
2328
+ * Creates a Style object with the given fill color, stroke color, and stroke width.
2329
+ *
2330
+ * @param {string} fill - The fill color in hexadecimal or RGB format.
2331
+ * @param {string} stroke - The stroke color in hexadecimal or RGB format.
2332
+ * @param {number} [strokeWidth=1] - The width of the stroke. Defaults to 1.
2333
+ * @return {Style} The created Style object.
2334
+ */
2008
2335
  static simple(fill, stroke, strokeWidth = 1) {
2009
2336
  return new Style({
2010
2337
  fill: new Fill({
@@ -2016,6 +2343,15 @@ class PolygonStyleHelper {
2016
2343
  }),
2017
2344
  });
2018
2345
  }
2346
+ /**
2347
+ * Creates a new Style object with the given fill, stroke, stroke width, and pin radius.
2348
+ *
2349
+ * @param {string} fill - The color to use for the fill of the style.
2350
+ * @param {string} stroke - The color to use for the stroke of the style.
2351
+ * @param {number} [strokeWidth=1] - The width of the stroke. Defaults to 1.
2352
+ * @param {number} [pinRadius=5] - The radius of the circle used as the image for the style. Defaults to 5.
2353
+ * @returns {Style} - The newly created Style object.
2354
+ */
2019
2355
  static edit(fill, stroke, strokeWidth = 1, pinRadius = 5) {
2020
2356
  return new Style({
2021
2357
  image: new Circle({
@@ -2035,7 +2371,18 @@ class PolygonStyleHelper {
2035
2371
  }
2036
2372
  }
2037
2373
 
2374
+ /**
2375
+ * Helper class for creating text styles.
2376
+ */
2038
2377
  class TextStyleHelper {
2378
+ /**
2379
+ * Creates a new instance of the Text class with the specified properties.
2380
+ *
2381
+ * @param {string} text - The text content of the Text object.
2382
+ * @param {string} font - The font style of the Text object.
2383
+ * @param {string} color - The color of the Text object.
2384
+ * @return {Text} A new instance of the Text class.
2385
+ */
2039
2386
  static get(text, font, color) {
2040
2387
  return new Text({
2041
2388
  text: text,
@@ -2048,37 +2395,41 @@ class TextStyleHelper {
2048
2395
  }
2049
2396
  }
2050
2397
 
2398
+ /**
2399
+ * A helper class for converting and stringify features.
2400
+ */
2051
2401
  class StringifyFeatureHelper {
2052
2402
  static polygon(feature, format = FeatureOutputFormat.GeoJson) {
2053
2403
  return format === FeatureOutputFormat.GeoJson
2054
2404
  ? new GeoJSON().writeFeature(feature)
2055
2405
  : new WKT().writeFeature(feature);
2056
2406
  }
2407
+ /**
2408
+ * Creates a polygon feature representing a circle based on a given feature with a circle geometry.
2409
+ *
2410
+ * @param {Feature<Geometry>} feature - The input feature with a circle geometry.
2411
+ * @param {FeatureOutputFormat} format - The format for outputting the polygon feature. (default: FeatureOutputFormat.GeoJson)
2412
+ *
2413
+ * @return {string} - The string representation of the polygon feature.
2414
+ */
2057
2415
  static circle(feature, format = FeatureOutputFormat.GeoJson) {
2058
- // const clone = feature.clone();
2059
- // clone.setGeometry(fromCircle(feature.getGeometry()! as Circle));
2060
- const tetemp = feature.getGeometryName();
2061
2416
  const circle = feature.getGeometry();
2062
- // const temp = StringifyFeatureHelper.drawCircle(circle.getCenter(), circle.getRadius());
2063
- const ttt = feature.getGeometry().getExtent();
2064
- const eastPoint = [ttt[2], (ttt[1] + ttt[3]) / 2];
2065
- const aaa = [
2066
- ...transform([ttt[0], ttt[1]], 'EPSG:4326', 'EPSG:3857'),
2067
- ...transform([ttt[2], ttt[3]], 'EPSG:4326', 'EPSG:3857'),
2417
+ const ext = feature.getGeometry().getExtent();
2418
+ const coords = [
2419
+ ...transform([ext[0], ext[1]], 'EPSG:4326', 'EPSG:3857'),
2420
+ ...transform([ext[2], ext[3]], 'EPSG:4326', 'EPSG:3857'),
2068
2421
  ];
2069
- const radius = (aaa[2] - aaa[0]) / 2;
2070
- const radius2 = new LineString([circle.getCenter(), eastPoint]).getLength();
2422
+ const radius = (coords[2] - coords[0]) / 2;
2071
2423
  const polygonGeom = new Polygon(StringifyFeatureHelper.drawCircle(circle.getCenter(), radius));
2072
- // var edgeCoordinate = [circle.getCenter()[0] + radius, circle.getCenter()[1]];
2073
- // var wgs84Sphere = new Sphere(6378137);
2074
2424
  return StringifyFeatureHelper.polygon(new Feature(polygonGeom), format);
2075
- // const rad = circle.getRadius();
2076
- // const degrees = 180 / Math.PI; // radians to degrees
2077
- // const radians = Math.PI / 180; // degrees to radians
2078
- // const rlat = rad * degrees * 1000;
2079
- // const rlng = rad * radians;
2080
- // return StringifyFeatureHelper.polygon(new Feature<Geometry>(circular(circle.getCenter(),circle.getRadius() * METERS_PER_UNIT)), format);
2081
2425
  }
2426
+ /**
2427
+ * Draw a circle based on a center point and radius.
2428
+ *
2429
+ * @param {number[]} point - The center point coordinates in EPSG:4326 format.
2430
+ * @param {number} radius - The radius of the circle in meters.
2431
+ * @return {Coordinate[][]} - The coordinates of the circle boundary in EPSG:4326 format.
2432
+ */
2082
2433
  static drawCircle(point, radius) {
2083
2434
  const tetetemp = transform(point, 'EPSG:4326', 'EPSG:3857');
2084
2435
  // const tetetemp = point;