@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
|
var _a, _b;
|
|
171
162
|
this.info = info;
|
|
@@ -178,6 +169,16 @@ class PolygonModel {
|
|
|
178
169
|
get feature() {
|
|
179
170
|
return this._feature;
|
|
180
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
|
+
}
|
|
181
182
|
}
|
|
182
183
|
|
|
183
184
|
var DrawingType;
|
|
@@ -194,65 +195,9 @@ var FeatureOutputFormat;
|
|
|
194
195
|
FeatureOutputFormat[FeatureOutputFormat["WKT"] = 2] = "WKT";
|
|
195
196
|
})(FeatureOutputFormat || (FeatureOutputFormat = {}));
|
|
196
197
|
|
|
197
|
-
class Dictionary {
|
|
198
|
-
constructor() {
|
|
199
|
-
this.collection = {};
|
|
200
|
-
this._keys = new Set();
|
|
201
|
-
this.has = (key) => this._keys.has(key);
|
|
202
|
-
}
|
|
203
|
-
get keys() {
|
|
204
|
-
return Array.from(this._keys);
|
|
205
|
-
}
|
|
206
|
-
get size() {
|
|
207
|
-
return this._keys.size;
|
|
208
|
-
}
|
|
209
|
-
static clone(dic, action) {
|
|
210
|
-
return Dictionary.create(dic.collection, action);
|
|
211
|
-
}
|
|
212
|
-
static create(dic, action) {
|
|
213
|
-
let keyList = Object.keys(dic);
|
|
214
|
-
const result = new Dictionary();
|
|
215
|
-
for (let i = 0; i < keyList.length; i++) {
|
|
216
|
-
let key = keyList[i];
|
|
217
|
-
result._keys.add(key);
|
|
218
|
-
result.collection[key] = action ? action(dic[key], key) : dic[key];
|
|
219
|
-
}
|
|
220
|
-
return result;
|
|
221
|
-
}
|
|
222
|
-
find(predicate) {
|
|
223
|
-
let result = null;
|
|
224
|
-
this.forEach((e) => {
|
|
225
|
-
if (result === null && predicate(e))
|
|
226
|
-
result = e;
|
|
227
|
-
});
|
|
228
|
-
return result;
|
|
229
|
-
}
|
|
230
|
-
take(key) {
|
|
231
|
-
return this._keys.has(key) ? this.collection[key] : null;
|
|
232
|
-
}
|
|
233
|
-
put(key, value) {
|
|
234
|
-
if (value == null)
|
|
235
|
-
return;
|
|
236
|
-
this.collection[key] = value;
|
|
237
|
-
this._keys.add(key);
|
|
238
|
-
}
|
|
239
|
-
rmv(key) {
|
|
240
|
-
if (!this._keys.has(key))
|
|
241
|
-
return;
|
|
242
|
-
delete this.collection[key];
|
|
243
|
-
this._keys.delete(key);
|
|
244
|
-
}
|
|
245
|
-
forEach(callback) {
|
|
246
|
-
let keys = Object.keys(this.collection);
|
|
247
|
-
for (let i = 0; i < keys.length; i++) {
|
|
248
|
-
callback(this.collection[keys[i]], i);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
198
|
/**
|
|
254
199
|
*
|
|
255
|
-
* 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.
|
|
256
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:
|
|
257
202
|
* var myControl = new Control({element: myElement}); and then adding this to the map.
|
|
258
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.
|
|
@@ -419,6 +364,18 @@ class CalculateAreaExecutor extends PostboyExecutor {
|
|
|
419
364
|
}
|
|
420
365
|
CalculateAreaExecutor.ID = '172ecf46-86b5-4f46-a5f1-96ba2cbb1694';
|
|
421
366
|
|
|
367
|
+
class FitToPolygonsCommand extends PostboyGenericMessage {
|
|
368
|
+
constructor(features, zoomAfter = 0) {
|
|
369
|
+
super();
|
|
370
|
+
this.features = features;
|
|
371
|
+
this.zoomAfter = zoomAfter;
|
|
372
|
+
}
|
|
373
|
+
get id() {
|
|
374
|
+
return FitToPolygonsCommand.ID;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
FitToPolygonsCommand.ID = 'a9e42b23-ffaf-4c46-8370-e0432cd14d60';
|
|
378
|
+
|
|
422
379
|
class AddLayerCommand extends PostboyGenericMessage {
|
|
423
380
|
constructor(layer) {
|
|
424
381
|
super();
|
|
@@ -535,6 +492,11 @@ class FeatureService {
|
|
|
535
492
|
static filterFeaturesInArea(query) {
|
|
536
493
|
return query.features.filter((f) => FeatureService.booleanIntersects(query.area, f.getGeometry()));
|
|
537
494
|
}
|
|
495
|
+
static calculateArea(g) {
|
|
496
|
+
if (!g)
|
|
497
|
+
return 0;
|
|
498
|
+
return Sphere.getArea(g, { projection: 'EPSG:4326' });
|
|
499
|
+
}
|
|
538
500
|
static booleanIntersects(g1, g2) {
|
|
539
501
|
if (g2.getType() === 'Point')
|
|
540
502
|
return g1.intersectsCoordinate(g2.getCoordinates());
|
|
@@ -544,11 +506,6 @@ class FeatureService {
|
|
|
544
506
|
return g1.intersectsCoordinate(g2.getInteriorPoint().getCoordinates());
|
|
545
507
|
return false;
|
|
546
508
|
}
|
|
547
|
-
static calculateArea(g) {
|
|
548
|
-
if (!g)
|
|
549
|
-
return 0;
|
|
550
|
-
return Sphere.getArea(g, { projection: 'EPSG:4326' });
|
|
551
|
-
}
|
|
552
509
|
}
|
|
553
510
|
|
|
554
511
|
class GetFeaturesInAreaQuery extends PostboyCallbackMessage {
|
|
@@ -757,15 +714,28 @@ class MapFeatureService {
|
|
|
757
714
|
up() {
|
|
758
715
|
this.observeMapRender();
|
|
759
716
|
this.observeFitToFeatures();
|
|
717
|
+
this.observeFitToPolygons();
|
|
760
718
|
}
|
|
761
719
|
observeMapRender() {
|
|
762
720
|
this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
|
|
763
721
|
this.map = m.map;
|
|
722
|
+
if (this.fitPolygonsWaiting)
|
|
723
|
+
this.postboy.fire(this.fitPolygonsWaiting);
|
|
764
724
|
});
|
|
765
725
|
}
|
|
766
726
|
observeFitToFeatures() {
|
|
767
|
-
this.postboy.subscribe(FitToFeaturesCommand.ID).subscribe((
|
|
768
|
-
this.fitToGeometries(
|
|
727
|
+
this.postboy.subscribe(FitToFeaturesCommand.ID).subscribe((cmd) => {
|
|
728
|
+
this.fitToGeometries(cmd.features.map((f) => f.getGeometry()), cmd.zoomAfter);
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
observeFitToPolygons() {
|
|
732
|
+
this.postboy.subscribe(FitToPolygonsCommand.ID).subscribe((cmd) => {
|
|
733
|
+
if (!this.map) {
|
|
734
|
+
this.fitPolygonsWaiting = cmd;
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
737
|
+
this.fitPolygonsWaiting = undefined;
|
|
738
|
+
this.fitToGeometries(cmd.features.map((f) => f.feature.getGeometry()), cmd.zoomAfter);
|
|
769
739
|
});
|
|
770
740
|
}
|
|
771
741
|
fitToGeometries(geometries, zoomAfter) {
|
|
@@ -790,15 +760,6 @@ class MapClickService {
|
|
|
790
760
|
up() {
|
|
791
761
|
this.observeMapRender();
|
|
792
762
|
}
|
|
793
|
-
observeMapRender() {
|
|
794
|
-
this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
|
|
795
|
-
var _a;
|
|
796
|
-
this.map = m.map;
|
|
797
|
-
(_a = this.map) === null || _a === void 0 ? void 0 : _a.on('singleclick', (e) => {
|
|
798
|
-
this.postboy.fire(this.onClick(e));
|
|
799
|
-
});
|
|
800
|
-
});
|
|
801
|
-
}
|
|
802
763
|
onClick(ev) {
|
|
803
764
|
var _a;
|
|
804
765
|
const model = new MapClickEvent(ev.coordinate, {}, {});
|
|
@@ -817,6 +778,15 @@ class MapClickService {
|
|
|
817
778
|
});
|
|
818
779
|
return model;
|
|
819
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
|
+
}
|
|
820
790
|
getFeatureCollectionWithInner(features) {
|
|
821
791
|
const result = [];
|
|
822
792
|
features === null || features === void 0 ? void 0 : features.forEach((f) => {
|
|
@@ -1056,6 +1026,7 @@ class MessageRegistratorService extends PostboyAbstractRegistrator {
|
|
|
1056
1026
|
this.registerSubject(MapClickEvent.ID);
|
|
1057
1027
|
this.registerSubject(CloseTooltipCommand.ID);
|
|
1058
1028
|
this.registerSubject(FitToFeaturesCommand.ID);
|
|
1029
|
+
this.registerSubject(FitToPolygonsCommand.ID);
|
|
1059
1030
|
this.registerSubject(MapMoveEndEvent.ID);
|
|
1060
1031
|
this.registerSubject(CancelDrawingCommand.ID);
|
|
1061
1032
|
this.registerSubject(StartDrawingCommand.ID);
|
|
@@ -1080,14 +1051,53 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1080
1051
|
type: Injectable
|
|
1081
1052
|
}], ctorParameters: function () { return [{ type: MapPostboyService }, { type: MapManagementService }, { type: MapStateService }, { type: MapFeatureService }, { type: MapClickService }, { type: DrawingService }, { type: FeatureModificationService }, { type: ControlsService }]; } });
|
|
1082
1053
|
|
|
1054
|
+
/**
|
|
1055
|
+
* Class representing settings for a tile layer.
|
|
1056
|
+
*/
|
|
1083
1057
|
class TileLayerSettings {
|
|
1084
1058
|
constructor() {
|
|
1059
|
+
/**
|
|
1060
|
+
* The maximum zoom level for a map view.
|
|
1061
|
+
*
|
|
1062
|
+
* @type {number}
|
|
1063
|
+
* @default 19
|
|
1064
|
+
*/
|
|
1085
1065
|
this.maxZoom = 19;
|
|
1066
|
+
/**
|
|
1067
|
+
* The minimum zoom level allowed.
|
|
1068
|
+
*
|
|
1069
|
+
* @type {number}
|
|
1070
|
+
*/
|
|
1086
1071
|
this.minZoom = 0;
|
|
1072
|
+
/**
|
|
1073
|
+
* The opacity of an element.
|
|
1074
|
+
*
|
|
1075
|
+
* @type {number}
|
|
1076
|
+
* @default 0.6
|
|
1077
|
+
*/
|
|
1087
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
|
+
*/
|
|
1088
1086
|
this.url = '';
|
|
1087
|
+
/**
|
|
1088
|
+
* The projection of the coordinate system.
|
|
1089
|
+
*
|
|
1090
|
+
* @type {string}
|
|
1091
|
+
* @default 'EPSG:3857'
|
|
1092
|
+
*/
|
|
1089
1093
|
this.projection = 'EPSG:3857';
|
|
1090
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
|
+
*/
|
|
1091
1101
|
static copy(model) {
|
|
1092
1102
|
const result = new TileLayerSettings();
|
|
1093
1103
|
result.maxZoom = model.maxZoom;
|
|
@@ -1097,21 +1107,57 @@ class TileLayerSettings {
|
|
|
1097
1107
|
result.url = model.url;
|
|
1098
1108
|
return result;
|
|
1099
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
|
+
*/
|
|
1100
1116
|
setUrl(url) {
|
|
1101
1117
|
return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { url }));
|
|
1102
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
|
+
*/
|
|
1103
1125
|
setMaxZoom(maxZoom) {
|
|
1104
1126
|
return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { maxZoom }));
|
|
1105
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
|
+
*/
|
|
1106
1134
|
setMinZoom(minZoom) {
|
|
1107
1135
|
return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { minZoom }));
|
|
1108
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
|
+
*/
|
|
1109
1143
|
setOpacity(opacity) {
|
|
1110
1144
|
return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { opacity }));
|
|
1111
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
|
+
*/
|
|
1112
1152
|
setProjection(projection) {
|
|
1113
1153
|
return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { projection }));
|
|
1114
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
|
+
*/
|
|
1115
1161
|
isSame(model) {
|
|
1116
1162
|
if (this.maxZoom !== model.maxZoom)
|
|
1117
1163
|
return false;
|
|
@@ -1180,18 +1226,18 @@ class TileLayerComponent extends DestructibleComponent {
|
|
|
1180
1226
|
this._settings = new TileLayerSettings();
|
|
1181
1227
|
this.onDestroy = () => this.removeLayer();
|
|
1182
1228
|
}
|
|
1183
|
-
ngOnInit() {
|
|
1184
|
-
this.postboy
|
|
1185
|
-
.subscribe(MapRenderedEvent.ID)
|
|
1186
|
-
.pipe(filter((m) => !!m), first())
|
|
1187
|
-
.subscribe((m) => this.initLayer());
|
|
1188
|
-
}
|
|
1189
1229
|
set settings(value) {
|
|
1190
1230
|
if (!value || this._settings.isSame(value))
|
|
1191
1231
|
return;
|
|
1192
1232
|
this._settings = value;
|
|
1193
1233
|
this.initLayer();
|
|
1194
1234
|
}
|
|
1235
|
+
ngOnInit() {
|
|
1236
|
+
this.postboy
|
|
1237
|
+
.subscribe(MapRenderedEvent.ID)
|
|
1238
|
+
.pipe(filter((m) => !!m), first())
|
|
1239
|
+
.subscribe((m) => this.initLayer());
|
|
1240
|
+
}
|
|
1195
1241
|
initLayer() {
|
|
1196
1242
|
this.removeLayer();
|
|
1197
1243
|
this.layer = this.factory.build(this._settings);
|
|
@@ -1276,17 +1322,24 @@ class FeatureLayerSettings {
|
|
|
1276
1322
|
*/
|
|
1277
1323
|
this.zIndex = 1;
|
|
1278
1324
|
/**
|
|
1279
|
-
|
|
1325
|
+
The maximum view zoom level (inclusive) at which this layer will be visible.
|
|
1326
|
+
|
|
1327
|
+
@type {number}
|
|
1328
|
+
@default 19
|
|
1280
1329
|
*/
|
|
1281
1330
|
this.maxZoom = 19;
|
|
1282
1331
|
/**
|
|
1283
|
-
|
|
1332
|
+
The minimum view zoom level (exclusive) at which this layer will be visible.
|
|
1333
|
+
|
|
1334
|
+
@type {number}
|
|
1284
1335
|
*/
|
|
1285
1336
|
this.minZoom = 0;
|
|
1286
1337
|
}
|
|
1287
1338
|
/**
|
|
1288
|
-
*
|
|
1289
|
-
*
|
|
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
|
|
1290
1343
|
*/
|
|
1291
1344
|
static copy(model) {
|
|
1292
1345
|
const result = new FeatureLayerSettings();
|
|
@@ -1298,43 +1351,56 @@ class FeatureLayerSettings {
|
|
|
1298
1351
|
return result;
|
|
1299
1352
|
}
|
|
1300
1353
|
/**
|
|
1301
|
-
|
|
1302
|
-
*
|
|
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.
|
|
1303
1358
|
*/
|
|
1304
1359
|
setZIndex(zIndex) {
|
|
1305
1360
|
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { zIndex }));
|
|
1306
1361
|
}
|
|
1307
1362
|
/**
|
|
1308
|
-
*
|
|
1309
|
-
*
|
|
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.
|
|
1310
1368
|
*/
|
|
1311
1369
|
setName(name) {
|
|
1312
1370
|
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { name }));
|
|
1313
1371
|
}
|
|
1314
1372
|
/**
|
|
1315
|
-
*
|
|
1316
|
-
*
|
|
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.
|
|
1317
1377
|
*/
|
|
1318
1378
|
setMaxZoom(maxZoom) {
|
|
1319
1379
|
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { maxZoom }));
|
|
1320
1380
|
}
|
|
1321
1381
|
/**
|
|
1322
|
-
*
|
|
1323
|
-
*
|
|
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.
|
|
1324
1386
|
*/
|
|
1325
1387
|
setMinZoom(minZoom) {
|
|
1326
1388
|
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { minZoom }));
|
|
1327
1389
|
}
|
|
1328
1390
|
/**
|
|
1329
|
-
*
|
|
1330
|
-
*
|
|
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.
|
|
1331
1395
|
*/
|
|
1332
1396
|
setStyle(style) {
|
|
1333
1397
|
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { style }));
|
|
1334
1398
|
}
|
|
1335
1399
|
/**
|
|
1336
|
-
* Checks if the
|
|
1337
|
-
*
|
|
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.
|
|
1338
1404
|
*/
|
|
1339
1405
|
isSame(model) {
|
|
1340
1406
|
if (this.maxZoom !== model.maxZoom)
|
|
@@ -1384,18 +1450,18 @@ class FeatureLayerComponent extends DestructibleComponent {
|
|
|
1384
1450
|
this._settings = new FeatureLayerSettings();
|
|
1385
1451
|
this.onDestroy = () => this.removeLayer();
|
|
1386
1452
|
}
|
|
1387
|
-
ngOnInit() {
|
|
1388
|
-
this.postboy
|
|
1389
|
-
.subscribe(MapRenderedEvent.ID)
|
|
1390
|
-
.pipe(filter((m) => !!m), first())
|
|
1391
|
-
.subscribe((m) => this.initLayer());
|
|
1392
|
-
}
|
|
1393
1453
|
set settings(value) {
|
|
1394
1454
|
if (!value || this._settings.isSame(value))
|
|
1395
1455
|
return;
|
|
1396
1456
|
this._settings = value;
|
|
1397
1457
|
this.initLayer();
|
|
1398
1458
|
}
|
|
1459
|
+
ngOnInit() {
|
|
1460
|
+
this.postboy
|
|
1461
|
+
.subscribe(MapRenderedEvent.ID)
|
|
1462
|
+
.pipe(filter((m) => !!m), first())
|
|
1463
|
+
.subscribe((m) => this.initLayer());
|
|
1464
|
+
}
|
|
1399
1465
|
initLayer() {
|
|
1400
1466
|
this.removeLayer();
|
|
1401
1467
|
this.layer = this.factory.build(this._settings);
|
|
@@ -1419,12 +1485,34 @@ class ClusterLayerSettings {
|
|
|
1419
1485
|
constructor() {
|
|
1420
1486
|
this.name = IdGenerator.get();
|
|
1421
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
|
+
*/
|
|
1422
1494
|
this.maxZoom = 19;
|
|
1495
|
+
/**
|
|
1496
|
+
* The minimum view zoom level (exclusive) at which this layer will be visible.
|
|
1497
|
+
*
|
|
1498
|
+
* @type {number}
|
|
1499
|
+
*/
|
|
1423
1500
|
this.minZoom = 0;
|
|
1501
|
+
/**
|
|
1502
|
+
* Distance in pixels within which features will be clustered together.
|
|
1503
|
+
*
|
|
1504
|
+
* @type {number}
|
|
1505
|
+
*/
|
|
1424
1506
|
this.distance = 20;
|
|
1425
1507
|
this.bbox = false;
|
|
1426
1508
|
this.clusterCancel = 14;
|
|
1427
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
|
+
*/
|
|
1428
1516
|
static copy(model) {
|
|
1429
1517
|
const result = new ClusterLayerSettings();
|
|
1430
1518
|
result.name = model.name;
|
|
@@ -1437,30 +1525,86 @@ class ClusterLayerSettings {
|
|
|
1437
1525
|
result.style = model.style;
|
|
1438
1526
|
return result;
|
|
1439
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
|
+
*/
|
|
1440
1534
|
setZIndex(zIndex) {
|
|
1441
1535
|
return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { zIndex }));
|
|
1442
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
|
+
*/
|
|
1443
1543
|
setDistance(distance) {
|
|
1444
1544
|
return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { distance }));
|
|
1445
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
|
+
*/
|
|
1446
1552
|
setName(name) {
|
|
1447
1553
|
return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { name }));
|
|
1448
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
|
+
*/
|
|
1449
1561
|
setMaxZoom(maxZoom) {
|
|
1450
1562
|
return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { maxZoom }));
|
|
1451
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
|
+
*/
|
|
1452
1570
|
setMinZoom(minZoom) {
|
|
1453
1571
|
return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { minZoom }));
|
|
1454
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
|
+
*/
|
|
1455
1579
|
setClusterCancel(clusterCancel) {
|
|
1456
1580
|
return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { clusterCancel }));
|
|
1457
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
|
+
*/
|
|
1458
1588
|
setBbox(bbox) {
|
|
1459
1589
|
return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { bbox }));
|
|
1460
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
|
+
*/
|
|
1461
1598
|
setStyle(style) {
|
|
1462
1599
|
return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { style }));
|
|
1463
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
|
+
*/
|
|
1464
1608
|
isSame(model) {
|
|
1465
1609
|
if (this.maxZoom !== model.maxZoom)
|
|
1466
1610
|
return false;
|
|
@@ -1565,6 +1709,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1565
1709
|
}]
|
|
1566
1710
|
}] });
|
|
1567
1711
|
|
|
1712
|
+
/**
|
|
1713
|
+
* Represents a cluster layer component.
|
|
1714
|
+
*/
|
|
1568
1715
|
class ClusterLayerComponent extends DestructibleComponent {
|
|
1569
1716
|
constructor(postboy, factory) {
|
|
1570
1717
|
super();
|
|
@@ -1574,18 +1721,23 @@ class ClusterLayerComponent extends DestructibleComponent {
|
|
|
1574
1721
|
this._settings = new ClusterLayerSettings();
|
|
1575
1722
|
this.onDestroy = () => this.removeLayer();
|
|
1576
1723
|
}
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
}
|
|
1724
|
+
/**
|
|
1725
|
+
* Sets the settings for the cluster layer.
|
|
1726
|
+
*
|
|
1727
|
+
* @param {ClusterLayerSettings | undefined} value - The settings for the cluster layer.
|
|
1728
|
+
*/
|
|
1583
1729
|
set settings(value) {
|
|
1584
1730
|
if (!value || this._settings.isSame(value))
|
|
1585
1731
|
return;
|
|
1586
1732
|
this._settings = value;
|
|
1587
1733
|
this.initLayer();
|
|
1588
1734
|
}
|
|
1735
|
+
ngOnInit() {
|
|
1736
|
+
this.postboy
|
|
1737
|
+
.subscribe(MapRenderedEvent.ID)
|
|
1738
|
+
.pipe(filter((m) => !!m), first())
|
|
1739
|
+
.subscribe((m) => this.initLayer());
|
|
1740
|
+
}
|
|
1589
1741
|
initLayer() {
|
|
1590
1742
|
this.removeLayer();
|
|
1591
1743
|
this.manager = this.factory.build(this._settings, this.postboy);
|
|
@@ -1638,8 +1790,8 @@ class MapPlateComponent extends DestructibleComponent {
|
|
|
1638
1790
|
this.registrator = registrator;
|
|
1639
1791
|
this.detector = detector;
|
|
1640
1792
|
this.osmUrl = '';
|
|
1641
|
-
this._settings = new MapSettings();
|
|
1642
1793
|
this.drawingLayerSettings = new FeatureLayerSettings().setName(MapConstants.DrawingLayerId);
|
|
1794
|
+
this._settings = new MapSettings();
|
|
1643
1795
|
this.onDestroy = () => {
|
|
1644
1796
|
this.registrator.down();
|
|
1645
1797
|
};
|
|
@@ -1701,6 +1853,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1701
1853
|
type: Input
|
|
1702
1854
|
}] } });
|
|
1703
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
|
+
*/
|
|
1704
1861
|
class MarkersComponent extends DestructibleComponent {
|
|
1705
1862
|
constructor(postboy) {
|
|
1706
1863
|
super();
|
|
@@ -1708,6 +1865,11 @@ class MarkersComponent extends DestructibleComponent {
|
|
|
1708
1865
|
this.layerName = '';
|
|
1709
1866
|
this._markers = [];
|
|
1710
1867
|
}
|
|
1868
|
+
/**
|
|
1869
|
+
* Sets the markers property.
|
|
1870
|
+
*
|
|
1871
|
+
* @param {MarkerModel[]} value - The array of MarkerModel objects to set as markers.
|
|
1872
|
+
*/
|
|
1711
1873
|
set markers(value) {
|
|
1712
1874
|
this._markers = value !== null && value !== void 0 ? value : [];
|
|
1713
1875
|
this.putMarkers();
|
|
@@ -1765,23 +1927,12 @@ class TooltipSettings {
|
|
|
1765
1927
|
}
|
|
1766
1928
|
|
|
1767
1929
|
class TooltipComponent extends DestructibleComponent {
|
|
1768
|
-
set settings(value) {
|
|
1769
|
-
if (!value || this._settings.isSame(value))
|
|
1770
|
-
return;
|
|
1771
|
-
this._settings = value;
|
|
1772
|
-
this.detector.detectChanges();
|
|
1773
|
-
}
|
|
1774
1930
|
constructor(postboy, detector) {
|
|
1775
1931
|
super();
|
|
1776
1932
|
this.postboy = postboy;
|
|
1777
1933
|
this.detector = detector;
|
|
1778
|
-
this._settings = new TooltipSettings();
|
|
1779
1934
|
this.show = false;
|
|
1780
|
-
this.
|
|
1781
|
-
var _a;
|
|
1782
|
-
!!this.overlay && ((_a = this.map) === null || _a === void 0 ? void 0 : _a.removeOverlay(this.overlay));
|
|
1783
|
-
this.show = false;
|
|
1784
|
-
};
|
|
1935
|
+
this._settings = new TooltipSettings();
|
|
1785
1936
|
this.options = (coordinates) => {
|
|
1786
1937
|
var _a;
|
|
1787
1938
|
return {
|
|
@@ -1791,12 +1942,31 @@ class TooltipComponent extends DestructibleComponent {
|
|
|
1791
1942
|
position: coordinates,
|
|
1792
1943
|
};
|
|
1793
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();
|
|
1794
1956
|
}
|
|
1795
1957
|
ngOnInit() {
|
|
1796
1958
|
this.subs.push(this.observeMapRender());
|
|
1797
1959
|
this.subs.push(this.observeMapClick());
|
|
1798
1960
|
this.subs.push(this.observeClose());
|
|
1799
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
|
+
}
|
|
1800
1970
|
observeMapClick() {
|
|
1801
1971
|
return this.postboy.subscribe(MapClickEvent.ID).subscribe((ev) => {
|
|
1802
1972
|
this._settings.show(ev) ? this.addOverlay(ev.coordinates) : this.removeOverlay();
|
|
@@ -1813,14 +1983,6 @@ class TooltipComponent extends DestructibleComponent {
|
|
|
1813
1983
|
this.map = m.map;
|
|
1814
1984
|
});
|
|
1815
1985
|
}
|
|
1816
|
-
addOverlay(coordinates) {
|
|
1817
|
-
var _a;
|
|
1818
|
-
this.removeOverlay();
|
|
1819
|
-
this.overlay = new Overlay(this.options(coordinates));
|
|
1820
|
-
(_a = this.map) === null || _a === void 0 ? void 0 : _a.addOverlay(this.overlay);
|
|
1821
|
-
this.show = true;
|
|
1822
|
-
this.detector.detectChanges();
|
|
1823
|
-
}
|
|
1824
1986
|
}
|
|
1825
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 });
|
|
1826
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 });
|
|
@@ -1834,6 +1996,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1834
1996
|
type: Input
|
|
1835
1997
|
}] } });
|
|
1836
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
|
+
*/
|
|
1837
2004
|
class PolygonsComponent extends DestructibleComponent {
|
|
1838
2005
|
constructor(postboy) {
|
|
1839
2006
|
super();
|
|
@@ -1841,6 +2008,11 @@ class PolygonsComponent extends DestructibleComponent {
|
|
|
1841
2008
|
this.layerName = '';
|
|
1842
2009
|
this._polygons = [];
|
|
1843
2010
|
}
|
|
2011
|
+
/**
|
|
2012
|
+
* Sets the value of polygons.
|
|
2013
|
+
*
|
|
2014
|
+
* @param {PolygonModel[]} value - The new value for polygons.
|
|
2015
|
+
*/
|
|
1844
2016
|
set polygons(value) {
|
|
1845
2017
|
this._polygons = value !== null && value !== void 0 ? value : [];
|
|
1846
2018
|
this.putPolygons();
|
|
@@ -1868,14 +2040,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1868
2040
|
type: Input
|
|
1869
2041
|
}] } });
|
|
1870
2042
|
|
|
2043
|
+
/**
|
|
2044
|
+
* Represents the settings for a zoom control.
|
|
2045
|
+
*/
|
|
1871
2046
|
class ZoomControlSettings {
|
|
1872
2047
|
constructor() {
|
|
2048
|
+
/**
|
|
2049
|
+
* The CSS class name of the control element.
|
|
2050
|
+
*
|
|
2051
|
+
* @type {string}
|
|
2052
|
+
*/
|
|
1873
2053
|
this.controlClass = 'ol-zoom';
|
|
2054
|
+
/**
|
|
2055
|
+
* The CSS class name for zoom in button.
|
|
2056
|
+
* @type {string}
|
|
2057
|
+
*/
|
|
1874
2058
|
this.zoomInClass = 'ol-zoom-in';
|
|
2059
|
+
/**
|
|
2060
|
+
* The CSS class name for the zoom out button element.
|
|
2061
|
+
*
|
|
2062
|
+
* @type {string}
|
|
2063
|
+
*/
|
|
1875
2064
|
this.zoomOutClass = 'ol-zoom-out';
|
|
2065
|
+
/**
|
|
2066
|
+
* The label for the zoom in action.
|
|
2067
|
+
*
|
|
2068
|
+
* @type {string}
|
|
2069
|
+
*/
|
|
1876
2070
|
this.zoomInLabel = 'Zoom In';
|
|
2071
|
+
/**
|
|
2072
|
+
* The label for the zoom out control.
|
|
2073
|
+
*
|
|
2074
|
+
* @type {string}
|
|
2075
|
+
*/
|
|
1877
2076
|
this.zoomOutLabel = 'Zoom Out';
|
|
1878
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
|
+
*/
|
|
1879
2084
|
static copy(model) {
|
|
1880
2085
|
const result = new ZoomControlSettings();
|
|
1881
2086
|
result.controlClass = model.controlClass;
|
|
@@ -1885,6 +2090,13 @@ class ZoomControlSettings {
|
|
|
1885
2090
|
result.zoomOutLabel = model.zoomOutLabel;
|
|
1886
2091
|
return result;
|
|
1887
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
|
+
*/
|
|
1888
2100
|
isSame(model) {
|
|
1889
2101
|
if (this.zoomInClass !== model.zoomInClass)
|
|
1890
2102
|
return false;
|
|
@@ -1898,30 +2110,61 @@ class ZoomControlSettings {
|
|
|
1898
2110
|
return false;
|
|
1899
2111
|
return true;
|
|
1900
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
|
+
*/
|
|
1901
2119
|
setZoomInLabel(zoomInLabel) {
|
|
1902
2120
|
return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomInLabel }));
|
|
1903
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
|
+
*/
|
|
1904
2128
|
setZoomOutClass(zoomOutClass) {
|
|
1905
2129
|
return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomOutClass }));
|
|
1906
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
|
+
*/
|
|
1907
2137
|
setZoomInClass(zoomInClass) {
|
|
1908
2138
|
return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomInClass }));
|
|
1909
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
|
+
*/
|
|
1910
2146
|
setZoomOutLabel(zoomOutLabel) {
|
|
1911
2147
|
return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomOutLabel }));
|
|
1912
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
|
+
*/
|
|
1913
2156
|
setControlClass(controlClass) {
|
|
1914
2157
|
return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { controlClass }));
|
|
1915
2158
|
}
|
|
1916
2159
|
}
|
|
1917
2160
|
|
|
2161
|
+
/**
|
|
2162
|
+
* @class
|
|
2163
|
+
* @classdesc Represents a component for the Zoom control on a map.
|
|
2164
|
+
* @extends DestructibleComponent
|
|
2165
|
+
* @implements OnInit
|
|
2166
|
+
*/
|
|
1918
2167
|
class MapControlZoomComponent extends DestructibleComponent {
|
|
1919
|
-
set settings(value) {
|
|
1920
|
-
if (!value || this._settings.isSame(value))
|
|
1921
|
-
return;
|
|
1922
|
-
this._settings = value;
|
|
1923
|
-
this.setControl();
|
|
1924
|
-
}
|
|
1925
2168
|
constructor(postboy) {
|
|
1926
2169
|
super();
|
|
1927
2170
|
this.postboy = postboy;
|
|
@@ -1931,6 +2174,23 @@ class MapControlZoomComponent extends DestructibleComponent {
|
|
|
1931
2174
|
};
|
|
1932
2175
|
this.eliminate = () => !!this.map && !!this.control && this.map.removeControl(this.control);
|
|
1933
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
|
+
}
|
|
1934
2194
|
ngOnInit() {
|
|
1935
2195
|
this.postboy
|
|
1936
2196
|
.subscribe(MapRenderedEvent.ID)
|
|
@@ -2006,7 +2266,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2006
2266
|
}]
|
|
2007
2267
|
}] });
|
|
2008
2268
|
|
|
2269
|
+
/**
|
|
2270
|
+
* Helper class to create and modify marker styles.
|
|
2271
|
+
*/
|
|
2009
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
|
+
*/
|
|
2010
2280
|
static fromSvg(svg, size = [30, 30], zIndex = 400) {
|
|
2011
2281
|
let image = new Image();
|
|
2012
2282
|
image.src = 'data:image/svg+xml,' + escape(svg);
|
|
@@ -2018,6 +2288,15 @@ class MarkerStyleHelper {
|
|
|
2018
2288
|
zIndex,
|
|
2019
2289
|
});
|
|
2020
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
|
+
*/
|
|
2021
2300
|
static circle(radius, fill, strokeColor, strokeWidth = 1) {
|
|
2022
2301
|
return new Style({
|
|
2023
2302
|
image: new Circle({
|
|
@@ -2027,13 +2306,32 @@ class MarkerStyleHelper {
|
|
|
2027
2306
|
}),
|
|
2028
2307
|
});
|
|
2029
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
|
+
*/
|
|
2030
2316
|
static withText(style, text) {
|
|
2031
2317
|
style.setText(text);
|
|
2032
2318
|
return style;
|
|
2033
2319
|
}
|
|
2034
2320
|
}
|
|
2035
2321
|
|
|
2322
|
+
/**
|
|
2323
|
+
* A helper class for creating polygon styles.
|
|
2324
|
+
* @class
|
|
2325
|
+
*/
|
|
2036
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
|
+
*/
|
|
2037
2335
|
static simple(fill, stroke, strokeWidth = 1) {
|
|
2038
2336
|
return new Style({
|
|
2039
2337
|
fill: new Fill({
|
|
@@ -2045,6 +2343,15 @@ class PolygonStyleHelper {
|
|
|
2045
2343
|
}),
|
|
2046
2344
|
});
|
|
2047
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
|
+
*/
|
|
2048
2355
|
static edit(fill, stroke, strokeWidth = 1, pinRadius = 5) {
|
|
2049
2356
|
return new Style({
|
|
2050
2357
|
image: new Circle({
|
|
@@ -2064,7 +2371,18 @@ class PolygonStyleHelper {
|
|
|
2064
2371
|
}
|
|
2065
2372
|
}
|
|
2066
2373
|
|
|
2374
|
+
/**
|
|
2375
|
+
* Helper class for creating text styles.
|
|
2376
|
+
*/
|
|
2067
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
|
+
*/
|
|
2068
2386
|
static get(text, font, color) {
|
|
2069
2387
|
return new Text({
|
|
2070
2388
|
text: text,
|
|
@@ -2077,37 +2395,41 @@ class TextStyleHelper {
|
|
|
2077
2395
|
}
|
|
2078
2396
|
}
|
|
2079
2397
|
|
|
2398
|
+
/**
|
|
2399
|
+
* A helper class for converting and stringify features.
|
|
2400
|
+
*/
|
|
2080
2401
|
class StringifyFeatureHelper {
|
|
2081
2402
|
static polygon(feature, format = FeatureOutputFormat.GeoJson) {
|
|
2082
2403
|
return format === FeatureOutputFormat.GeoJson
|
|
2083
2404
|
? new GeoJSON().writeFeature(feature)
|
|
2084
2405
|
: new WKT().writeFeature(feature);
|
|
2085
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
|
+
*/
|
|
2086
2415
|
static circle(feature, format = FeatureOutputFormat.GeoJson) {
|
|
2087
|
-
// const clone = feature.clone();
|
|
2088
|
-
// clone.setGeometry(fromCircle(feature.getGeometry()! as Circle));
|
|
2089
|
-
const tetemp = feature.getGeometryName();
|
|
2090
2416
|
const circle = feature.getGeometry();
|
|
2091
|
-
|
|
2092
|
-
const
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
...transform([ttt[0], ttt[1]], 'EPSG:4326', 'EPSG:3857'),
|
|
2096
|
-
...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'),
|
|
2097
2421
|
];
|
|
2098
|
-
const radius = (
|
|
2099
|
-
const radius2 = new LineString([circle.getCenter(), eastPoint]).getLength();
|
|
2422
|
+
const radius = (coords[2] - coords[0]) / 2;
|
|
2100
2423
|
const polygonGeom = new Polygon(StringifyFeatureHelper.drawCircle(circle.getCenter(), radius));
|
|
2101
|
-
// var edgeCoordinate = [circle.getCenter()[0] + radius, circle.getCenter()[1]];
|
|
2102
|
-
// var wgs84Sphere = new Sphere(6378137);
|
|
2103
2424
|
return StringifyFeatureHelper.polygon(new Feature(polygonGeom), format);
|
|
2104
|
-
// const rad = circle.getRadius();
|
|
2105
|
-
// const degrees = 180 / Math.PI; // radians to degrees
|
|
2106
|
-
// const radians = Math.PI / 180; // degrees to radians
|
|
2107
|
-
// const rlat = rad * degrees * 1000;
|
|
2108
|
-
// const rlng = rad * radians;
|
|
2109
|
-
// return StringifyFeatureHelper.polygon(new Feature<Geometry>(circular(circle.getCenter(),circle.getRadius() * METERS_PER_UNIT)), format);
|
|
2110
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
|
+
*/
|
|
2111
2433
|
static drawCircle(point, radius) {
|
|
2112
2434
|
const tetetemp = transform(point, 'EPSG:4326', 'EPSG:3857');
|
|
2113
2435
|
// const tetetemp = point;
|
|
@@ -2136,5 +2458,5 @@ class StringifyFeatureHelper {
|
|
|
2136
2458
|
* Generated bundle index. Do not edit.
|
|
2137
2459
|
*/
|
|
2138
2460
|
|
|
2139
|
-
export { AddControlCommand, CalculateAreaExecutor, CancelDrawingCommand, CancelFeatureModificationCommand, CloseTooltipCommand, ClusterLayerComponent, ClusterLayerSettings,
|
|
2461
|
+
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 };
|
|
2140
2462
|
//# sourceMappingURL=maps-components-src-map.mjs.map
|