@artstesh/maps 4.1.7 → 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.
- package/dist/esm2020/map/helpers/marker-style.helper.mjs +27 -1
- package/dist/esm2020/map/helpers/polygon-style.helper.mjs +22 -1
- package/dist/esm2020/map/helpers/stringify-feature.helper.mjs +24 -21
- package/dist/esm2020/map/helpers/text-style.helper.mjs +12 -1
- package/dist/esm2020/map/map-plate/controls/map-control-zoom/map-control-zoom.component.mjs +24 -7
- package/dist/esm2020/map/map-plate/controls/map-control-zoom/zoom-control.settings.mjs +72 -1
- package/dist/esm2020/map/map-plate/features/markers/markers.component.mjs +11 -1
- package/dist/esm2020/map/map-plate/features/polygons/polygons.component.mjs +11 -1
- package/dist/esm2020/map/map-plate/layers/cluster-layer/cluster-layer.component.mjs +15 -7
- package/dist/esm2020/map/map-plate/layers/cluster-layer/cluster-layer.settings.mjs +79 -1
- package/dist/esm2020/map/map-plate/layers/feature-layer/feature-layer.component.mjs +7 -7
- package/dist/esm2020/map/map-plate/layers/feature-layer/feature-layer.settings.mjs +37 -17
- package/dist/esm2020/map/map-plate/layers/tile-layer/tile-layer.component.mjs +7 -7
- package/dist/esm2020/map/map-plate/layers/tile-layer/tile-layer.settings.mjs +76 -1
- package/dist/esm2020/map/map-plate/map-plate.component.mjs +2 -2
- package/dist/esm2020/map/map-plate/tooltips/tooltip/tooltip.component.mjs +19 -19
- package/dist/esm2020/map/map-plate/tooltips/tooltip/tooltip.settings.mjs +1 -1
- package/dist/esm2020/map/messages/commands/draw-selection-area.command.mjs +1 -1
- package/dist/esm2020/map/messages/commands/fit-to-polygons.command.mjs +13 -0
- package/dist/esm2020/map/messages/index.mjs +2 -1
- package/dist/esm2020/map/messages/queries/get-features-in-area.query.mjs +1 -1
- package/dist/esm2020/map/models/index.mjs +1 -2
- package/dist/esm2020/map/models/map-control.mjs +2 -2
- package/dist/esm2020/map/models/marker-model.mjs +1 -1
- package/dist/esm2020/map/models/polygon.model.mjs +11 -11
- package/dist/esm2020/map/services/drawing/drawing.service.mjs +3 -2
- package/dist/esm2020/map/services/feature.service.mjs +6 -6
- package/dist/esm2020/map/services/map-click.service.mjs +9 -9
- package/dist/esm2020/map/services/map-feature.service.mjs +17 -4
- package/dist/esm2020/map/services/map-management.service.mjs +2 -2
- package/dist/esm2020/map/services/map-state.service.mjs +2 -3
- package/dist/esm2020/map/services/message-registrator.service.mjs +3 -2
- package/dist/esm2020/src/map/helpers/marker-style.helper.mjs +27 -1
- package/dist/esm2020/src/map/helpers/polygon-style.helper.mjs +22 -1
- package/dist/esm2020/src/map/helpers/stringify-feature.helper.mjs +24 -21
- package/dist/esm2020/src/map/helpers/text-style.helper.mjs +12 -1
- package/dist/esm2020/src/map/map-plate/controls/map-control-zoom/map-control-zoom.component.mjs +24 -7
- package/dist/esm2020/src/map/map-plate/controls/map-control-zoom/zoom-control.settings.mjs +72 -1
- package/dist/esm2020/src/map/map-plate/features/markers/markers.component.mjs +11 -1
- package/dist/esm2020/src/map/map-plate/features/polygons/polygons.component.mjs +11 -1
- package/dist/esm2020/src/map/map-plate/layers/cluster-layer/cluster-layer.component.mjs +15 -7
- package/dist/esm2020/src/map/map-plate/layers/cluster-layer/cluster-layer.settings.mjs +79 -1
- package/dist/esm2020/src/map/map-plate/layers/feature-layer/feature-layer.component.mjs +7 -7
- package/dist/esm2020/src/map/map-plate/layers/feature-layer/feature-layer.settings.mjs +37 -17
- package/dist/esm2020/src/map/map-plate/layers/tile-layer/tile-layer.component.mjs +7 -7
- package/dist/esm2020/src/map/map-plate/layers/tile-layer/tile-layer.settings.mjs +76 -1
- package/dist/esm2020/src/map/map-plate/map-plate.component.mjs +2 -2
- package/dist/esm2020/src/map/map-plate/tooltips/tooltip/tooltip.component.mjs +19 -19
- package/dist/esm2020/src/map/map-plate/tooltips/tooltip/tooltip.settings.mjs +1 -1
- package/dist/esm2020/src/map/messages/commands/draw-selection-area.command.mjs +1 -1
- package/dist/esm2020/src/map/messages/commands/fit-to-polygons.command.mjs +13 -0
- package/dist/esm2020/src/map/messages/index.mjs +2 -1
- package/dist/esm2020/src/map/messages/queries/get-features-in-area.query.mjs +1 -1
- package/dist/esm2020/src/map/models/index.mjs +1 -2
- package/dist/esm2020/src/map/models/map-control.mjs +2 -2
- package/dist/esm2020/src/map/models/marker-model.mjs +1 -1
- package/dist/esm2020/src/map/models/polygon.model.mjs +11 -11
- package/dist/esm2020/src/map/services/drawing/drawing.service.mjs +3 -2
- package/dist/esm2020/src/map/services/feature.service.mjs +6 -6
- package/dist/esm2020/src/map/services/map-click.service.mjs +9 -9
- package/dist/esm2020/src/map/services/map-feature.service.mjs +17 -4
- package/dist/esm2020/src/map/services/map-management.service.mjs +2 -2
- package/dist/esm2020/src/map/services/map-state.service.mjs +2 -3
- package/dist/esm2020/src/map/services/message-registrator.service.mjs +3 -2
- package/dist/fesm2015/maps-components-src-map.mjs +487 -165
- package/dist/fesm2015/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2015/maps-components.mjs +487 -165
- package/dist/fesm2015/maps-components.mjs.map +1 -1
- package/dist/fesm2020/maps-components-src-map.mjs +484 -162
- package/dist/fesm2020/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2020/maps-components.mjs +484 -162
- package/dist/fesm2020/maps-components.mjs.map +1 -1
- package/dist/map/helpers/marker-style.helper.d.ts +26 -0
- package/dist/map/helpers/polygon-style.helper.d.ts +21 -0
- package/dist/map/helpers/stringify-feature.helper.d.ts +18 -0
- package/dist/map/helpers/text-style.helper.d.ts +11 -0
- package/dist/map/map-plate/controls/map-control-zoom/map-control-zoom.component.d.ts +20 -3
- package/dist/map/map-plate/controls/map-control-zoom/zoom-control.settings.d.ts +71 -0
- package/dist/map/map-plate/features/markers/markers.component.d.ts +10 -0
- package/dist/map/map-plate/features/polygons/polygons.component.d.ts +10 -0
- package/dist/map/map-plate/layers/cluster-layer/cluster-layer.component.d.ts +10 -2
- package/dist/map/map-plate/layers/cluster-layer/cluster-layer.settings.d.ts +78 -0
- package/dist/map/map-plate/layers/feature-layer/feature-layer.component.d.ts +2 -2
- package/dist/map/map-plate/layers/feature-layer/feature-layer.settings.d.ts +36 -16
- package/dist/map/map-plate/layers/tile-layer/tile-layer.component.d.ts +1 -1
- package/dist/map/map-plate/layers/tile-layer/tile-layer.settings.d.ts +75 -0
- package/dist/map/map-plate/map-plate.component.d.ts +2 -2
- package/dist/map/map-plate/tooltips/tooltip/tooltip.component.d.ts +5 -5
- package/dist/map/map-plate/tooltips/tooltip/tooltip.settings.d.ts +1 -1
- package/dist/map/messages/commands/draw-selection-area.command.d.ts +2 -1
- package/dist/map/messages/commands/fit-to-polygons.command.d.ts +9 -0
- package/dist/map/messages/index.d.ts +1 -0
- package/dist/map/messages/queries/get-features-in-area.query.d.ts +1 -1
- package/dist/map/models/index.d.ts +0 -1
- package/dist/map/models/map-control.d.ts +1 -1
- package/dist/map/models/polygon.model.d.ts +2 -2
- package/dist/map/services/feature.service.d.ts +1 -1
- package/dist/map/services/map-click.service.d.ts +1 -1
- package/dist/map/services/map-feature.service.d.ts +2 -0
- package/dist/package.json +1 -0
- package/dist/src/map/helpers/marker-style.helper.d.ts +26 -0
- package/dist/src/map/helpers/polygon-style.helper.d.ts +21 -0
- package/dist/src/map/helpers/stringify-feature.helper.d.ts +18 -0
- package/dist/src/map/helpers/text-style.helper.d.ts +11 -0
- package/dist/src/map/map-plate/controls/map-control-zoom/map-control-zoom.component.d.ts +20 -3
- package/dist/src/map/map-plate/controls/map-control-zoom/zoom-control.settings.d.ts +71 -0
- package/dist/src/map/map-plate/features/markers/markers.component.d.ts +10 -0
- package/dist/src/map/map-plate/features/polygons/polygons.component.d.ts +10 -0
- package/dist/src/map/map-plate/layers/cluster-layer/cluster-layer.component.d.ts +10 -2
- package/dist/src/map/map-plate/layers/cluster-layer/cluster-layer.settings.d.ts +78 -0
- package/dist/src/map/map-plate/layers/feature-layer/feature-layer.component.d.ts +2 -2
- package/dist/src/map/map-plate/layers/feature-layer/feature-layer.settings.d.ts +36 -16
- package/dist/src/map/map-plate/layers/tile-layer/tile-layer.component.d.ts +1 -1
- package/dist/src/map/map-plate/layers/tile-layer/tile-layer.settings.d.ts +75 -0
- package/dist/src/map/map-plate/map-plate.component.d.ts +2 -2
- package/dist/src/map/map-plate/tooltips/tooltip/tooltip.component.d.ts +5 -5
- package/dist/src/map/map-plate/tooltips/tooltip/tooltip.settings.d.ts +1 -1
- package/dist/src/map/messages/commands/draw-selection-area.command.d.ts +2 -1
- package/dist/src/map/messages/commands/fit-to-polygons.command.d.ts +9 -0
- package/dist/src/map/messages/index.d.ts +1 -0
- package/dist/src/map/messages/queries/get-features-in-area.query.d.ts +1 -1
- package/dist/src/map/models/index.d.ts +0 -1
- package/dist/src/map/models/map-control.d.ts +1 -1
- package/dist/src/map/models/polygon.model.d.ts +2 -2
- package/dist/src/map/services/feature.service.d.ts +1 -1
- package/dist/src/map/services/map-click.service.d.ts +1 -1
- package/dist/src/map/services/map-feature.service.d.ts +2 -0
- package/package.json +3 -2
- package/dist/esm2020/map/models/dictionary.mjs +0 -56
- package/dist/esm2020/src/map/models/dictionary.mjs +0 -56
- package/dist/map/models/dictionary.d.ts +0 -17
- package/dist/src/map/models/dictionary.d.ts +0 -17
|
@@ -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
|
|
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';
|
|
@@ -12,6 +12,7 @@ import { PostboyGenericMessage, PostboyCallbackMessage, PostboyExecutor, Postboy
|
|
|
12
12
|
import { Draw, Modify, Translate } from 'ol/interaction';
|
|
13
13
|
import { createRegularPolygon, createBox } from 'ol/interaction/Draw';
|
|
14
14
|
import * as Sphere from 'ol/sphere';
|
|
15
|
+
import { Dictionary } from '@artstesh/collections';
|
|
15
16
|
import { first, filter, auditTime } from 'rxjs/operators';
|
|
16
17
|
import { Vector, XYZ } from 'ol/source';
|
|
17
18
|
import TileLayer from 'ol/layer/Tile';
|
|
@@ -156,16 +157,6 @@ class MarkerModel {
|
|
|
156
157
|
}
|
|
157
158
|
|
|
158
159
|
class PolygonModel {
|
|
159
|
-
static fromGeoJson(id, json, info) {
|
|
160
|
-
let feature = new GeoJSON().readFeature(json);
|
|
161
|
-
feature.setId(id);
|
|
162
|
-
return new PolygonModel(feature, id, info);
|
|
163
|
-
}
|
|
164
|
-
static fromWKT(id, wkt, info) {
|
|
165
|
-
let feature = new WKT().readFeature(wkt);
|
|
166
|
-
feature.setId(id);
|
|
167
|
-
return new PolygonModel(feature, id, info);
|
|
168
|
-
}
|
|
169
160
|
constructor(feature, id, info) {
|
|
170
161
|
this.info = info;
|
|
171
162
|
this.id = id == null ? IdGenerator.get() : id;
|
|
@@ -177,6 +168,16 @@ class PolygonModel {
|
|
|
177
168
|
get feature() {
|
|
178
169
|
return this._feature;
|
|
179
170
|
}
|
|
171
|
+
static fromGeoJson(id, json, info) {
|
|
172
|
+
let feature = new GeoJSON().readFeature(json);
|
|
173
|
+
feature.setId(id);
|
|
174
|
+
return new PolygonModel(feature, id, info);
|
|
175
|
+
}
|
|
176
|
+
static fromWKT(id, wkt, info) {
|
|
177
|
+
let feature = new WKT().readFeature(wkt);
|
|
178
|
+
feature.setId(id);
|
|
179
|
+
return new PolygonModel(feature, id, info);
|
|
180
|
+
}
|
|
180
181
|
}
|
|
181
182
|
|
|
182
183
|
var DrawingType;
|
|
@@ -193,65 +194,9 @@ var FeatureOutputFormat;
|
|
|
193
194
|
FeatureOutputFormat[FeatureOutputFormat["WKT"] = 2] = "WKT";
|
|
194
195
|
})(FeatureOutputFormat || (FeatureOutputFormat = {}));
|
|
195
196
|
|
|
196
|
-
class Dictionary {
|
|
197
|
-
constructor() {
|
|
198
|
-
this.collection = {};
|
|
199
|
-
this._keys = new Set();
|
|
200
|
-
this.has = (key) => this._keys.has(key);
|
|
201
|
-
}
|
|
202
|
-
get keys() {
|
|
203
|
-
return Array.from(this._keys);
|
|
204
|
-
}
|
|
205
|
-
get size() {
|
|
206
|
-
return this._keys.size;
|
|
207
|
-
}
|
|
208
|
-
static clone(dic, action) {
|
|
209
|
-
return Dictionary.create(dic.collection, action);
|
|
210
|
-
}
|
|
211
|
-
static create(dic, action) {
|
|
212
|
-
let keyList = Object.keys(dic);
|
|
213
|
-
const result = new Dictionary();
|
|
214
|
-
for (let i = 0; i < keyList.length; i++) {
|
|
215
|
-
let key = keyList[i];
|
|
216
|
-
result._keys.add(key);
|
|
217
|
-
result.collection[key] = action ? action(dic[key], key) : dic[key];
|
|
218
|
-
}
|
|
219
|
-
return result;
|
|
220
|
-
}
|
|
221
|
-
find(predicate) {
|
|
222
|
-
let result = null;
|
|
223
|
-
this.forEach((e) => {
|
|
224
|
-
if (result === null && predicate(e))
|
|
225
|
-
result = e;
|
|
226
|
-
});
|
|
227
|
-
return result;
|
|
228
|
-
}
|
|
229
|
-
take(key) {
|
|
230
|
-
return this._keys.has(key) ? this.collection[key] : null;
|
|
231
|
-
}
|
|
232
|
-
put(key, value) {
|
|
233
|
-
if (value == null)
|
|
234
|
-
return;
|
|
235
|
-
this.collection[key] = value;
|
|
236
|
-
this._keys.add(key);
|
|
237
|
-
}
|
|
238
|
-
rmv(key) {
|
|
239
|
-
if (!this._keys.has(key))
|
|
240
|
-
return;
|
|
241
|
-
delete this.collection[key];
|
|
242
|
-
this._keys.delete(key);
|
|
243
|
-
}
|
|
244
|
-
forEach(callback) {
|
|
245
|
-
let keys = Object.keys(this.collection);
|
|
246
|
-
for (let i = 0; i < keys.length; i++) {
|
|
247
|
-
callback(this.collection[keys[i]], i);
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
|
|
252
197
|
/**
|
|
253
198
|
*
|
|
254
|
-
* 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.
|
|
199
|
+
* 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.
|
|
255
200
|
* This is the base class for controls. You can use it for simple custom controls by creating the element with listeners, creating an instance:
|
|
256
201
|
* var myControl = new Control({element: myElement}); and then adding this to the map.
|
|
257
202
|
* 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.
|
|
@@ -418,6 +363,18 @@ class CalculateAreaExecutor extends PostboyExecutor {
|
|
|
418
363
|
}
|
|
419
364
|
CalculateAreaExecutor.ID = '172ecf46-86b5-4f46-a5f1-96ba2cbb1694';
|
|
420
365
|
|
|
366
|
+
class FitToPolygonsCommand extends PostboyGenericMessage {
|
|
367
|
+
constructor(features, zoomAfter = 0) {
|
|
368
|
+
super();
|
|
369
|
+
this.features = features;
|
|
370
|
+
this.zoomAfter = zoomAfter;
|
|
371
|
+
}
|
|
372
|
+
get id() {
|
|
373
|
+
return FitToPolygonsCommand.ID;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
FitToPolygonsCommand.ID = 'a9e42b23-ffaf-4c46-8370-e0432cd14d60';
|
|
377
|
+
|
|
421
378
|
class AddLayerCommand extends PostboyGenericMessage {
|
|
422
379
|
constructor(layer) {
|
|
423
380
|
super();
|
|
@@ -534,6 +491,11 @@ class FeatureService {
|
|
|
534
491
|
static filterFeaturesInArea(query) {
|
|
535
492
|
return query.features.filter((f) => FeatureService.booleanIntersects(query.area, f.getGeometry()));
|
|
536
493
|
}
|
|
494
|
+
static calculateArea(g) {
|
|
495
|
+
if (!g)
|
|
496
|
+
return 0;
|
|
497
|
+
return Sphere.getArea(g, { projection: 'EPSG:4326' });
|
|
498
|
+
}
|
|
537
499
|
static booleanIntersects(g1, g2) {
|
|
538
500
|
if (g2.getType() === 'Point')
|
|
539
501
|
return g1.intersectsCoordinate(g2.getCoordinates());
|
|
@@ -543,11 +505,6 @@ class FeatureService {
|
|
|
543
505
|
return g1.intersectsCoordinate(g2.getInteriorPoint().getCoordinates());
|
|
544
506
|
return false;
|
|
545
507
|
}
|
|
546
|
-
static calculateArea(g) {
|
|
547
|
-
if (!g)
|
|
548
|
-
return 0;
|
|
549
|
-
return Sphere.getArea(g, { projection: 'EPSG:4326' });
|
|
550
|
-
}
|
|
551
508
|
}
|
|
552
509
|
|
|
553
510
|
class GetFeaturesInAreaQuery extends PostboyCallbackMessage {
|
|
@@ -751,15 +708,28 @@ class MapFeatureService {
|
|
|
751
708
|
up() {
|
|
752
709
|
this.observeMapRender();
|
|
753
710
|
this.observeFitToFeatures();
|
|
711
|
+
this.observeFitToPolygons();
|
|
754
712
|
}
|
|
755
713
|
observeMapRender() {
|
|
756
714
|
this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
|
|
757
715
|
this.map = m.map;
|
|
716
|
+
if (this.fitPolygonsWaiting)
|
|
717
|
+
this.postboy.fire(this.fitPolygonsWaiting);
|
|
758
718
|
});
|
|
759
719
|
}
|
|
760
720
|
observeFitToFeatures() {
|
|
761
|
-
this.postboy.subscribe(FitToFeaturesCommand.ID).subscribe((
|
|
762
|
-
this.fitToGeometries(
|
|
721
|
+
this.postboy.subscribe(FitToFeaturesCommand.ID).subscribe((cmd) => {
|
|
722
|
+
this.fitToGeometries(cmd.features.map((f) => f.getGeometry()), cmd.zoomAfter);
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
observeFitToPolygons() {
|
|
726
|
+
this.postboy.subscribe(FitToPolygonsCommand.ID).subscribe((cmd) => {
|
|
727
|
+
if (!this.map) {
|
|
728
|
+
this.fitPolygonsWaiting = cmd;
|
|
729
|
+
return;
|
|
730
|
+
}
|
|
731
|
+
this.fitPolygonsWaiting = undefined;
|
|
732
|
+
this.fitToGeometries(cmd.features.map((f) => f.feature.getGeometry()), cmd.zoomAfter);
|
|
763
733
|
});
|
|
764
734
|
}
|
|
765
735
|
fitToGeometries(geometries, zoomAfter) {
|
|
@@ -784,14 +754,6 @@ class MapClickService {
|
|
|
784
754
|
up() {
|
|
785
755
|
this.observeMapRender();
|
|
786
756
|
}
|
|
787
|
-
observeMapRender() {
|
|
788
|
-
this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
|
|
789
|
-
this.map = m.map;
|
|
790
|
-
this.map?.on('singleclick', (e) => {
|
|
791
|
-
this.postboy.fire(this.onClick(e));
|
|
792
|
-
});
|
|
793
|
-
});
|
|
794
|
-
}
|
|
795
757
|
onClick(ev) {
|
|
796
758
|
const model = new MapClickEvent(ev.coordinate, {}, {});
|
|
797
759
|
this.map?.forEachFeatureAtPixel(ev.pixel, (f, l) => {
|
|
@@ -809,6 +771,14 @@ class MapClickService {
|
|
|
809
771
|
});
|
|
810
772
|
return model;
|
|
811
773
|
}
|
|
774
|
+
observeMapRender() {
|
|
775
|
+
this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
|
|
776
|
+
this.map = m.map;
|
|
777
|
+
this.map?.on('singleclick', (e) => {
|
|
778
|
+
this.postboy.fire(this.onClick(e));
|
|
779
|
+
});
|
|
780
|
+
});
|
|
781
|
+
}
|
|
812
782
|
getFeatureCollectionWithInner(features) {
|
|
813
783
|
const result = [];
|
|
814
784
|
features?.forEach((f) => {
|
|
@@ -1041,6 +1011,7 @@ class MessageRegistratorService extends PostboyAbstractRegistrator {
|
|
|
1041
1011
|
this.registerSubject(MapClickEvent.ID);
|
|
1042
1012
|
this.registerSubject(CloseTooltipCommand.ID);
|
|
1043
1013
|
this.registerSubject(FitToFeaturesCommand.ID);
|
|
1014
|
+
this.registerSubject(FitToPolygonsCommand.ID);
|
|
1044
1015
|
this.registerSubject(MapMoveEndEvent.ID);
|
|
1045
1016
|
this.registerSubject(CancelDrawingCommand.ID);
|
|
1046
1017
|
this.registerSubject(StartDrawingCommand.ID);
|
|
@@ -1065,14 +1036,53 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1065
1036
|
type: Injectable
|
|
1066
1037
|
}], ctorParameters: function () { return [{ type: MapPostboyService }, { type: MapManagementService }, { type: MapStateService }, { type: MapFeatureService }, { type: MapClickService }, { type: DrawingService }, { type: FeatureModificationService }, { type: ControlsService }]; } });
|
|
1067
1038
|
|
|
1039
|
+
/**
|
|
1040
|
+
* Class representing settings for a tile layer.
|
|
1041
|
+
*/
|
|
1068
1042
|
class TileLayerSettings {
|
|
1069
1043
|
constructor() {
|
|
1044
|
+
/**
|
|
1045
|
+
* The maximum zoom level for a map view.
|
|
1046
|
+
*
|
|
1047
|
+
* @type {number}
|
|
1048
|
+
* @default 19
|
|
1049
|
+
*/
|
|
1070
1050
|
this.maxZoom = 19;
|
|
1051
|
+
/**
|
|
1052
|
+
* The minimum zoom level allowed.
|
|
1053
|
+
*
|
|
1054
|
+
* @type {number}
|
|
1055
|
+
*/
|
|
1071
1056
|
this.minZoom = 0;
|
|
1057
|
+
/**
|
|
1058
|
+
* The opacity of an element.
|
|
1059
|
+
*
|
|
1060
|
+
* @type {number}
|
|
1061
|
+
* @default 0.6
|
|
1062
|
+
*/
|
|
1072
1063
|
this.opacity = 0.6;
|
|
1064
|
+
/**
|
|
1065
|
+
* Represents the tiles URL.
|
|
1066
|
+
* @typedef {string} url
|
|
1067
|
+
*
|
|
1068
|
+
* @example
|
|
1069
|
+
* 'https://example.ex/{z}/{x}/{y}.png'
|
|
1070
|
+
*/
|
|
1073
1071
|
this.url = '';
|
|
1072
|
+
/**
|
|
1073
|
+
* The projection of the coordinate system.
|
|
1074
|
+
*
|
|
1075
|
+
* @type {string}
|
|
1076
|
+
* @default 'EPSG:3857'
|
|
1077
|
+
*/
|
|
1074
1078
|
this.projection = 'EPSG:3857';
|
|
1075
1079
|
}
|
|
1080
|
+
/**
|
|
1081
|
+
* Creates a copy of the given tile layer settings.
|
|
1082
|
+
*
|
|
1083
|
+
* @param {TileLayerSettings} model - The tile layer settings to be copied.
|
|
1084
|
+
* @return {TileLayerSettings} - A new instance of TileLayerSettings with the same properties as the model.
|
|
1085
|
+
*/
|
|
1076
1086
|
static copy(model) {
|
|
1077
1087
|
const result = new TileLayerSettings();
|
|
1078
1088
|
result.maxZoom = model.maxZoom;
|
|
@@ -1082,21 +1092,57 @@ class TileLayerSettings {
|
|
|
1082
1092
|
result.url = model.url;
|
|
1083
1093
|
return result;
|
|
1084
1094
|
}
|
|
1095
|
+
/**
|
|
1096
|
+
* Sets the URL of the TileLayerSettings object.
|
|
1097
|
+
*
|
|
1098
|
+
* @param {string} url - The URL to be set.
|
|
1099
|
+
* @return {TileLayerSettings} - The updated TileLayerSettings object.
|
|
1100
|
+
*/
|
|
1085
1101
|
setUrl(url) {
|
|
1086
1102
|
return TileLayerSettings.copy({ ...this, url });
|
|
1087
1103
|
}
|
|
1104
|
+
/**
|
|
1105
|
+
* Sets the maximum zoom level for the tile layer.
|
|
1106
|
+
*
|
|
1107
|
+
* @param {number} maxZoom - The maximum zoom level.
|
|
1108
|
+
* @returns {TileLayerSettings} - The updated tile layer settings object.
|
|
1109
|
+
*/
|
|
1088
1110
|
setMaxZoom(maxZoom) {
|
|
1089
1111
|
return TileLayerSettings.copy({ ...this, maxZoom });
|
|
1090
1112
|
}
|
|
1113
|
+
/**
|
|
1114
|
+
* Sets the minimum zoom level for the Tile Layer.
|
|
1115
|
+
*
|
|
1116
|
+
* @param {number} minZoom - The minimum zoom level to be set.
|
|
1117
|
+
* @return {TileLayerSettings} The modified TileLayerSettings object with the updated minimum zoom level.
|
|
1118
|
+
*/
|
|
1091
1119
|
setMinZoom(minZoom) {
|
|
1092
1120
|
return TileLayerSettings.copy({ ...this, minZoom });
|
|
1093
1121
|
}
|
|
1122
|
+
/**
|
|
1123
|
+
* Sets the opacity of the TileLayerSettings.
|
|
1124
|
+
*
|
|
1125
|
+
* @param {number} opacity - The opacity value to set. Must be a number between 0 and 1.
|
|
1126
|
+
* @return {TileLayerSettings} - A new instance of TileLayerSettings with the opacity set.
|
|
1127
|
+
*/
|
|
1094
1128
|
setOpacity(opacity) {
|
|
1095
1129
|
return TileLayerSettings.copy({ ...this, opacity });
|
|
1096
1130
|
}
|
|
1131
|
+
/**
|
|
1132
|
+
* Sets the projection for the tile layer settings.
|
|
1133
|
+
*
|
|
1134
|
+
* @param {string} projection - The desired projection for the tile layer settings.
|
|
1135
|
+
* @return {TileLayerSettings} - The updated tile layer settings with the new projection.
|
|
1136
|
+
*/
|
|
1097
1137
|
setProjection(projection) {
|
|
1098
1138
|
return TileLayerSettings.copy({ ...this, projection });
|
|
1099
1139
|
}
|
|
1140
|
+
/**
|
|
1141
|
+
* Checks if the current instance of TileLayerSettings is equal to the given model.
|
|
1142
|
+
* @param {TileLayerSettings} model - The model to compare against.
|
|
1143
|
+
* @return {boolean} - True if all properties of the current instance matches the properties of the model;
|
|
1144
|
+
* otherwise, false.
|
|
1145
|
+
*/
|
|
1100
1146
|
isSame(model) {
|
|
1101
1147
|
if (this.maxZoom !== model.maxZoom)
|
|
1102
1148
|
return false;
|
|
@@ -1165,18 +1211,18 @@ class TileLayerComponent extends DestructibleComponent {
|
|
|
1165
1211
|
this._settings = new TileLayerSettings();
|
|
1166
1212
|
this.onDestroy = () => this.removeLayer();
|
|
1167
1213
|
}
|
|
1168
|
-
ngOnInit() {
|
|
1169
|
-
this.postboy
|
|
1170
|
-
.subscribe(MapRenderedEvent.ID)
|
|
1171
|
-
.pipe(filter((m) => !!m), first())
|
|
1172
|
-
.subscribe((m) => this.initLayer());
|
|
1173
|
-
}
|
|
1174
1214
|
set settings(value) {
|
|
1175
1215
|
if (!value || this._settings.isSame(value))
|
|
1176
1216
|
return;
|
|
1177
1217
|
this._settings = value;
|
|
1178
1218
|
this.initLayer();
|
|
1179
1219
|
}
|
|
1220
|
+
ngOnInit() {
|
|
1221
|
+
this.postboy
|
|
1222
|
+
.subscribe(MapRenderedEvent.ID)
|
|
1223
|
+
.pipe(filter((m) => !!m), first())
|
|
1224
|
+
.subscribe((m) => this.initLayer());
|
|
1225
|
+
}
|
|
1180
1226
|
initLayer() {
|
|
1181
1227
|
this.removeLayer();
|
|
1182
1228
|
this.layer = this.factory.build(this._settings);
|
|
@@ -1260,17 +1306,24 @@ class FeatureLayerSettings {
|
|
|
1260
1306
|
*/
|
|
1261
1307
|
this.zIndex = 1;
|
|
1262
1308
|
/**
|
|
1263
|
-
|
|
1309
|
+
The maximum view zoom level (inclusive) at which this layer will be visible.
|
|
1310
|
+
|
|
1311
|
+
@type {number}
|
|
1312
|
+
@default 19
|
|
1264
1313
|
*/
|
|
1265
1314
|
this.maxZoom = 19;
|
|
1266
1315
|
/**
|
|
1267
|
-
|
|
1316
|
+
The minimum view zoom level (exclusive) at which this layer will be visible.
|
|
1317
|
+
|
|
1318
|
+
@type {number}
|
|
1268
1319
|
*/
|
|
1269
1320
|
this.minZoom = 0;
|
|
1270
1321
|
}
|
|
1271
1322
|
/**
|
|
1272
|
-
*
|
|
1273
|
-
*
|
|
1323
|
+
* Copies the given FeatureLayerSettings object
|
|
1324
|
+
*
|
|
1325
|
+
* @param {FeatureLayerSettings} model - The FeatureLayerSettings object to be copied
|
|
1326
|
+
* @returns {FeatureLayerSettings} - A copy of the FeatureLayerSettings object
|
|
1274
1327
|
*/
|
|
1275
1328
|
static copy(model) {
|
|
1276
1329
|
const result = new FeatureLayerSettings();
|
|
@@ -1282,43 +1335,56 @@ class FeatureLayerSettings {
|
|
|
1282
1335
|
return result;
|
|
1283
1336
|
}
|
|
1284
1337
|
/**
|
|
1285
|
-
|
|
1286
|
-
*
|
|
1338
|
+
* Sets the z-index value for the FeatureLayerSettings object.
|
|
1339
|
+
*
|
|
1340
|
+
* @param {number} zIndex - The new z-index value.
|
|
1341
|
+
* @return {FeatureLayerSettings} - The updated FeatureLayerSettings object.
|
|
1287
1342
|
*/
|
|
1288
1343
|
setZIndex(zIndex) {
|
|
1289
1344
|
return FeatureLayerSettings.copy({ ...this, zIndex });
|
|
1290
1345
|
}
|
|
1291
1346
|
/**
|
|
1292
|
-
*
|
|
1293
|
-
*
|
|
1347
|
+
* Sets the name of the FeatureLayerSettings.
|
|
1348
|
+
*
|
|
1349
|
+
* @param {string} name - The name to set for the FeatureLayerSettings.
|
|
1350
|
+
*
|
|
1351
|
+
* @return {FeatureLayerSettings} - The updated FeatureLayerSettings object with the new name.
|
|
1294
1352
|
*/
|
|
1295
1353
|
setName(name) {
|
|
1296
1354
|
return FeatureLayerSettings.copy({ ...this, name });
|
|
1297
1355
|
}
|
|
1298
1356
|
/**
|
|
1299
|
-
*
|
|
1300
|
-
*
|
|
1357
|
+
* Sets the maximum zoom level for the FeatureLayerSettings.
|
|
1358
|
+
*
|
|
1359
|
+
* @param {number} maxZoom - The maximum zoom level.
|
|
1360
|
+
* @return {FeatureLayerSettings} - The updated FeatureLayerSettings object.
|
|
1301
1361
|
*/
|
|
1302
1362
|
setMaxZoom(maxZoom) {
|
|
1303
1363
|
return FeatureLayerSettings.copy({ ...this, maxZoom });
|
|
1304
1364
|
}
|
|
1305
1365
|
/**
|
|
1306
|
-
*
|
|
1307
|
-
*
|
|
1366
|
+
* Sets the minimum zoom level for the feature layer.
|
|
1367
|
+
*
|
|
1368
|
+
* @param {number} minZoom The minimum zoom level to be set.
|
|
1369
|
+
* @returns {FeatureLayerSettings} The updated feature layer settings object.
|
|
1308
1370
|
*/
|
|
1309
1371
|
setMinZoom(minZoom) {
|
|
1310
1372
|
return FeatureLayerSettings.copy({ ...this, minZoom });
|
|
1311
1373
|
}
|
|
1312
1374
|
/**
|
|
1313
|
-
*
|
|
1314
|
-
*
|
|
1375
|
+
* Sets the style for the FeatureLayerSettings object.
|
|
1376
|
+
*
|
|
1377
|
+
* @param {Style | StyleFunction} style - The new style to set. It can be either a Style object or a StyleFunction.
|
|
1378
|
+
* @return {FeatureLayerSettings} - The updated FeatureLayerSettings object with the new style.
|
|
1315
1379
|
*/
|
|
1316
1380
|
setStyle(style) {
|
|
1317
1381
|
return FeatureLayerSettings.copy({ ...this, style });
|
|
1318
1382
|
}
|
|
1319
1383
|
/**
|
|
1320
|
-
* Checks if the
|
|
1321
|
-
*
|
|
1384
|
+
* Checks if the given FeatureLayerSettings object is identical to the current object.
|
|
1385
|
+
*
|
|
1386
|
+
* @param {FeatureLayerSettings} model - The FeatureLayerSettings object to compare with.
|
|
1387
|
+
* @return {boolean} - Returns true if the given object is identical to the current object, otherwise false.
|
|
1322
1388
|
*/
|
|
1323
1389
|
isSame(model) {
|
|
1324
1390
|
if (this.maxZoom !== model.maxZoom)
|
|
@@ -1368,18 +1434,18 @@ class FeatureLayerComponent extends DestructibleComponent {
|
|
|
1368
1434
|
this._settings = new FeatureLayerSettings();
|
|
1369
1435
|
this.onDestroy = () => this.removeLayer();
|
|
1370
1436
|
}
|
|
1371
|
-
ngOnInit() {
|
|
1372
|
-
this.postboy
|
|
1373
|
-
.subscribe(MapRenderedEvent.ID)
|
|
1374
|
-
.pipe(filter((m) => !!m), first())
|
|
1375
|
-
.subscribe((m) => this.initLayer());
|
|
1376
|
-
}
|
|
1377
1437
|
set settings(value) {
|
|
1378
1438
|
if (!value || this._settings.isSame(value))
|
|
1379
1439
|
return;
|
|
1380
1440
|
this._settings = value;
|
|
1381
1441
|
this.initLayer();
|
|
1382
1442
|
}
|
|
1443
|
+
ngOnInit() {
|
|
1444
|
+
this.postboy
|
|
1445
|
+
.subscribe(MapRenderedEvent.ID)
|
|
1446
|
+
.pipe(filter((m) => !!m), first())
|
|
1447
|
+
.subscribe((m) => this.initLayer());
|
|
1448
|
+
}
|
|
1383
1449
|
initLayer() {
|
|
1384
1450
|
this.removeLayer();
|
|
1385
1451
|
this.layer = this.factory.build(this._settings);
|
|
@@ -1403,12 +1469,34 @@ class ClusterLayerSettings {
|
|
|
1403
1469
|
constructor() {
|
|
1404
1470
|
this.name = IdGenerator.get();
|
|
1405
1471
|
this.zIndex = 1;
|
|
1472
|
+
/**
|
|
1473
|
+
* The maximum view zoom level (inclusive) at which this layer will be visible.
|
|
1474
|
+
*
|
|
1475
|
+
* @type {number}
|
|
1476
|
+
* @default 19
|
|
1477
|
+
*/
|
|
1406
1478
|
this.maxZoom = 19;
|
|
1479
|
+
/**
|
|
1480
|
+
* The minimum view zoom level (exclusive) at which this layer will be visible.
|
|
1481
|
+
*
|
|
1482
|
+
* @type {number}
|
|
1483
|
+
*/
|
|
1407
1484
|
this.minZoom = 0;
|
|
1485
|
+
/**
|
|
1486
|
+
* Distance in pixels within which features will be clustered together.
|
|
1487
|
+
*
|
|
1488
|
+
* @type {number}
|
|
1489
|
+
*/
|
|
1408
1490
|
this.distance = 20;
|
|
1409
1491
|
this.bbox = false;
|
|
1410
1492
|
this.clusterCancel = 14;
|
|
1411
1493
|
}
|
|
1494
|
+
/**
|
|
1495
|
+
* Creates a copy of the given ClusterLayerSettings object.
|
|
1496
|
+
*
|
|
1497
|
+
* @param {ClusterLayerSettings} model - The ClusterLayerSettings object to be copied.
|
|
1498
|
+
* @returns {ClusterLayerSettings} - A new ClusterLayerSettings object that is a copy of the original object.
|
|
1499
|
+
*/
|
|
1412
1500
|
static copy(model) {
|
|
1413
1501
|
const result = new ClusterLayerSettings();
|
|
1414
1502
|
result.name = model.name;
|
|
@@ -1421,30 +1509,86 @@ class ClusterLayerSettings {
|
|
|
1421
1509
|
result.style = model.style;
|
|
1422
1510
|
return result;
|
|
1423
1511
|
}
|
|
1512
|
+
/**
|
|
1513
|
+
* Set the z-index for the ClusterLayer.
|
|
1514
|
+
*
|
|
1515
|
+
* @param {number} zIndex - The new z-index for the ClusterLayer.
|
|
1516
|
+
* @return {ClusterLayerSettings} - The updated ClusterLayerSettings object.
|
|
1517
|
+
*/
|
|
1424
1518
|
setZIndex(zIndex) {
|
|
1425
1519
|
return ClusterLayerSettings.copy({ ...this, zIndex });
|
|
1426
1520
|
}
|
|
1521
|
+
/**
|
|
1522
|
+
* Sets the distance value for ClusterLayerSettings.
|
|
1523
|
+
*
|
|
1524
|
+
* @param {number} distance - The distance value to be set.
|
|
1525
|
+
* @return {ClusterLayerSettings} - The modified ClusterLayerSettings object.
|
|
1526
|
+
*/
|
|
1427
1527
|
setDistance(distance) {
|
|
1428
1528
|
return ClusterLayerSettings.copy({ ...this, distance });
|
|
1429
1529
|
}
|
|
1530
|
+
/**
|
|
1531
|
+
* Sets the name of the ClusterLayerSettings object.
|
|
1532
|
+
*
|
|
1533
|
+
* @param {string} name - The name to set for the ClusterLayerSettings.
|
|
1534
|
+
* @return {ClusterLayerSettings} - A new ClusterLayerSettings object with the updated name.
|
|
1535
|
+
*/
|
|
1430
1536
|
setName(name) {
|
|
1431
1537
|
return ClusterLayerSettings.copy({ ...this, name });
|
|
1432
1538
|
}
|
|
1539
|
+
/**
|
|
1540
|
+
* Sets the maximum zoom level for the Cluster Layer.
|
|
1541
|
+
*
|
|
1542
|
+
* @param {number} maxZoom - The maximum zoom level to be set.
|
|
1543
|
+
* @return {ClusterLayerSettings} - The updated ClusterLayerSettings object.
|
|
1544
|
+
*/
|
|
1433
1545
|
setMaxZoom(maxZoom) {
|
|
1434
1546
|
return ClusterLayerSettings.copy({ ...this, maxZoom });
|
|
1435
1547
|
}
|
|
1548
|
+
/**
|
|
1549
|
+
* Sets the minimum zoom level for the ClusterLayerSettings.
|
|
1550
|
+
*
|
|
1551
|
+
* @param {number} minZoom - The minimum zoom level to set.
|
|
1552
|
+
* @return {ClusterLayerSettings} - The updated ClusterLayerSettings object.
|
|
1553
|
+
*/
|
|
1436
1554
|
setMinZoom(minZoom) {
|
|
1437
1555
|
return ClusterLayerSettings.copy({ ...this, minZoom });
|
|
1438
1556
|
}
|
|
1557
|
+
/**
|
|
1558
|
+
* Sets the cluster cancel number for the ClusterLayerSettings.
|
|
1559
|
+
*
|
|
1560
|
+
* @param {number} clusterCancel - The new cluster cancel number.
|
|
1561
|
+
* @returns {ClusterLayerSettings} - The updated ClusterLayerSettings object.
|
|
1562
|
+
*/
|
|
1439
1563
|
setClusterCancel(clusterCancel) {
|
|
1440
1564
|
return ClusterLayerSettings.copy({ ...this, clusterCancel });
|
|
1441
1565
|
}
|
|
1566
|
+
/**
|
|
1567
|
+
* Sets the value of 'bbox' property in the ClusterLayerSettings object.
|
|
1568
|
+
*
|
|
1569
|
+
* @param {boolean} bbox - A boolean value indicating whether to include bounding box calculation in the cluster layer settings.
|
|
1570
|
+
* @returns {ClusterLayerSettings} - The updated ClusterLayerSettings object with the newly set 'bbox' value.
|
|
1571
|
+
*/
|
|
1442
1572
|
setBbox(bbox) {
|
|
1443
1573
|
return ClusterLayerSettings.copy({ ...this, bbox });
|
|
1444
1574
|
}
|
|
1575
|
+
/**
|
|
1576
|
+
* Sets the style for the ClusterLayerSettings.
|
|
1577
|
+
*
|
|
1578
|
+
* @param {function} style - A function that takes an array of identified features as input and returns a Style or StyleFunction.
|
|
1579
|
+
*
|
|
1580
|
+
* @return {ClusterLayerSettings} - The updated ClusterLayerSettings object with the new style applied.
|
|
1581
|
+
*/
|
|
1445
1582
|
setStyle(style) {
|
|
1446
1583
|
return ClusterLayerSettings.copy({ ...this, style });
|
|
1447
1584
|
}
|
|
1585
|
+
/**
|
|
1586
|
+
* Checks if the current ClusterLayerSettings object is the same as the specified model.
|
|
1587
|
+
*
|
|
1588
|
+
* @param {ClusterLayerSettings} model - The model to compare with the current object.
|
|
1589
|
+
*
|
|
1590
|
+
* @return {boolean} - Returns true if the current ClusterLayerSettings object is the same as the specified model, otherwise false.
|
|
1591
|
+
*/
|
|
1448
1592
|
isSame(model) {
|
|
1449
1593
|
if (this.maxZoom !== model.maxZoom)
|
|
1450
1594
|
return false;
|
|
@@ -1546,6 +1690,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1546
1690
|
}]
|
|
1547
1691
|
}] });
|
|
1548
1692
|
|
|
1693
|
+
/**
|
|
1694
|
+
* Represents a cluster layer component.
|
|
1695
|
+
*/
|
|
1549
1696
|
class ClusterLayerComponent extends DestructibleComponent {
|
|
1550
1697
|
constructor(postboy, factory) {
|
|
1551
1698
|
super();
|
|
@@ -1555,18 +1702,23 @@ class ClusterLayerComponent extends DestructibleComponent {
|
|
|
1555
1702
|
this._settings = new ClusterLayerSettings();
|
|
1556
1703
|
this.onDestroy = () => this.removeLayer();
|
|
1557
1704
|
}
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
}
|
|
1705
|
+
/**
|
|
1706
|
+
* Sets the settings for the cluster layer.
|
|
1707
|
+
*
|
|
1708
|
+
* @param {ClusterLayerSettings | undefined} value - The settings for the cluster layer.
|
|
1709
|
+
*/
|
|
1564
1710
|
set settings(value) {
|
|
1565
1711
|
if (!value || this._settings.isSame(value))
|
|
1566
1712
|
return;
|
|
1567
1713
|
this._settings = value;
|
|
1568
1714
|
this.initLayer();
|
|
1569
1715
|
}
|
|
1716
|
+
ngOnInit() {
|
|
1717
|
+
this.postboy
|
|
1718
|
+
.subscribe(MapRenderedEvent.ID)
|
|
1719
|
+
.pipe(filter((m) => !!m), first())
|
|
1720
|
+
.subscribe((m) => this.initLayer());
|
|
1721
|
+
}
|
|
1570
1722
|
initLayer() {
|
|
1571
1723
|
this.removeLayer();
|
|
1572
1724
|
this.manager = this.factory.build(this._settings, this.postboy);
|
|
@@ -1618,8 +1770,8 @@ class MapPlateComponent extends DestructibleComponent {
|
|
|
1618
1770
|
this.registrator = registrator;
|
|
1619
1771
|
this.detector = detector;
|
|
1620
1772
|
this.osmUrl = '';
|
|
1621
|
-
this._settings = new MapSettings();
|
|
1622
1773
|
this.drawingLayerSettings = new FeatureLayerSettings().setName(MapConstants.DrawingLayerId);
|
|
1774
|
+
this._settings = new MapSettings();
|
|
1623
1775
|
this.onDestroy = () => {
|
|
1624
1776
|
this.registrator.down();
|
|
1625
1777
|
};
|
|
@@ -1681,6 +1833,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1681
1833
|
type: Input
|
|
1682
1834
|
}] } });
|
|
1683
1835
|
|
|
1836
|
+
/**
|
|
1837
|
+
* MarkersComponent is a component that displays markers on a map.
|
|
1838
|
+
* It listens for changes in the `markers` input property and
|
|
1839
|
+
* automatically puts the markers on the map using the MapPostboyService.
|
|
1840
|
+
*/
|
|
1684
1841
|
class MarkersComponent extends DestructibleComponent {
|
|
1685
1842
|
constructor(postboy) {
|
|
1686
1843
|
super();
|
|
@@ -1688,6 +1845,11 @@ class MarkersComponent extends DestructibleComponent {
|
|
|
1688
1845
|
this.layerName = '';
|
|
1689
1846
|
this._markers = [];
|
|
1690
1847
|
}
|
|
1848
|
+
/**
|
|
1849
|
+
* Sets the markers property.
|
|
1850
|
+
*
|
|
1851
|
+
* @param {MarkerModel[]} value - The array of MarkerModel objects to set as markers.
|
|
1852
|
+
*/
|
|
1691
1853
|
set markers(value) {
|
|
1692
1854
|
this._markers = value ?? [];
|
|
1693
1855
|
this.putMarkers();
|
|
@@ -1745,22 +1907,12 @@ class TooltipSettings {
|
|
|
1745
1907
|
}
|
|
1746
1908
|
|
|
1747
1909
|
class TooltipComponent extends DestructibleComponent {
|
|
1748
|
-
set settings(value) {
|
|
1749
|
-
if (!value || this._settings.isSame(value))
|
|
1750
|
-
return;
|
|
1751
|
-
this._settings = value;
|
|
1752
|
-
this.detector.detectChanges();
|
|
1753
|
-
}
|
|
1754
1910
|
constructor(postboy, detector) {
|
|
1755
1911
|
super();
|
|
1756
1912
|
this.postboy = postboy;
|
|
1757
1913
|
this.detector = detector;
|
|
1758
|
-
this._settings = new TooltipSettings();
|
|
1759
1914
|
this.show = false;
|
|
1760
|
-
this.
|
|
1761
|
-
!!this.overlay && this.map?.removeOverlay(this.overlay);
|
|
1762
|
-
this.show = false;
|
|
1763
|
-
};
|
|
1915
|
+
this._settings = new TooltipSettings();
|
|
1764
1916
|
this.options = (coordinates) => {
|
|
1765
1917
|
return {
|
|
1766
1918
|
element: this.container?.nativeElement,
|
|
@@ -1769,12 +1921,29 @@ class TooltipComponent extends DestructibleComponent {
|
|
|
1769
1921
|
position: coordinates,
|
|
1770
1922
|
};
|
|
1771
1923
|
};
|
|
1924
|
+
this.removeOverlay = () => {
|
|
1925
|
+
!!this.overlay && this.map?.removeOverlay(this.overlay);
|
|
1926
|
+
this.show = false;
|
|
1927
|
+
};
|
|
1928
|
+
}
|
|
1929
|
+
set settings(value) {
|
|
1930
|
+
if (!value || this._settings.isSame(value))
|
|
1931
|
+
return;
|
|
1932
|
+
this._settings = value;
|
|
1933
|
+
this.detector.detectChanges();
|
|
1772
1934
|
}
|
|
1773
1935
|
ngOnInit() {
|
|
1774
1936
|
this.subs.push(this.observeMapRender());
|
|
1775
1937
|
this.subs.push(this.observeMapClick());
|
|
1776
1938
|
this.subs.push(this.observeClose());
|
|
1777
1939
|
}
|
|
1940
|
+
addOverlay(coordinates) {
|
|
1941
|
+
this.removeOverlay();
|
|
1942
|
+
this.overlay = new Overlay(this.options(coordinates));
|
|
1943
|
+
this.map?.addOverlay(this.overlay);
|
|
1944
|
+
this.show = true;
|
|
1945
|
+
this.detector.detectChanges();
|
|
1946
|
+
}
|
|
1778
1947
|
observeMapClick() {
|
|
1779
1948
|
return this.postboy.subscribe(MapClickEvent.ID).subscribe((ev) => {
|
|
1780
1949
|
this._settings.show(ev) ? this.addOverlay(ev.coordinates) : this.removeOverlay();
|
|
@@ -1791,13 +1960,6 @@ class TooltipComponent extends DestructibleComponent {
|
|
|
1791
1960
|
this.map = m.map;
|
|
1792
1961
|
});
|
|
1793
1962
|
}
|
|
1794
|
-
addOverlay(coordinates) {
|
|
1795
|
-
this.removeOverlay();
|
|
1796
|
-
this.overlay = new Overlay(this.options(coordinates));
|
|
1797
|
-
this.map?.addOverlay(this.overlay);
|
|
1798
|
-
this.show = true;
|
|
1799
|
-
this.detector.detectChanges();
|
|
1800
|
-
}
|
|
1801
1963
|
}
|
|
1802
1964
|
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 });
|
|
1803
1965
|
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 });
|
|
@@ -1811,6 +1973,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1811
1973
|
type: Input
|
|
1812
1974
|
}] } });
|
|
1813
1975
|
|
|
1976
|
+
/**
|
|
1977
|
+
* Component for rendering polygons on a map.
|
|
1978
|
+
* It listens for changes in the `polygons` input property and
|
|
1979
|
+
* automatically puts the polygons on the map using the MapPostboyService.
|
|
1980
|
+
*/
|
|
1814
1981
|
class PolygonsComponent extends DestructibleComponent {
|
|
1815
1982
|
constructor(postboy) {
|
|
1816
1983
|
super();
|
|
@@ -1818,6 +1985,11 @@ class PolygonsComponent extends DestructibleComponent {
|
|
|
1818
1985
|
this.layerName = '';
|
|
1819
1986
|
this._polygons = [];
|
|
1820
1987
|
}
|
|
1988
|
+
/**
|
|
1989
|
+
* Sets the value of polygons.
|
|
1990
|
+
*
|
|
1991
|
+
* @param {PolygonModel[]} value - The new value for polygons.
|
|
1992
|
+
*/
|
|
1821
1993
|
set polygons(value) {
|
|
1822
1994
|
this._polygons = value ?? [];
|
|
1823
1995
|
this.putPolygons();
|
|
@@ -1845,14 +2017,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1845
2017
|
type: Input
|
|
1846
2018
|
}] } });
|
|
1847
2019
|
|
|
2020
|
+
/**
|
|
2021
|
+
* Represents the settings for a zoom control.
|
|
2022
|
+
*/
|
|
1848
2023
|
class ZoomControlSettings {
|
|
1849
2024
|
constructor() {
|
|
2025
|
+
/**
|
|
2026
|
+
* The CSS class name of the control element.
|
|
2027
|
+
*
|
|
2028
|
+
* @type {string}
|
|
2029
|
+
*/
|
|
1850
2030
|
this.controlClass = 'ol-zoom';
|
|
2031
|
+
/**
|
|
2032
|
+
* The CSS class name for zoom in button.
|
|
2033
|
+
* @type {string}
|
|
2034
|
+
*/
|
|
1851
2035
|
this.zoomInClass = 'ol-zoom-in';
|
|
2036
|
+
/**
|
|
2037
|
+
* The CSS class name for the zoom out button element.
|
|
2038
|
+
*
|
|
2039
|
+
* @type {string}
|
|
2040
|
+
*/
|
|
1852
2041
|
this.zoomOutClass = 'ol-zoom-out';
|
|
2042
|
+
/**
|
|
2043
|
+
* The label for the zoom in action.
|
|
2044
|
+
*
|
|
2045
|
+
* @type {string}
|
|
2046
|
+
*/
|
|
1853
2047
|
this.zoomInLabel = 'Zoom In';
|
|
2048
|
+
/**
|
|
2049
|
+
* The label for the zoom out control.
|
|
2050
|
+
*
|
|
2051
|
+
* @type {string}
|
|
2052
|
+
*/
|
|
1854
2053
|
this.zoomOutLabel = 'Zoom Out';
|
|
1855
2054
|
}
|
|
2055
|
+
/**
|
|
2056
|
+
* Copies the provided ZoomControlSettings object.
|
|
2057
|
+
*
|
|
2058
|
+
* @param {ZoomControlSettings} model - The ZoomControlSettings object to be copied.
|
|
2059
|
+
* @return {ZoomControlSettings} - The copied ZoomControlSettings object.
|
|
2060
|
+
*/
|
|
1856
2061
|
static copy(model) {
|
|
1857
2062
|
const result = new ZoomControlSettings();
|
|
1858
2063
|
result.controlClass = model.controlClass;
|
|
@@ -1862,6 +2067,13 @@ class ZoomControlSettings {
|
|
|
1862
2067
|
result.zoomOutLabel = model.zoomOutLabel;
|
|
1863
2068
|
return result;
|
|
1864
2069
|
}
|
|
2070
|
+
/**
|
|
2071
|
+
* Checks if the current ZoomControlSettings object is equal to the given model.
|
|
2072
|
+
*
|
|
2073
|
+
* @param {ZoomControlSettings} model - The ZoomControlSettings object to compare with.
|
|
2074
|
+
*
|
|
2075
|
+
* @return {boolean} - true if the current object is equal to the given model, false otherwise.
|
|
2076
|
+
*/
|
|
1865
2077
|
isSame(model) {
|
|
1866
2078
|
if (this.zoomInClass !== model.zoomInClass)
|
|
1867
2079
|
return false;
|
|
@@ -1875,30 +2087,61 @@ class ZoomControlSettings {
|
|
|
1875
2087
|
return false;
|
|
1876
2088
|
return true;
|
|
1877
2089
|
}
|
|
2090
|
+
/**
|
|
2091
|
+
* Sets the zoom in label of the Zoom Control Settings.
|
|
2092
|
+
*
|
|
2093
|
+
* @param {string} zoomInLabel - The label for the zoom in button.
|
|
2094
|
+
* @return {ZoomControlSettings} - The new Zoom Control Settings object with the updated zoom in label.
|
|
2095
|
+
*/
|
|
1878
2096
|
setZoomInLabel(zoomInLabel) {
|
|
1879
2097
|
return ZoomControlSettings.copy({ ...this, zoomInLabel });
|
|
1880
2098
|
}
|
|
2099
|
+
/**
|
|
2100
|
+
* Sets the zoomOutClass property of the ZoomControlSettings object.
|
|
2101
|
+
*
|
|
2102
|
+
* @param {string} zoomOutClass - The CSS class to be assigned to the zoom out button.
|
|
2103
|
+
* @return {ZoomControlSettings} - The updated ZoomControlSettings object with the new zoomOutClass value.
|
|
2104
|
+
*/
|
|
1881
2105
|
setZoomOutClass(zoomOutClass) {
|
|
1882
2106
|
return ZoomControlSettings.copy({ ...this, zoomOutClass });
|
|
1883
2107
|
}
|
|
2108
|
+
/**
|
|
2109
|
+
* Sets the zoom in class for the zoom control settings.
|
|
2110
|
+
*
|
|
2111
|
+
* @param {string} zoomInClass - The new zoom in class to be set.
|
|
2112
|
+
* @return {ZoomControlSettings} - The updated zoom control settings.
|
|
2113
|
+
*/
|
|
1884
2114
|
setZoomInClass(zoomInClass) {
|
|
1885
2115
|
return ZoomControlSettings.copy({ ...this, zoomInClass });
|
|
1886
2116
|
}
|
|
2117
|
+
/**
|
|
2118
|
+
* Set the label for the zoom out control.
|
|
2119
|
+
*
|
|
2120
|
+
* @param {string} zoomOutLabel - The label for the zoom out control.
|
|
2121
|
+
* @returns {ZoomControlSettings} - The updated zoom control settings.
|
|
2122
|
+
*/
|
|
1887
2123
|
setZoomOutLabel(zoomOutLabel) {
|
|
1888
2124
|
return ZoomControlSettings.copy({ ...this, zoomOutLabel });
|
|
1889
2125
|
}
|
|
2126
|
+
/**
|
|
2127
|
+
* Sets the control class for the ZoomControlSettings.
|
|
2128
|
+
*
|
|
2129
|
+
* @param {string} controlClass - The class name of the control to be set.
|
|
2130
|
+
*
|
|
2131
|
+
* @return {ZoomControlSettings} - The modified ZoomControlSettings object.
|
|
2132
|
+
*/
|
|
1890
2133
|
setControlClass(controlClass) {
|
|
1891
2134
|
return ZoomControlSettings.copy({ ...this, controlClass });
|
|
1892
2135
|
}
|
|
1893
2136
|
}
|
|
1894
2137
|
|
|
2138
|
+
/**
|
|
2139
|
+
* @class
|
|
2140
|
+
* @classdesc Represents a component for the Zoom control on a map.
|
|
2141
|
+
* @extends DestructibleComponent
|
|
2142
|
+
* @implements OnInit
|
|
2143
|
+
*/
|
|
1895
2144
|
class MapControlZoomComponent extends DestructibleComponent {
|
|
1896
|
-
set settings(value) {
|
|
1897
|
-
if (!value || this._settings.isSame(value))
|
|
1898
|
-
return;
|
|
1899
|
-
this._settings = value;
|
|
1900
|
-
this.setControl();
|
|
1901
|
-
}
|
|
1902
2145
|
constructor(postboy) {
|
|
1903
2146
|
super();
|
|
1904
2147
|
this.postboy = postboy;
|
|
@@ -1908,6 +2151,23 @@ class MapControlZoomComponent extends DestructibleComponent {
|
|
|
1908
2151
|
};
|
|
1909
2152
|
this.eliminate = () => !!this.map && !!this.control && this.map.removeControl(this.control);
|
|
1910
2153
|
}
|
|
2154
|
+
/**
|
|
2155
|
+
* Sets the settings for the Zoom Control.
|
|
2156
|
+
*
|
|
2157
|
+
* @param {ZoomControlSettings | undefined} value - The new settings for the Zoom Control.
|
|
2158
|
+
*
|
|
2159
|
+
* @description
|
|
2160
|
+
* This method sets the settings for the Zoom Control. It takes a parameter `value` which should be an object of type `ZoomControlSettings` or `undefined`.
|
|
2161
|
+
*
|
|
2162
|
+
* If the `value` is `undefined` or the same as the current settings, the method will return without making any changes.
|
|
2163
|
+
*
|
|
2164
|
+
*/
|
|
2165
|
+
set settings(value) {
|
|
2166
|
+
if (!value || this._settings.isSame(value))
|
|
2167
|
+
return;
|
|
2168
|
+
this._settings = value;
|
|
2169
|
+
this.setControl();
|
|
2170
|
+
}
|
|
1911
2171
|
ngOnInit() {
|
|
1912
2172
|
this.postboy
|
|
1913
2173
|
.subscribe(MapRenderedEvent.ID)
|
|
@@ -1983,7 +2243,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1983
2243
|
}]
|
|
1984
2244
|
}] });
|
|
1985
2245
|
|
|
2246
|
+
/**
|
|
2247
|
+
* Helper class to create and modify marker styles.
|
|
2248
|
+
*/
|
|
1986
2249
|
class MarkerStyleHelper {
|
|
2250
|
+
/**
|
|
2251
|
+
* Creates a new Style object from an SVG.
|
|
2252
|
+
* @param {string} svg - The SVG string.
|
|
2253
|
+
* @param {Array<number>} [size=[30, 30]] - The size of the icon image.
|
|
2254
|
+
* @param {number} [zIndex=400] - The zIndex of the style.
|
|
2255
|
+
* @returns {Style} A new Style object.
|
|
2256
|
+
*/
|
|
1987
2257
|
static fromSvg(svg, size = [30, 30], zIndex = 400) {
|
|
1988
2258
|
let image = new Image();
|
|
1989
2259
|
image.src = 'data:image/svg+xml,' + escape(svg);
|
|
@@ -1995,6 +2265,15 @@ class MarkerStyleHelper {
|
|
|
1995
2265
|
zIndex,
|
|
1996
2266
|
});
|
|
1997
2267
|
}
|
|
2268
|
+
/**
|
|
2269
|
+
* Returns a Style object with a circle style.
|
|
2270
|
+
*
|
|
2271
|
+
* @param {number} radius - The radius of the circle.
|
|
2272
|
+
* @param {string} fill - The fill color of the circle. Format: '#RRGGBB' or 'rgba(R, G, B, A)'.
|
|
2273
|
+
* @param {string} strokeColor - The stroke color of the circle. Format: '#RRGGBB' or 'rgba(R, G, B, A)'.
|
|
2274
|
+
* @param {number} [strokeWidth=1] - The width of the stroke. Default is 1.
|
|
2275
|
+
* @returns {Style} - A Style object with a Circle image.
|
|
2276
|
+
*/
|
|
1998
2277
|
static circle(radius, fill, strokeColor, strokeWidth = 1) {
|
|
1999
2278
|
return new Style({
|
|
2000
2279
|
image: new Circle({
|
|
@@ -2004,13 +2283,32 @@ class MarkerStyleHelper {
|
|
|
2004
2283
|
}),
|
|
2005
2284
|
});
|
|
2006
2285
|
}
|
|
2286
|
+
/**
|
|
2287
|
+
* Applies the given Text to the provided Style.
|
|
2288
|
+
*
|
|
2289
|
+
* @param {Style} style - The Style to modify.
|
|
2290
|
+
* @param {Text} text - The Text to apply to the Style.
|
|
2291
|
+
* @return {Style} - The modified Style with the applied Text.
|
|
2292
|
+
*/
|
|
2007
2293
|
static withText(style, text) {
|
|
2008
2294
|
style.setText(text);
|
|
2009
2295
|
return style;
|
|
2010
2296
|
}
|
|
2011
2297
|
}
|
|
2012
2298
|
|
|
2299
|
+
/**
|
|
2300
|
+
* A helper class for creating polygon styles.
|
|
2301
|
+
* @class
|
|
2302
|
+
*/
|
|
2013
2303
|
class PolygonStyleHelper {
|
|
2304
|
+
/**
|
|
2305
|
+
* Creates a Style object with the given fill color, stroke color, and stroke width.
|
|
2306
|
+
*
|
|
2307
|
+
* @param {string} fill - The fill color in hexadecimal or RGB format.
|
|
2308
|
+
* @param {string} stroke - The stroke color in hexadecimal or RGB format.
|
|
2309
|
+
* @param {number} [strokeWidth=1] - The width of the stroke. Defaults to 1.
|
|
2310
|
+
* @return {Style} The created Style object.
|
|
2311
|
+
*/
|
|
2014
2312
|
static simple(fill, stroke, strokeWidth = 1) {
|
|
2015
2313
|
return new Style({
|
|
2016
2314
|
fill: new Fill({
|
|
@@ -2022,6 +2320,15 @@ class PolygonStyleHelper {
|
|
|
2022
2320
|
}),
|
|
2023
2321
|
});
|
|
2024
2322
|
}
|
|
2323
|
+
/**
|
|
2324
|
+
* Creates a new Style object with the given fill, stroke, stroke width, and pin radius.
|
|
2325
|
+
*
|
|
2326
|
+
* @param {string} fill - The color to use for the fill of the style.
|
|
2327
|
+
* @param {string} stroke - The color to use for the stroke of the style.
|
|
2328
|
+
* @param {number} [strokeWidth=1] - The width of the stroke. Defaults to 1.
|
|
2329
|
+
* @param {number} [pinRadius=5] - The radius of the circle used as the image for the style. Defaults to 5.
|
|
2330
|
+
* @returns {Style} - The newly created Style object.
|
|
2331
|
+
*/
|
|
2025
2332
|
static edit(fill, stroke, strokeWidth = 1, pinRadius = 5) {
|
|
2026
2333
|
return new Style({
|
|
2027
2334
|
image: new Circle({
|
|
@@ -2041,7 +2348,18 @@ class PolygonStyleHelper {
|
|
|
2041
2348
|
}
|
|
2042
2349
|
}
|
|
2043
2350
|
|
|
2351
|
+
/**
|
|
2352
|
+
* Helper class for creating text styles.
|
|
2353
|
+
*/
|
|
2044
2354
|
class TextStyleHelper {
|
|
2355
|
+
/**
|
|
2356
|
+
* Creates a new instance of the Text class with the specified properties.
|
|
2357
|
+
*
|
|
2358
|
+
* @param {string} text - The text content of the Text object.
|
|
2359
|
+
* @param {string} font - The font style of the Text object.
|
|
2360
|
+
* @param {string} color - The color of the Text object.
|
|
2361
|
+
* @return {Text} A new instance of the Text class.
|
|
2362
|
+
*/
|
|
2045
2363
|
static get(text, font, color) {
|
|
2046
2364
|
return new Text({
|
|
2047
2365
|
text: text,
|
|
@@ -2054,37 +2372,41 @@ class TextStyleHelper {
|
|
|
2054
2372
|
}
|
|
2055
2373
|
}
|
|
2056
2374
|
|
|
2375
|
+
/**
|
|
2376
|
+
* A helper class for converting and stringify features.
|
|
2377
|
+
*/
|
|
2057
2378
|
class StringifyFeatureHelper {
|
|
2058
2379
|
static polygon(feature, format = FeatureOutputFormat.GeoJson) {
|
|
2059
2380
|
return format === FeatureOutputFormat.GeoJson
|
|
2060
2381
|
? new GeoJSON().writeFeature(feature)
|
|
2061
2382
|
: new WKT().writeFeature(feature);
|
|
2062
2383
|
}
|
|
2384
|
+
/**
|
|
2385
|
+
* Creates a polygon feature representing a circle based on a given feature with a circle geometry.
|
|
2386
|
+
*
|
|
2387
|
+
* @param {Feature<Geometry>} feature - The input feature with a circle geometry.
|
|
2388
|
+
* @param {FeatureOutputFormat} format - The format for outputting the polygon feature. (default: FeatureOutputFormat.GeoJson)
|
|
2389
|
+
*
|
|
2390
|
+
* @return {string} - The string representation of the polygon feature.
|
|
2391
|
+
*/
|
|
2063
2392
|
static circle(feature, format = FeatureOutputFormat.GeoJson) {
|
|
2064
|
-
// const clone = feature.clone();
|
|
2065
|
-
// clone.setGeometry(fromCircle(feature.getGeometry()! as Circle));
|
|
2066
|
-
const tetemp = feature.getGeometryName();
|
|
2067
2393
|
const circle = feature.getGeometry();
|
|
2068
|
-
|
|
2069
|
-
const
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
...transform([ttt[0], ttt[1]], 'EPSG:4326', 'EPSG:3857'),
|
|
2073
|
-
...transform([ttt[2], ttt[3]], 'EPSG:4326', 'EPSG:3857'),
|
|
2394
|
+
const ext = feature.getGeometry().getExtent();
|
|
2395
|
+
const coords = [
|
|
2396
|
+
...transform([ext[0], ext[1]], 'EPSG:4326', 'EPSG:3857'),
|
|
2397
|
+
...transform([ext[2], ext[3]], 'EPSG:4326', 'EPSG:3857'),
|
|
2074
2398
|
];
|
|
2075
|
-
const radius = (
|
|
2076
|
-
const radius2 = new LineString([circle.getCenter(), eastPoint]).getLength();
|
|
2399
|
+
const radius = (coords[2] - coords[0]) / 2;
|
|
2077
2400
|
const polygonGeom = new Polygon(StringifyFeatureHelper.drawCircle(circle.getCenter(), radius));
|
|
2078
|
-
// var edgeCoordinate = [circle.getCenter()[0] + radius, circle.getCenter()[1]];
|
|
2079
|
-
// var wgs84Sphere = new Sphere(6378137);
|
|
2080
2401
|
return StringifyFeatureHelper.polygon(new Feature(polygonGeom), format);
|
|
2081
|
-
// const rad = circle.getRadius();
|
|
2082
|
-
// const degrees = 180 / Math.PI; // radians to degrees
|
|
2083
|
-
// const radians = Math.PI / 180; // degrees to radians
|
|
2084
|
-
// const rlat = rad * degrees * 1000;
|
|
2085
|
-
// const rlng = rad * radians;
|
|
2086
|
-
// return StringifyFeatureHelper.polygon(new Feature<Geometry>(circular(circle.getCenter(),circle.getRadius() * METERS_PER_UNIT)), format);
|
|
2087
2402
|
}
|
|
2403
|
+
/**
|
|
2404
|
+
* Draw a circle based on a center point and radius.
|
|
2405
|
+
*
|
|
2406
|
+
* @param {number[]} point - The center point coordinates in EPSG:4326 format.
|
|
2407
|
+
* @param {number} radius - The radius of the circle in meters.
|
|
2408
|
+
* @return {Coordinate[][]} - The coordinates of the circle boundary in EPSG:4326 format.
|
|
2409
|
+
*/
|
|
2088
2410
|
static drawCircle(point, radius) {
|
|
2089
2411
|
const tetetemp = transform(point, 'EPSG:4326', 'EPSG:3857');
|
|
2090
2412
|
// const tetetemp = point;
|
|
@@ -2113,5 +2435,5 @@ class StringifyFeatureHelper {
|
|
|
2113
2435
|
* Generated bundle index. Do not edit.
|
|
2114
2436
|
*/
|
|
2115
2437
|
|
|
2116
|
-
export { AddControlCommand, CalculateAreaExecutor, CancelDrawingCommand, CancelFeatureModificationCommand, CloseTooltipCommand, ClusterLayerComponent, ClusterLayerSettings,
|
|
2438
|
+
export { AddControlCommand, CalculateAreaExecutor, CancelDrawingCommand, CancelFeatureModificationCommand, CloseTooltipCommand, ClusterLayerComponent, ClusterLayerSettings, DrawSelectionAreaCommand, DrawingType, FeatureLayerComponent, FeatureLayerSettings, FeatureOutputFormat, FitToPolygonsCommand, MapClickEvent, MapControl, MapControlZoomComponent, MapLyrs, MapLyrsLabel, MapModule, MapMoveEndEvent, MapPlateComponent, MapPostboyService, MapRenderedEvent, MapSettings, MarkerModel, MarkerStyleHelper, MarkersComponent, MessageRegistratorService, ModifyFeatureCommand, OsmTileLayerComponent, PolygonModel, PolygonStyleHelper, PolygonsComponent, RemoveControlCommand, SetMapCenterCommand, StartDrawingCommand, StringifyFeatureHelper, TextStyleHelper, TileLayerComponent, TileLayerSettings, TooltipComponent, TooltipSettings, ZoomControlSettings };
|
|
2117
2439
|
//# sourceMappingURL=maps-components-src-map.mjs.map
|