@artstesh/maps 4.1.8 → 4.1.10
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/fit-to-polygons.command.mjs +1 -1
- package/dist/esm2020/map/messages/events/map-move-end.event.mjs +3 -4
- package/dist/esm2020/map/messages/executors/get-map-position.executor.mjs +16 -0
- package/dist/esm2020/map/messages/index.mjs +2 -1
- package/dist/esm2020/map/models/index.mjs +2 -1
- package/dist/esm2020/map/models/map-control.mjs +2 -2
- package/dist/esm2020/map/models/map-position.model.mjs +2 -0
- 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/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 +1 -1
- package/dist/esm2020/map/services/map-state.service.mjs +11 -6
- package/dist/esm2020/map/services/message-registrator.service.mjs +4 -1
- 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/fit-to-polygons.command.mjs +1 -1
- package/dist/esm2020/src/map/messages/events/map-move-end.event.mjs +3 -4
- package/dist/esm2020/src/map/messages/executors/get-map-position.executor.mjs +16 -0
- package/dist/esm2020/src/map/messages/index.mjs +2 -1
- package/dist/esm2020/src/map/models/index.mjs +2 -1
- package/dist/esm2020/src/map/models/map-control.mjs +2 -2
- package/dist/esm2020/src/map/models/map-position.model.mjs +2 -0
- 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/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 +1 -1
- package/dist/esm2020/src/map/services/map-state.service.mjs +11 -6
- package/dist/esm2020/src/map/services/message-registrator.service.mjs +4 -1
- package/dist/fesm2015/maps-components-src-map.mjs +486 -114
- package/dist/fesm2015/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2015/maps-components.mjs +486 -114
- package/dist/fesm2015/maps-components.mjs.map +1 -1
- package/dist/fesm2020/maps-components-src-map.mjs +483 -110
- package/dist/fesm2020/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2020/maps-components.mjs +483 -110
- 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/events/map-move-end.event.d.ts +3 -3
- package/dist/map/messages/executors/get-map-position.executor.d.ts +12 -0
- package/dist/map/messages/index.d.ts +1 -0
- package/dist/map/models/index.d.ts +1 -0
- package/dist/map/models/map-control.d.ts +1 -1
- package/dist/map/models/map-position.model.d.ts +6 -0
- 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-state.service.d.ts +2 -0
- package/dist/map/services/message-registrator.service.d.ts +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/events/map-move-end.event.d.ts +3 -3
- package/dist/src/map/messages/executors/get-map-position.executor.d.ts +12 -0
- package/dist/src/map/messages/index.d.ts +1 -0
- package/dist/src/map/models/index.d.ts +1 -0
- package/dist/src/map/models/map-control.d.ts +1 -1
- package/dist/src/map/models/map-position.model.d.ts +6 -0
- 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-state.service.d.ts +2 -0
- package/dist/src/map/services/message-registrator.service.d.ts +1 -0
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { Component, Injectable, ChangeDetectionStrategy, Input, ViewChild, NgMod
|
|
|
3
3
|
import * as i4 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import { Feature, Collection } from 'ol';
|
|
6
|
-
import { Point
|
|
6
|
+
import { Point } from 'ol/geom';
|
|
7
7
|
import { GeoJSON, WKT } from 'ol/format';
|
|
8
8
|
import { getCenter, createEmpty, extend } from 'ol/extent';
|
|
9
9
|
import { Control, Zoom } from 'ol/control';
|
|
@@ -157,16 +157,6 @@ class MarkerModel {
|
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
class PolygonModel {
|
|
160
|
-
static fromGeoJson(id, json, info) {
|
|
161
|
-
let feature = new GeoJSON().readFeature(json);
|
|
162
|
-
feature.setId(id);
|
|
163
|
-
return new PolygonModel(feature, id, info);
|
|
164
|
-
}
|
|
165
|
-
static fromWKT(id, wkt, info) {
|
|
166
|
-
let feature = new WKT().readFeature(wkt);
|
|
167
|
-
feature.setId(id);
|
|
168
|
-
return new PolygonModel(feature, id, info);
|
|
169
|
-
}
|
|
170
160
|
constructor(feature, id, info) {
|
|
171
161
|
var _a, _b;
|
|
172
162
|
this.info = info;
|
|
@@ -179,6 +169,16 @@ class PolygonModel {
|
|
|
179
169
|
get feature() {
|
|
180
170
|
return this._feature;
|
|
181
171
|
}
|
|
172
|
+
static fromGeoJson(id, json, info) {
|
|
173
|
+
let feature = new GeoJSON().readFeature(json);
|
|
174
|
+
feature.setId(id);
|
|
175
|
+
return new PolygonModel(feature, id, info);
|
|
176
|
+
}
|
|
177
|
+
static fromWKT(id, wkt, info) {
|
|
178
|
+
let feature = new WKT().readFeature(wkt);
|
|
179
|
+
feature.setId(id);
|
|
180
|
+
return new PolygonModel(feature, id, info);
|
|
181
|
+
}
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
var DrawingType;
|
|
@@ -197,7 +197,7 @@ var FeatureOutputFormat;
|
|
|
197
197
|
|
|
198
198
|
/**
|
|
199
199
|
*
|
|
200
|
-
* A control is a visible widget with a DOM element in a fixed position on the screen. They can involve user input (buttons), or be informational only; the position is determined using CSS. By default these are placed in the container with CSS class name ol-overlaycontainer-stopevent, but can use any outside DOM element.
|
|
200
|
+
* A control is a visible widget with a DOM element in a fixed position on the screen. They can involve user input (buttons), or be informational only; the position is determined using CSS. By default, these are placed in the container with CSS class name ol-overlaycontainer-stopevent, but can use any outside DOM element.
|
|
201
201
|
* This is the base class for controls. You can use it for simple custom controls by creating the element with listeners, creating an instance:
|
|
202
202
|
* var myControl = new Control({element: myElement}); and then adding this to the map.
|
|
203
203
|
* The main advantage of having this as a control rather than a simple separate DOM element is that preventing propagation is handled for you. Controls will also be objects in a module:ol/Collection~Collection, so you can use their methods.
|
|
@@ -234,10 +234,9 @@ class MapClickEvent extends PostboyGenericMessage {
|
|
|
234
234
|
MapClickEvent.ID = '323df526-8d9c-49c6-83e8-6e9a1e7762f7';
|
|
235
235
|
|
|
236
236
|
class MapMoveEndEvent extends PostboyGenericMessage {
|
|
237
|
-
constructor(
|
|
237
|
+
constructor(position) {
|
|
238
238
|
super();
|
|
239
|
-
this.
|
|
240
|
-
this.extent = extent;
|
|
239
|
+
this.position = position;
|
|
241
240
|
}
|
|
242
241
|
get id() {
|
|
243
242
|
return MapMoveEndEvent.ID;
|
|
@@ -376,6 +375,21 @@ class FitToPolygonsCommand extends PostboyGenericMessage {
|
|
|
376
375
|
}
|
|
377
376
|
FitToPolygonsCommand.ID = 'a9e42b23-ffaf-4c46-8370-e0432cd14d60';
|
|
378
377
|
|
|
378
|
+
/**
|
|
379
|
+
* A message that allows to get the current state of the map.
|
|
380
|
+
* If the map's state is not defined yet, the executor would return null
|
|
381
|
+
* @returns {MapPosition | null}
|
|
382
|
+
*/
|
|
383
|
+
class GetMapPositionExecutor extends PostboyExecutor {
|
|
384
|
+
get id() {
|
|
385
|
+
return GetMapPositionExecutor.ID;
|
|
386
|
+
}
|
|
387
|
+
constructor() {
|
|
388
|
+
super();
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
GetMapPositionExecutor.ID = '52c95689-d09b-4082-ba58-9183ea96a213';
|
|
392
|
+
|
|
379
393
|
class AddLayerCommand extends PostboyGenericMessage {
|
|
380
394
|
constructor(layer) {
|
|
381
395
|
super();
|
|
@@ -492,6 +506,11 @@ class FeatureService {
|
|
|
492
506
|
static filterFeaturesInArea(query) {
|
|
493
507
|
return query.features.filter((f) => FeatureService.booleanIntersects(query.area, f.getGeometry()));
|
|
494
508
|
}
|
|
509
|
+
static calculateArea(g) {
|
|
510
|
+
if (!g)
|
|
511
|
+
return 0;
|
|
512
|
+
return Sphere.getArea(g, { projection: 'EPSG:4326' });
|
|
513
|
+
}
|
|
495
514
|
static booleanIntersects(g1, g2) {
|
|
496
515
|
if (g2.getType() === 'Point')
|
|
497
516
|
return g1.intersectsCoordinate(g2.getCoordinates());
|
|
@@ -501,11 +520,6 @@ class FeatureService {
|
|
|
501
520
|
return g1.intersectsCoordinate(g2.getInteriorPoint().getCoordinates());
|
|
502
521
|
return false;
|
|
503
522
|
}
|
|
504
|
-
static calculateArea(g) {
|
|
505
|
-
if (!g)
|
|
506
|
-
return 0;
|
|
507
|
-
return Sphere.getArea(g, { projection: 'EPSG:4326' });
|
|
508
|
-
}
|
|
509
523
|
}
|
|
510
524
|
|
|
511
525
|
class GetFeaturesInAreaQuery extends PostboyCallbackMessage {
|
|
@@ -677,6 +691,14 @@ class MapStateService {
|
|
|
677
691
|
this.observeMapRendering();
|
|
678
692
|
this.observeCenter();
|
|
679
693
|
}
|
|
694
|
+
getMapPosition() {
|
|
695
|
+
if (!this.map)
|
|
696
|
+
return null;
|
|
697
|
+
let [longitude, latitude] = this.map.getView().getCenter();
|
|
698
|
+
const zoom = Math.floor(this.map.getView().getZoom());
|
|
699
|
+
const extent = this.map.getView().calculateExtent();
|
|
700
|
+
return { longitude, latitude, zoom, extent };
|
|
701
|
+
}
|
|
680
702
|
observeMapRendering() {
|
|
681
703
|
this.postboy
|
|
682
704
|
.subscribe(MapRenderedEvent.ID)
|
|
@@ -685,10 +707,7 @@ class MapStateService {
|
|
|
685
707
|
var _a;
|
|
686
708
|
this.map = ev.map;
|
|
687
709
|
(_a = this.map) === null || _a === void 0 ? void 0 : _a.on('moveend', () => {
|
|
688
|
-
|
|
689
|
-
const zoom = Math.floor(((_a = this.map) === null || _a === void 0 ? void 0 : _a.getView().getZoom()) || -1);
|
|
690
|
-
const extent = ((_b = this.map) === null || _b === void 0 ? void 0 : _b.getView().calculateExtent()) || [];
|
|
691
|
-
this.postboy.fire(new MapMoveEndEvent(zoom, extent));
|
|
710
|
+
this.postboy.fire(new MapMoveEndEvent(this.getMapPosition()));
|
|
692
711
|
});
|
|
693
712
|
});
|
|
694
713
|
}
|
|
@@ -760,15 +779,6 @@ class MapClickService {
|
|
|
760
779
|
up() {
|
|
761
780
|
this.observeMapRender();
|
|
762
781
|
}
|
|
763
|
-
observeMapRender() {
|
|
764
|
-
this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
|
|
765
|
-
var _a;
|
|
766
|
-
this.map = m.map;
|
|
767
|
-
(_a = this.map) === null || _a === void 0 ? void 0 : _a.on('singleclick', (e) => {
|
|
768
|
-
this.postboy.fire(this.onClick(e));
|
|
769
|
-
});
|
|
770
|
-
});
|
|
771
|
-
}
|
|
772
782
|
onClick(ev) {
|
|
773
783
|
var _a;
|
|
774
784
|
const model = new MapClickEvent(ev.coordinate, {}, {});
|
|
@@ -787,6 +797,15 @@ class MapClickService {
|
|
|
787
797
|
});
|
|
788
798
|
return model;
|
|
789
799
|
}
|
|
800
|
+
observeMapRender() {
|
|
801
|
+
this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
|
|
802
|
+
var _a;
|
|
803
|
+
this.map = m.map;
|
|
804
|
+
(_a = this.map) === null || _a === void 0 ? void 0 : _a.on('singleclick', (e) => {
|
|
805
|
+
this.postboy.fire(this.onClick(e));
|
|
806
|
+
});
|
|
807
|
+
});
|
|
808
|
+
}
|
|
790
809
|
getFeatureCollectionWithInner(features) {
|
|
791
810
|
const result = [];
|
|
792
811
|
features === null || features === void 0 ? void 0 : features.forEach((f) => {
|
|
@@ -1011,6 +1030,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1011
1030
|
class MessageRegistratorService extends PostboyAbstractRegistrator {
|
|
1012
1031
|
constructor(service, management, state, mapFeature, interaction, drawing, featureModification, controls) {
|
|
1013
1032
|
super(service);
|
|
1033
|
+
this.state = state;
|
|
1014
1034
|
this.registerServices([management, state, interaction, mapFeature, drawing, featureModification, controls]);
|
|
1015
1035
|
}
|
|
1016
1036
|
_up() {
|
|
@@ -1043,6 +1063,7 @@ class MessageRegistratorService extends PostboyAbstractRegistrator {
|
|
|
1043
1063
|
this.registerExecutor(CalculateAreaExecutor.ID, (e) => { var _a, _b; return FeatureService.calculateArea((_b = (_a = e.polygon) === null || _a === void 0 ? void 0 : _a.feature) === null || _b === void 0 ? void 0 : _b.getGeometry()); });
|
|
1044
1064
|
this.registerExecutor(GenerateDrawExecutor.ID, (e) => DrawingGenerationService.getDraw(e));
|
|
1045
1065
|
this.registerExecutor(GenerateZoomControlExecutor.ID, (e) => ZoomControlFactory.build(e.settings));
|
|
1066
|
+
this.registerExecutor(GetMapPositionExecutor.ID, () => this.state.getMapPosition());
|
|
1046
1067
|
}
|
|
1047
1068
|
}
|
|
1048
1069
|
MessageRegistratorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MessageRegistratorService, deps: [{ token: MapPostboyService }, { token: MapManagementService }, { token: MapStateService }, { token: MapFeatureService }, { token: MapClickService }, { token: DrawingService }, { token: FeatureModificationService }, { token: ControlsService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -1051,14 +1072,53 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1051
1072
|
type: Injectable
|
|
1052
1073
|
}], ctorParameters: function () { return [{ type: MapPostboyService }, { type: MapManagementService }, { type: MapStateService }, { type: MapFeatureService }, { type: MapClickService }, { type: DrawingService }, { type: FeatureModificationService }, { type: ControlsService }]; } });
|
|
1053
1074
|
|
|
1075
|
+
/**
|
|
1076
|
+
* Class representing settings for a tile layer.
|
|
1077
|
+
*/
|
|
1054
1078
|
class TileLayerSettings {
|
|
1055
1079
|
constructor() {
|
|
1080
|
+
/**
|
|
1081
|
+
* The maximum zoom level for a map view.
|
|
1082
|
+
*
|
|
1083
|
+
* @type {number}
|
|
1084
|
+
* @default 19
|
|
1085
|
+
*/
|
|
1056
1086
|
this.maxZoom = 19;
|
|
1087
|
+
/**
|
|
1088
|
+
* The minimum zoom level allowed.
|
|
1089
|
+
*
|
|
1090
|
+
* @type {number}
|
|
1091
|
+
*/
|
|
1057
1092
|
this.minZoom = 0;
|
|
1093
|
+
/**
|
|
1094
|
+
* The opacity of an element.
|
|
1095
|
+
*
|
|
1096
|
+
* @type {number}
|
|
1097
|
+
* @default 0.6
|
|
1098
|
+
*/
|
|
1058
1099
|
this.opacity = 0.6;
|
|
1100
|
+
/**
|
|
1101
|
+
* Represents the tiles URL.
|
|
1102
|
+
* @typedef {string} url
|
|
1103
|
+
*
|
|
1104
|
+
* @example
|
|
1105
|
+
* 'https://example.ex/{z}/{x}/{y}.png'
|
|
1106
|
+
*/
|
|
1059
1107
|
this.url = '';
|
|
1108
|
+
/**
|
|
1109
|
+
* The projection of the coordinate system.
|
|
1110
|
+
*
|
|
1111
|
+
* @type {string}
|
|
1112
|
+
* @default 'EPSG:3857'
|
|
1113
|
+
*/
|
|
1060
1114
|
this.projection = 'EPSG:3857';
|
|
1061
1115
|
}
|
|
1116
|
+
/**
|
|
1117
|
+
* Creates a copy of the given tile layer settings.
|
|
1118
|
+
*
|
|
1119
|
+
* @param {TileLayerSettings} model - The tile layer settings to be copied.
|
|
1120
|
+
* @return {TileLayerSettings} - A new instance of TileLayerSettings with the same properties as the model.
|
|
1121
|
+
*/
|
|
1062
1122
|
static copy(model) {
|
|
1063
1123
|
const result = new TileLayerSettings();
|
|
1064
1124
|
result.maxZoom = model.maxZoom;
|
|
@@ -1068,21 +1128,57 @@ class TileLayerSettings {
|
|
|
1068
1128
|
result.url = model.url;
|
|
1069
1129
|
return result;
|
|
1070
1130
|
}
|
|
1131
|
+
/**
|
|
1132
|
+
* Sets the URL of the TileLayerSettings object.
|
|
1133
|
+
*
|
|
1134
|
+
* @param {string} url - The URL to be set.
|
|
1135
|
+
* @return {TileLayerSettings} - The updated TileLayerSettings object.
|
|
1136
|
+
*/
|
|
1071
1137
|
setUrl(url) {
|
|
1072
1138
|
return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { url }));
|
|
1073
1139
|
}
|
|
1140
|
+
/**
|
|
1141
|
+
* Sets the maximum zoom level for the tile layer.
|
|
1142
|
+
*
|
|
1143
|
+
* @param {number} maxZoom - The maximum zoom level.
|
|
1144
|
+
* @returns {TileLayerSettings} - The updated tile layer settings object.
|
|
1145
|
+
*/
|
|
1074
1146
|
setMaxZoom(maxZoom) {
|
|
1075
1147
|
return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { maxZoom }));
|
|
1076
1148
|
}
|
|
1149
|
+
/**
|
|
1150
|
+
* Sets the minimum zoom level for the Tile Layer.
|
|
1151
|
+
*
|
|
1152
|
+
* @param {number} minZoom - The minimum zoom level to be set.
|
|
1153
|
+
* @return {TileLayerSettings} The modified TileLayerSettings object with the updated minimum zoom level.
|
|
1154
|
+
*/
|
|
1077
1155
|
setMinZoom(minZoom) {
|
|
1078
1156
|
return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { minZoom }));
|
|
1079
1157
|
}
|
|
1158
|
+
/**
|
|
1159
|
+
* Sets the opacity of the TileLayerSettings.
|
|
1160
|
+
*
|
|
1161
|
+
* @param {number} opacity - The opacity value to set. Must be a number between 0 and 1.
|
|
1162
|
+
* @return {TileLayerSettings} - A new instance of TileLayerSettings with the opacity set.
|
|
1163
|
+
*/
|
|
1080
1164
|
setOpacity(opacity) {
|
|
1081
1165
|
return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { opacity }));
|
|
1082
1166
|
}
|
|
1167
|
+
/**
|
|
1168
|
+
* Sets the projection for the tile layer settings.
|
|
1169
|
+
*
|
|
1170
|
+
* @param {string} projection - The desired projection for the tile layer settings.
|
|
1171
|
+
* @return {TileLayerSettings} - The updated tile layer settings with the new projection.
|
|
1172
|
+
*/
|
|
1083
1173
|
setProjection(projection) {
|
|
1084
1174
|
return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { projection }));
|
|
1085
1175
|
}
|
|
1176
|
+
/**
|
|
1177
|
+
* Checks if the current instance of TileLayerSettings is equal to the given model.
|
|
1178
|
+
* @param {TileLayerSettings} model - The model to compare against.
|
|
1179
|
+
* @return {boolean} - True if all properties of the current instance matches the properties of the model;
|
|
1180
|
+
* otherwise, false.
|
|
1181
|
+
*/
|
|
1086
1182
|
isSame(model) {
|
|
1087
1183
|
if (this.maxZoom !== model.maxZoom)
|
|
1088
1184
|
return false;
|
|
@@ -1151,18 +1247,18 @@ class TileLayerComponent extends DestructibleComponent {
|
|
|
1151
1247
|
this._settings = new TileLayerSettings();
|
|
1152
1248
|
this.onDestroy = () => this.removeLayer();
|
|
1153
1249
|
}
|
|
1154
|
-
ngOnInit() {
|
|
1155
|
-
this.postboy
|
|
1156
|
-
.subscribe(MapRenderedEvent.ID)
|
|
1157
|
-
.pipe(filter((m) => !!m), first())
|
|
1158
|
-
.subscribe((m) => this.initLayer());
|
|
1159
|
-
}
|
|
1160
1250
|
set settings(value) {
|
|
1161
1251
|
if (!value || this._settings.isSame(value))
|
|
1162
1252
|
return;
|
|
1163
1253
|
this._settings = value;
|
|
1164
1254
|
this.initLayer();
|
|
1165
1255
|
}
|
|
1256
|
+
ngOnInit() {
|
|
1257
|
+
this.postboy
|
|
1258
|
+
.subscribe(MapRenderedEvent.ID)
|
|
1259
|
+
.pipe(filter((m) => !!m), first())
|
|
1260
|
+
.subscribe((m) => this.initLayer());
|
|
1261
|
+
}
|
|
1166
1262
|
initLayer() {
|
|
1167
1263
|
this.removeLayer();
|
|
1168
1264
|
this.layer = this.factory.build(this._settings);
|
|
@@ -1247,17 +1343,24 @@ class FeatureLayerSettings {
|
|
|
1247
1343
|
*/
|
|
1248
1344
|
this.zIndex = 1;
|
|
1249
1345
|
/**
|
|
1250
|
-
|
|
1346
|
+
The maximum view zoom level (inclusive) at which this layer will be visible.
|
|
1347
|
+
|
|
1348
|
+
@type {number}
|
|
1349
|
+
@default 19
|
|
1251
1350
|
*/
|
|
1252
1351
|
this.maxZoom = 19;
|
|
1253
1352
|
/**
|
|
1254
|
-
|
|
1353
|
+
The minimum view zoom level (exclusive) at which this layer will be visible.
|
|
1354
|
+
|
|
1355
|
+
@type {number}
|
|
1255
1356
|
*/
|
|
1256
1357
|
this.minZoom = 0;
|
|
1257
1358
|
}
|
|
1258
1359
|
/**
|
|
1259
|
-
*
|
|
1260
|
-
*
|
|
1360
|
+
* Copies the given FeatureLayerSettings object
|
|
1361
|
+
*
|
|
1362
|
+
* @param {FeatureLayerSettings} model - The FeatureLayerSettings object to be copied
|
|
1363
|
+
* @returns {FeatureLayerSettings} - A copy of the FeatureLayerSettings object
|
|
1261
1364
|
*/
|
|
1262
1365
|
static copy(model) {
|
|
1263
1366
|
const result = new FeatureLayerSettings();
|
|
@@ -1269,43 +1372,56 @@ class FeatureLayerSettings {
|
|
|
1269
1372
|
return result;
|
|
1270
1373
|
}
|
|
1271
1374
|
/**
|
|
1272
|
-
|
|
1273
|
-
*
|
|
1375
|
+
* Sets the z-index value for the FeatureLayerSettings object.
|
|
1376
|
+
*
|
|
1377
|
+
* @param {number} zIndex - The new z-index value.
|
|
1378
|
+
* @return {FeatureLayerSettings} - The updated FeatureLayerSettings object.
|
|
1274
1379
|
*/
|
|
1275
1380
|
setZIndex(zIndex) {
|
|
1276
1381
|
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { zIndex }));
|
|
1277
1382
|
}
|
|
1278
1383
|
/**
|
|
1279
|
-
*
|
|
1280
|
-
*
|
|
1384
|
+
* Sets the name of the FeatureLayerSettings.
|
|
1385
|
+
*
|
|
1386
|
+
* @param {string} name - The name to set for the FeatureLayerSettings.
|
|
1387
|
+
*
|
|
1388
|
+
* @return {FeatureLayerSettings} - The updated FeatureLayerSettings object with the new name.
|
|
1281
1389
|
*/
|
|
1282
1390
|
setName(name) {
|
|
1283
1391
|
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { name }));
|
|
1284
1392
|
}
|
|
1285
1393
|
/**
|
|
1286
|
-
*
|
|
1287
|
-
*
|
|
1394
|
+
* Sets the maximum zoom level for the FeatureLayerSettings.
|
|
1395
|
+
*
|
|
1396
|
+
* @param {number} maxZoom - The maximum zoom level.
|
|
1397
|
+
* @return {FeatureLayerSettings} - The updated FeatureLayerSettings object.
|
|
1288
1398
|
*/
|
|
1289
1399
|
setMaxZoom(maxZoom) {
|
|
1290
1400
|
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { maxZoom }));
|
|
1291
1401
|
}
|
|
1292
1402
|
/**
|
|
1293
|
-
*
|
|
1294
|
-
*
|
|
1403
|
+
* Sets the minimum zoom level for the feature layer.
|
|
1404
|
+
*
|
|
1405
|
+
* @param {number} minZoom The minimum zoom level to be set.
|
|
1406
|
+
* @returns {FeatureLayerSettings} The updated feature layer settings object.
|
|
1295
1407
|
*/
|
|
1296
1408
|
setMinZoom(minZoom) {
|
|
1297
1409
|
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { minZoom }));
|
|
1298
1410
|
}
|
|
1299
1411
|
/**
|
|
1300
|
-
*
|
|
1301
|
-
*
|
|
1412
|
+
* Sets the style for the FeatureLayerSettings object.
|
|
1413
|
+
*
|
|
1414
|
+
* @param {Style | StyleFunction} style - The new style to set. It can be either a Style object or a StyleFunction.
|
|
1415
|
+
* @return {FeatureLayerSettings} - The updated FeatureLayerSettings object with the new style.
|
|
1302
1416
|
*/
|
|
1303
1417
|
setStyle(style) {
|
|
1304
1418
|
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { style }));
|
|
1305
1419
|
}
|
|
1306
1420
|
/**
|
|
1307
|
-
* Checks if the
|
|
1308
|
-
*
|
|
1421
|
+
* Checks if the given FeatureLayerSettings object is identical to the current object.
|
|
1422
|
+
*
|
|
1423
|
+
* @param {FeatureLayerSettings} model - The FeatureLayerSettings object to compare with.
|
|
1424
|
+
* @return {boolean} - Returns true if the given object is identical to the current object, otherwise false.
|
|
1309
1425
|
*/
|
|
1310
1426
|
isSame(model) {
|
|
1311
1427
|
if (this.maxZoom !== model.maxZoom)
|
|
@@ -1355,18 +1471,18 @@ class FeatureLayerComponent extends DestructibleComponent {
|
|
|
1355
1471
|
this._settings = new FeatureLayerSettings();
|
|
1356
1472
|
this.onDestroy = () => this.removeLayer();
|
|
1357
1473
|
}
|
|
1358
|
-
ngOnInit() {
|
|
1359
|
-
this.postboy
|
|
1360
|
-
.subscribe(MapRenderedEvent.ID)
|
|
1361
|
-
.pipe(filter((m) => !!m), first())
|
|
1362
|
-
.subscribe((m) => this.initLayer());
|
|
1363
|
-
}
|
|
1364
1474
|
set settings(value) {
|
|
1365
1475
|
if (!value || this._settings.isSame(value))
|
|
1366
1476
|
return;
|
|
1367
1477
|
this._settings = value;
|
|
1368
1478
|
this.initLayer();
|
|
1369
1479
|
}
|
|
1480
|
+
ngOnInit() {
|
|
1481
|
+
this.postboy
|
|
1482
|
+
.subscribe(MapRenderedEvent.ID)
|
|
1483
|
+
.pipe(filter((m) => !!m), first())
|
|
1484
|
+
.subscribe((m) => this.initLayer());
|
|
1485
|
+
}
|
|
1370
1486
|
initLayer() {
|
|
1371
1487
|
this.removeLayer();
|
|
1372
1488
|
this.layer = this.factory.build(this._settings);
|
|
@@ -1390,12 +1506,34 @@ class ClusterLayerSettings {
|
|
|
1390
1506
|
constructor() {
|
|
1391
1507
|
this.name = IdGenerator.get();
|
|
1392
1508
|
this.zIndex = 1;
|
|
1509
|
+
/**
|
|
1510
|
+
* The maximum view zoom level (inclusive) at which this layer will be visible.
|
|
1511
|
+
*
|
|
1512
|
+
* @type {number}
|
|
1513
|
+
* @default 19
|
|
1514
|
+
*/
|
|
1393
1515
|
this.maxZoom = 19;
|
|
1516
|
+
/**
|
|
1517
|
+
* The minimum view zoom level (exclusive) at which this layer will be visible.
|
|
1518
|
+
*
|
|
1519
|
+
* @type {number}
|
|
1520
|
+
*/
|
|
1394
1521
|
this.minZoom = 0;
|
|
1522
|
+
/**
|
|
1523
|
+
* Distance in pixels within which features will be clustered together.
|
|
1524
|
+
*
|
|
1525
|
+
* @type {number}
|
|
1526
|
+
*/
|
|
1395
1527
|
this.distance = 20;
|
|
1396
1528
|
this.bbox = false;
|
|
1397
1529
|
this.clusterCancel = 14;
|
|
1398
1530
|
}
|
|
1531
|
+
/**
|
|
1532
|
+
* Creates a copy of the given ClusterLayerSettings object.
|
|
1533
|
+
*
|
|
1534
|
+
* @param {ClusterLayerSettings} model - The ClusterLayerSettings object to be copied.
|
|
1535
|
+
* @returns {ClusterLayerSettings} - A new ClusterLayerSettings object that is a copy of the original object.
|
|
1536
|
+
*/
|
|
1399
1537
|
static copy(model) {
|
|
1400
1538
|
const result = new ClusterLayerSettings();
|
|
1401
1539
|
result.name = model.name;
|
|
@@ -1408,30 +1546,86 @@ class ClusterLayerSettings {
|
|
|
1408
1546
|
result.style = model.style;
|
|
1409
1547
|
return result;
|
|
1410
1548
|
}
|
|
1549
|
+
/**
|
|
1550
|
+
* Set the z-index for the ClusterLayer.
|
|
1551
|
+
*
|
|
1552
|
+
* @param {number} zIndex - The new z-index for the ClusterLayer.
|
|
1553
|
+
* @return {ClusterLayerSettings} - The updated ClusterLayerSettings object.
|
|
1554
|
+
*/
|
|
1411
1555
|
setZIndex(zIndex) {
|
|
1412
1556
|
return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { zIndex }));
|
|
1413
1557
|
}
|
|
1558
|
+
/**
|
|
1559
|
+
* Sets the distance value for ClusterLayerSettings.
|
|
1560
|
+
*
|
|
1561
|
+
* @param {number} distance - The distance value to be set.
|
|
1562
|
+
* @return {ClusterLayerSettings} - The modified ClusterLayerSettings object.
|
|
1563
|
+
*/
|
|
1414
1564
|
setDistance(distance) {
|
|
1415
1565
|
return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { distance }));
|
|
1416
1566
|
}
|
|
1567
|
+
/**
|
|
1568
|
+
* Sets the name of the ClusterLayerSettings object.
|
|
1569
|
+
*
|
|
1570
|
+
* @param {string} name - The name to set for the ClusterLayerSettings.
|
|
1571
|
+
* @return {ClusterLayerSettings} - A new ClusterLayerSettings object with the updated name.
|
|
1572
|
+
*/
|
|
1417
1573
|
setName(name) {
|
|
1418
1574
|
return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { name }));
|
|
1419
1575
|
}
|
|
1576
|
+
/**
|
|
1577
|
+
* Sets the maximum zoom level for the Cluster Layer.
|
|
1578
|
+
*
|
|
1579
|
+
* @param {number} maxZoom - The maximum zoom level to be set.
|
|
1580
|
+
* @return {ClusterLayerSettings} - The updated ClusterLayerSettings object.
|
|
1581
|
+
*/
|
|
1420
1582
|
setMaxZoom(maxZoom) {
|
|
1421
1583
|
return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { maxZoom }));
|
|
1422
1584
|
}
|
|
1585
|
+
/**
|
|
1586
|
+
* Sets the minimum zoom level for the ClusterLayerSettings.
|
|
1587
|
+
*
|
|
1588
|
+
* @param {number} minZoom - The minimum zoom level to set.
|
|
1589
|
+
* @return {ClusterLayerSettings} - The updated ClusterLayerSettings object.
|
|
1590
|
+
*/
|
|
1423
1591
|
setMinZoom(minZoom) {
|
|
1424
1592
|
return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { minZoom }));
|
|
1425
1593
|
}
|
|
1594
|
+
/**
|
|
1595
|
+
* Sets the cluster cancel number for the ClusterLayerSettings.
|
|
1596
|
+
*
|
|
1597
|
+
* @param {number} clusterCancel - The new cluster cancel number.
|
|
1598
|
+
* @returns {ClusterLayerSettings} - The updated ClusterLayerSettings object.
|
|
1599
|
+
*/
|
|
1426
1600
|
setClusterCancel(clusterCancel) {
|
|
1427
1601
|
return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { clusterCancel }));
|
|
1428
1602
|
}
|
|
1603
|
+
/**
|
|
1604
|
+
* Sets the value of 'bbox' property in the ClusterLayerSettings object.
|
|
1605
|
+
*
|
|
1606
|
+
* @param {boolean} bbox - A boolean value indicating whether to include bounding box calculation in the cluster layer settings.
|
|
1607
|
+
* @returns {ClusterLayerSettings} - The updated ClusterLayerSettings object with the newly set 'bbox' value.
|
|
1608
|
+
*/
|
|
1429
1609
|
setBbox(bbox) {
|
|
1430
1610
|
return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { bbox }));
|
|
1431
1611
|
}
|
|
1612
|
+
/**
|
|
1613
|
+
* Sets the style for the ClusterLayerSettings.
|
|
1614
|
+
*
|
|
1615
|
+
* @param {function} style - A function that takes an array of identified features as input and returns a Style or StyleFunction.
|
|
1616
|
+
*
|
|
1617
|
+
* @return {ClusterLayerSettings} - The updated ClusterLayerSettings object with the new style applied.
|
|
1618
|
+
*/
|
|
1432
1619
|
setStyle(style) {
|
|
1433
1620
|
return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { style }));
|
|
1434
1621
|
}
|
|
1622
|
+
/**
|
|
1623
|
+
* Checks if the current ClusterLayerSettings object is the same as the specified model.
|
|
1624
|
+
*
|
|
1625
|
+
* @param {ClusterLayerSettings} model - The model to compare with the current object.
|
|
1626
|
+
*
|
|
1627
|
+
* @return {boolean} - Returns true if the current ClusterLayerSettings object is the same as the specified model, otherwise false.
|
|
1628
|
+
*/
|
|
1435
1629
|
isSame(model) {
|
|
1436
1630
|
if (this.maxZoom !== model.maxZoom)
|
|
1437
1631
|
return false;
|
|
@@ -1536,6 +1730,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1536
1730
|
}]
|
|
1537
1731
|
}] });
|
|
1538
1732
|
|
|
1733
|
+
/**
|
|
1734
|
+
* Represents a cluster layer component.
|
|
1735
|
+
*/
|
|
1539
1736
|
class ClusterLayerComponent extends DestructibleComponent {
|
|
1540
1737
|
constructor(postboy, factory) {
|
|
1541
1738
|
super();
|
|
@@ -1545,18 +1742,23 @@ class ClusterLayerComponent extends DestructibleComponent {
|
|
|
1545
1742
|
this._settings = new ClusterLayerSettings();
|
|
1546
1743
|
this.onDestroy = () => this.removeLayer();
|
|
1547
1744
|
}
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
}
|
|
1745
|
+
/**
|
|
1746
|
+
* Sets the settings for the cluster layer.
|
|
1747
|
+
*
|
|
1748
|
+
* @param {ClusterLayerSettings | undefined} value - The settings for the cluster layer.
|
|
1749
|
+
*/
|
|
1554
1750
|
set settings(value) {
|
|
1555
1751
|
if (!value || this._settings.isSame(value))
|
|
1556
1752
|
return;
|
|
1557
1753
|
this._settings = value;
|
|
1558
1754
|
this.initLayer();
|
|
1559
1755
|
}
|
|
1756
|
+
ngOnInit() {
|
|
1757
|
+
this.postboy
|
|
1758
|
+
.subscribe(MapRenderedEvent.ID)
|
|
1759
|
+
.pipe(filter((m) => !!m), first())
|
|
1760
|
+
.subscribe((m) => this.initLayer());
|
|
1761
|
+
}
|
|
1560
1762
|
initLayer() {
|
|
1561
1763
|
this.removeLayer();
|
|
1562
1764
|
this.manager = this.factory.build(this._settings, this.postboy);
|
|
@@ -1609,8 +1811,8 @@ class MapPlateComponent extends DestructibleComponent {
|
|
|
1609
1811
|
this.registrator = registrator;
|
|
1610
1812
|
this.detector = detector;
|
|
1611
1813
|
this.osmUrl = '';
|
|
1612
|
-
this._settings = new MapSettings();
|
|
1613
1814
|
this.drawingLayerSettings = new FeatureLayerSettings().setName(MapConstants.DrawingLayerId);
|
|
1815
|
+
this._settings = new MapSettings();
|
|
1614
1816
|
this.onDestroy = () => {
|
|
1615
1817
|
this.registrator.down();
|
|
1616
1818
|
};
|
|
@@ -1672,6 +1874,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1672
1874
|
type: Input
|
|
1673
1875
|
}] } });
|
|
1674
1876
|
|
|
1877
|
+
/**
|
|
1878
|
+
* MarkersComponent is a component that displays markers on a map.
|
|
1879
|
+
* It listens for changes in the `markers` input property and
|
|
1880
|
+
* automatically puts the markers on the map using the MapPostboyService.
|
|
1881
|
+
*/
|
|
1675
1882
|
class MarkersComponent extends DestructibleComponent {
|
|
1676
1883
|
constructor(postboy) {
|
|
1677
1884
|
super();
|
|
@@ -1679,6 +1886,11 @@ class MarkersComponent extends DestructibleComponent {
|
|
|
1679
1886
|
this.layerName = '';
|
|
1680
1887
|
this._markers = [];
|
|
1681
1888
|
}
|
|
1889
|
+
/**
|
|
1890
|
+
* Sets the markers property.
|
|
1891
|
+
*
|
|
1892
|
+
* @param {MarkerModel[]} value - The array of MarkerModel objects to set as markers.
|
|
1893
|
+
*/
|
|
1682
1894
|
set markers(value) {
|
|
1683
1895
|
this._markers = value !== null && value !== void 0 ? value : [];
|
|
1684
1896
|
this.putMarkers();
|
|
@@ -1736,23 +1948,12 @@ class TooltipSettings {
|
|
|
1736
1948
|
}
|
|
1737
1949
|
|
|
1738
1950
|
class TooltipComponent extends DestructibleComponent {
|
|
1739
|
-
set settings(value) {
|
|
1740
|
-
if (!value || this._settings.isSame(value))
|
|
1741
|
-
return;
|
|
1742
|
-
this._settings = value;
|
|
1743
|
-
this.detector.detectChanges();
|
|
1744
|
-
}
|
|
1745
1951
|
constructor(postboy, detector) {
|
|
1746
1952
|
super();
|
|
1747
1953
|
this.postboy = postboy;
|
|
1748
1954
|
this.detector = detector;
|
|
1749
|
-
this._settings = new TooltipSettings();
|
|
1750
1955
|
this.show = false;
|
|
1751
|
-
this.
|
|
1752
|
-
var _a;
|
|
1753
|
-
!!this.overlay && ((_a = this.map) === null || _a === void 0 ? void 0 : _a.removeOverlay(this.overlay));
|
|
1754
|
-
this.show = false;
|
|
1755
|
-
};
|
|
1956
|
+
this._settings = new TooltipSettings();
|
|
1756
1957
|
this.options = (coordinates) => {
|
|
1757
1958
|
var _a;
|
|
1758
1959
|
return {
|
|
@@ -1762,12 +1963,31 @@ class TooltipComponent extends DestructibleComponent {
|
|
|
1762
1963
|
position: coordinates,
|
|
1763
1964
|
};
|
|
1764
1965
|
};
|
|
1966
|
+
this.removeOverlay = () => {
|
|
1967
|
+
var _a;
|
|
1968
|
+
!!this.overlay && ((_a = this.map) === null || _a === void 0 ? void 0 : _a.removeOverlay(this.overlay));
|
|
1969
|
+
this.show = false;
|
|
1970
|
+
};
|
|
1971
|
+
}
|
|
1972
|
+
set settings(value) {
|
|
1973
|
+
if (!value || this._settings.isSame(value))
|
|
1974
|
+
return;
|
|
1975
|
+
this._settings = value;
|
|
1976
|
+
this.detector.detectChanges();
|
|
1765
1977
|
}
|
|
1766
1978
|
ngOnInit() {
|
|
1767
1979
|
this.subs.push(this.observeMapRender());
|
|
1768
1980
|
this.subs.push(this.observeMapClick());
|
|
1769
1981
|
this.subs.push(this.observeClose());
|
|
1770
1982
|
}
|
|
1983
|
+
addOverlay(coordinates) {
|
|
1984
|
+
var _a;
|
|
1985
|
+
this.removeOverlay();
|
|
1986
|
+
this.overlay = new Overlay(this.options(coordinates));
|
|
1987
|
+
(_a = this.map) === null || _a === void 0 ? void 0 : _a.addOverlay(this.overlay);
|
|
1988
|
+
this.show = true;
|
|
1989
|
+
this.detector.detectChanges();
|
|
1990
|
+
}
|
|
1771
1991
|
observeMapClick() {
|
|
1772
1992
|
return this.postboy.subscribe(MapClickEvent.ID).subscribe((ev) => {
|
|
1773
1993
|
this._settings.show(ev) ? this.addOverlay(ev.coordinates) : this.removeOverlay();
|
|
@@ -1784,14 +2004,6 @@ class TooltipComponent extends DestructibleComponent {
|
|
|
1784
2004
|
this.map = m.map;
|
|
1785
2005
|
});
|
|
1786
2006
|
}
|
|
1787
|
-
addOverlay(coordinates) {
|
|
1788
|
-
var _a;
|
|
1789
|
-
this.removeOverlay();
|
|
1790
|
-
this.overlay = new Overlay(this.options(coordinates));
|
|
1791
|
-
(_a = this.map) === null || _a === void 0 ? void 0 : _a.addOverlay(this.overlay);
|
|
1792
|
-
this.show = true;
|
|
1793
|
-
this.detector.detectChanges();
|
|
1794
|
-
}
|
|
1795
2007
|
}
|
|
1796
2008
|
TooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TooltipComponent, deps: [{ token: MapPostboyService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1797
2009
|
TooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: TooltipComponent, selector: "art-tooltip", inputs: { settings: "settings" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["tip"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div #tip [class]=\"['tooltip-wrapper', _settings.containerClass]\" [hidden]=\"!show\">\r\n <ng-content></ng-content>\r\n</div>\r\n", styles: [".tooltip-wrapper{position:absolute}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
@@ -1805,6 +2017,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1805
2017
|
type: Input
|
|
1806
2018
|
}] } });
|
|
1807
2019
|
|
|
2020
|
+
/**
|
|
2021
|
+
* Component for rendering polygons on a map.
|
|
2022
|
+
* It listens for changes in the `polygons` input property and
|
|
2023
|
+
* automatically puts the polygons on the map using the MapPostboyService.
|
|
2024
|
+
*/
|
|
1808
2025
|
class PolygonsComponent extends DestructibleComponent {
|
|
1809
2026
|
constructor(postboy) {
|
|
1810
2027
|
super();
|
|
@@ -1812,6 +2029,11 @@ class PolygonsComponent extends DestructibleComponent {
|
|
|
1812
2029
|
this.layerName = '';
|
|
1813
2030
|
this._polygons = [];
|
|
1814
2031
|
}
|
|
2032
|
+
/**
|
|
2033
|
+
* Sets the value of polygons.
|
|
2034
|
+
*
|
|
2035
|
+
* @param {PolygonModel[]} value - The new value for polygons.
|
|
2036
|
+
*/
|
|
1815
2037
|
set polygons(value) {
|
|
1816
2038
|
this._polygons = value !== null && value !== void 0 ? value : [];
|
|
1817
2039
|
this.putPolygons();
|
|
@@ -1839,14 +2061,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1839
2061
|
type: Input
|
|
1840
2062
|
}] } });
|
|
1841
2063
|
|
|
2064
|
+
/**
|
|
2065
|
+
* Represents the settings for a zoom control.
|
|
2066
|
+
*/
|
|
1842
2067
|
class ZoomControlSettings {
|
|
1843
2068
|
constructor() {
|
|
2069
|
+
/**
|
|
2070
|
+
* The CSS class name of the control element.
|
|
2071
|
+
*
|
|
2072
|
+
* @type {string}
|
|
2073
|
+
*/
|
|
1844
2074
|
this.controlClass = 'ol-zoom';
|
|
2075
|
+
/**
|
|
2076
|
+
* The CSS class name for zoom in button.
|
|
2077
|
+
* @type {string}
|
|
2078
|
+
*/
|
|
1845
2079
|
this.zoomInClass = 'ol-zoom-in';
|
|
2080
|
+
/**
|
|
2081
|
+
* The CSS class name for the zoom out button element.
|
|
2082
|
+
*
|
|
2083
|
+
* @type {string}
|
|
2084
|
+
*/
|
|
1846
2085
|
this.zoomOutClass = 'ol-zoom-out';
|
|
2086
|
+
/**
|
|
2087
|
+
* The label for the zoom in action.
|
|
2088
|
+
*
|
|
2089
|
+
* @type {string}
|
|
2090
|
+
*/
|
|
1847
2091
|
this.zoomInLabel = 'Zoom In';
|
|
2092
|
+
/**
|
|
2093
|
+
* The label for the zoom out control.
|
|
2094
|
+
*
|
|
2095
|
+
* @type {string}
|
|
2096
|
+
*/
|
|
1848
2097
|
this.zoomOutLabel = 'Zoom Out';
|
|
1849
2098
|
}
|
|
2099
|
+
/**
|
|
2100
|
+
* Copies the provided ZoomControlSettings object.
|
|
2101
|
+
*
|
|
2102
|
+
* @param {ZoomControlSettings} model - The ZoomControlSettings object to be copied.
|
|
2103
|
+
* @return {ZoomControlSettings} - The copied ZoomControlSettings object.
|
|
2104
|
+
*/
|
|
1850
2105
|
static copy(model) {
|
|
1851
2106
|
const result = new ZoomControlSettings();
|
|
1852
2107
|
result.controlClass = model.controlClass;
|
|
@@ -1856,6 +2111,13 @@ class ZoomControlSettings {
|
|
|
1856
2111
|
result.zoomOutLabel = model.zoomOutLabel;
|
|
1857
2112
|
return result;
|
|
1858
2113
|
}
|
|
2114
|
+
/**
|
|
2115
|
+
* Checks if the current ZoomControlSettings object is equal to the given model.
|
|
2116
|
+
*
|
|
2117
|
+
* @param {ZoomControlSettings} model - The ZoomControlSettings object to compare with.
|
|
2118
|
+
*
|
|
2119
|
+
* @return {boolean} - true if the current object is equal to the given model, false otherwise.
|
|
2120
|
+
*/
|
|
1859
2121
|
isSame(model) {
|
|
1860
2122
|
if (this.zoomInClass !== model.zoomInClass)
|
|
1861
2123
|
return false;
|
|
@@ -1869,30 +2131,61 @@ class ZoomControlSettings {
|
|
|
1869
2131
|
return false;
|
|
1870
2132
|
return true;
|
|
1871
2133
|
}
|
|
2134
|
+
/**
|
|
2135
|
+
* Sets the zoom in label of the Zoom Control Settings.
|
|
2136
|
+
*
|
|
2137
|
+
* @param {string} zoomInLabel - The label for the zoom in button.
|
|
2138
|
+
* @return {ZoomControlSettings} - The new Zoom Control Settings object with the updated zoom in label.
|
|
2139
|
+
*/
|
|
1872
2140
|
setZoomInLabel(zoomInLabel) {
|
|
1873
2141
|
return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomInLabel }));
|
|
1874
2142
|
}
|
|
2143
|
+
/**
|
|
2144
|
+
* Sets the zoomOutClass property of the ZoomControlSettings object.
|
|
2145
|
+
*
|
|
2146
|
+
* @param {string} zoomOutClass - The CSS class to be assigned to the zoom out button.
|
|
2147
|
+
* @return {ZoomControlSettings} - The updated ZoomControlSettings object with the new zoomOutClass value.
|
|
2148
|
+
*/
|
|
1875
2149
|
setZoomOutClass(zoomOutClass) {
|
|
1876
2150
|
return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomOutClass }));
|
|
1877
2151
|
}
|
|
2152
|
+
/**
|
|
2153
|
+
* Sets the zoom in class for the zoom control settings.
|
|
2154
|
+
*
|
|
2155
|
+
* @param {string} zoomInClass - The new zoom in class to be set.
|
|
2156
|
+
* @return {ZoomControlSettings} - The updated zoom control settings.
|
|
2157
|
+
*/
|
|
1878
2158
|
setZoomInClass(zoomInClass) {
|
|
1879
2159
|
return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomInClass }));
|
|
1880
2160
|
}
|
|
2161
|
+
/**
|
|
2162
|
+
* Set the label for the zoom out control.
|
|
2163
|
+
*
|
|
2164
|
+
* @param {string} zoomOutLabel - The label for the zoom out control.
|
|
2165
|
+
* @returns {ZoomControlSettings} - The updated zoom control settings.
|
|
2166
|
+
*/
|
|
1881
2167
|
setZoomOutLabel(zoomOutLabel) {
|
|
1882
2168
|
return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomOutLabel }));
|
|
1883
2169
|
}
|
|
2170
|
+
/**
|
|
2171
|
+
* Sets the control class for the ZoomControlSettings.
|
|
2172
|
+
*
|
|
2173
|
+
* @param {string} controlClass - The class name of the control to be set.
|
|
2174
|
+
*
|
|
2175
|
+
* @return {ZoomControlSettings} - The modified ZoomControlSettings object.
|
|
2176
|
+
*/
|
|
1884
2177
|
setControlClass(controlClass) {
|
|
1885
2178
|
return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { controlClass }));
|
|
1886
2179
|
}
|
|
1887
2180
|
}
|
|
1888
2181
|
|
|
2182
|
+
/**
|
|
2183
|
+
* @class
|
|
2184
|
+
* @classdesc Represents a component for the Zoom control on a map.
|
|
2185
|
+
* @extends DestructibleComponent
|
|
2186
|
+
* @implements OnInit
|
|
2187
|
+
*/
|
|
1889
2188
|
class MapControlZoomComponent extends DestructibleComponent {
|
|
1890
|
-
set settings(value) {
|
|
1891
|
-
if (!value || this._settings.isSame(value))
|
|
1892
|
-
return;
|
|
1893
|
-
this._settings = value;
|
|
1894
|
-
this.setControl();
|
|
1895
|
-
}
|
|
1896
2189
|
constructor(postboy) {
|
|
1897
2190
|
super();
|
|
1898
2191
|
this.postboy = postboy;
|
|
@@ -1902,6 +2195,23 @@ class MapControlZoomComponent extends DestructibleComponent {
|
|
|
1902
2195
|
};
|
|
1903
2196
|
this.eliminate = () => !!this.map && !!this.control && this.map.removeControl(this.control);
|
|
1904
2197
|
}
|
|
2198
|
+
/**
|
|
2199
|
+
* Sets the settings for the Zoom Control.
|
|
2200
|
+
*
|
|
2201
|
+
* @param {ZoomControlSettings | undefined} value - The new settings for the Zoom Control.
|
|
2202
|
+
*
|
|
2203
|
+
* @description
|
|
2204
|
+
* This method sets the settings for the Zoom Control. It takes a parameter `value` which should be an object of type `ZoomControlSettings` or `undefined`.
|
|
2205
|
+
*
|
|
2206
|
+
* If the `value` is `undefined` or the same as the current settings, the method will return without making any changes.
|
|
2207
|
+
*
|
|
2208
|
+
*/
|
|
2209
|
+
set settings(value) {
|
|
2210
|
+
if (!value || this._settings.isSame(value))
|
|
2211
|
+
return;
|
|
2212
|
+
this._settings = value;
|
|
2213
|
+
this.setControl();
|
|
2214
|
+
}
|
|
1905
2215
|
ngOnInit() {
|
|
1906
2216
|
this.postboy
|
|
1907
2217
|
.subscribe(MapRenderedEvent.ID)
|
|
@@ -1977,7 +2287,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1977
2287
|
}]
|
|
1978
2288
|
}] });
|
|
1979
2289
|
|
|
2290
|
+
/**
|
|
2291
|
+
* Helper class to create and modify marker styles.
|
|
2292
|
+
*/
|
|
1980
2293
|
class MarkerStyleHelper {
|
|
2294
|
+
/**
|
|
2295
|
+
* Creates a new Style object from an SVG.
|
|
2296
|
+
* @param {string} svg - The SVG string.
|
|
2297
|
+
* @param {Array<number>} [size=[30, 30]] - The size of the icon image.
|
|
2298
|
+
* @param {number} [zIndex=400] - The zIndex of the style.
|
|
2299
|
+
* @returns {Style} A new Style object.
|
|
2300
|
+
*/
|
|
1981
2301
|
static fromSvg(svg, size = [30, 30], zIndex = 400) {
|
|
1982
2302
|
let image = new Image();
|
|
1983
2303
|
image.src = 'data:image/svg+xml,' + escape(svg);
|
|
@@ -1989,6 +2309,15 @@ class MarkerStyleHelper {
|
|
|
1989
2309
|
zIndex,
|
|
1990
2310
|
});
|
|
1991
2311
|
}
|
|
2312
|
+
/**
|
|
2313
|
+
* Returns a Style object with a circle style.
|
|
2314
|
+
*
|
|
2315
|
+
* @param {number} radius - The radius of the circle.
|
|
2316
|
+
* @param {string} fill - The fill color of the circle. Format: '#RRGGBB' or 'rgba(R, G, B, A)'.
|
|
2317
|
+
* @param {string} strokeColor - The stroke color of the circle. Format: '#RRGGBB' or 'rgba(R, G, B, A)'.
|
|
2318
|
+
* @param {number} [strokeWidth=1] - The width of the stroke. Default is 1.
|
|
2319
|
+
* @returns {Style} - A Style object with a Circle image.
|
|
2320
|
+
*/
|
|
1992
2321
|
static circle(radius, fill, strokeColor, strokeWidth = 1) {
|
|
1993
2322
|
return new Style({
|
|
1994
2323
|
image: new Circle({
|
|
@@ -1998,13 +2327,32 @@ class MarkerStyleHelper {
|
|
|
1998
2327
|
}),
|
|
1999
2328
|
});
|
|
2000
2329
|
}
|
|
2330
|
+
/**
|
|
2331
|
+
* Applies the given Text to the provided Style.
|
|
2332
|
+
*
|
|
2333
|
+
* @param {Style} style - The Style to modify.
|
|
2334
|
+
* @param {Text} text - The Text to apply to the Style.
|
|
2335
|
+
* @return {Style} - The modified Style with the applied Text.
|
|
2336
|
+
*/
|
|
2001
2337
|
static withText(style, text) {
|
|
2002
2338
|
style.setText(text);
|
|
2003
2339
|
return style;
|
|
2004
2340
|
}
|
|
2005
2341
|
}
|
|
2006
2342
|
|
|
2343
|
+
/**
|
|
2344
|
+
* A helper class for creating polygon styles.
|
|
2345
|
+
* @class
|
|
2346
|
+
*/
|
|
2007
2347
|
class PolygonStyleHelper {
|
|
2348
|
+
/**
|
|
2349
|
+
* Creates a Style object with the given fill color, stroke color, and stroke width.
|
|
2350
|
+
*
|
|
2351
|
+
* @param {string} fill - The fill color in hexadecimal or RGB format.
|
|
2352
|
+
* @param {string} stroke - The stroke color in hexadecimal or RGB format.
|
|
2353
|
+
* @param {number} [strokeWidth=1] - The width of the stroke. Defaults to 1.
|
|
2354
|
+
* @return {Style} The created Style object.
|
|
2355
|
+
*/
|
|
2008
2356
|
static simple(fill, stroke, strokeWidth = 1) {
|
|
2009
2357
|
return new Style({
|
|
2010
2358
|
fill: new Fill({
|
|
@@ -2016,6 +2364,15 @@ class PolygonStyleHelper {
|
|
|
2016
2364
|
}),
|
|
2017
2365
|
});
|
|
2018
2366
|
}
|
|
2367
|
+
/**
|
|
2368
|
+
* Creates a new Style object with the given fill, stroke, stroke width, and pin radius.
|
|
2369
|
+
*
|
|
2370
|
+
* @param {string} fill - The color to use for the fill of the style.
|
|
2371
|
+
* @param {string} stroke - The color to use for the stroke of the style.
|
|
2372
|
+
* @param {number} [strokeWidth=1] - The width of the stroke. Defaults to 1.
|
|
2373
|
+
* @param {number} [pinRadius=5] - The radius of the circle used as the image for the style. Defaults to 5.
|
|
2374
|
+
* @returns {Style} - The newly created Style object.
|
|
2375
|
+
*/
|
|
2019
2376
|
static edit(fill, stroke, strokeWidth = 1, pinRadius = 5) {
|
|
2020
2377
|
return new Style({
|
|
2021
2378
|
image: new Circle({
|
|
@@ -2035,7 +2392,18 @@ class PolygonStyleHelper {
|
|
|
2035
2392
|
}
|
|
2036
2393
|
}
|
|
2037
2394
|
|
|
2395
|
+
/**
|
|
2396
|
+
* Helper class for creating text styles.
|
|
2397
|
+
*/
|
|
2038
2398
|
class TextStyleHelper {
|
|
2399
|
+
/**
|
|
2400
|
+
* Creates a new instance of the Text class with the specified properties.
|
|
2401
|
+
*
|
|
2402
|
+
* @param {string} text - The text content of the Text object.
|
|
2403
|
+
* @param {string} font - The font style of the Text object.
|
|
2404
|
+
* @param {string} color - The color of the Text object.
|
|
2405
|
+
* @return {Text} A new instance of the Text class.
|
|
2406
|
+
*/
|
|
2039
2407
|
static get(text, font, color) {
|
|
2040
2408
|
return new Text({
|
|
2041
2409
|
text: text,
|
|
@@ -2048,37 +2416,41 @@ class TextStyleHelper {
|
|
|
2048
2416
|
}
|
|
2049
2417
|
}
|
|
2050
2418
|
|
|
2419
|
+
/**
|
|
2420
|
+
* A helper class for converting and stringify features.
|
|
2421
|
+
*/
|
|
2051
2422
|
class StringifyFeatureHelper {
|
|
2052
2423
|
static polygon(feature, format = FeatureOutputFormat.GeoJson) {
|
|
2053
2424
|
return format === FeatureOutputFormat.GeoJson
|
|
2054
2425
|
? new GeoJSON().writeFeature(feature)
|
|
2055
2426
|
: new WKT().writeFeature(feature);
|
|
2056
2427
|
}
|
|
2428
|
+
/**
|
|
2429
|
+
* Creates a polygon feature representing a circle based on a given feature with a circle geometry.
|
|
2430
|
+
*
|
|
2431
|
+
* @param {Feature<Geometry>} feature - The input feature with a circle geometry.
|
|
2432
|
+
* @param {FeatureOutputFormat} format - The format for outputting the polygon feature. (default: FeatureOutputFormat.GeoJson)
|
|
2433
|
+
*
|
|
2434
|
+
* @return {string} - The string representation of the polygon feature.
|
|
2435
|
+
*/
|
|
2057
2436
|
static circle(feature, format = FeatureOutputFormat.GeoJson) {
|
|
2058
|
-
// const clone = feature.clone();
|
|
2059
|
-
// clone.setGeometry(fromCircle(feature.getGeometry()! as Circle));
|
|
2060
|
-
const tetemp = feature.getGeometryName();
|
|
2061
2437
|
const circle = feature.getGeometry();
|
|
2062
|
-
|
|
2063
|
-
const
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
...transform([ttt[0], ttt[1]], 'EPSG:4326', 'EPSG:3857'),
|
|
2067
|
-
...transform([ttt[2], ttt[3]], 'EPSG:4326', 'EPSG:3857'),
|
|
2438
|
+
const ext = feature.getGeometry().getExtent();
|
|
2439
|
+
const coords = [
|
|
2440
|
+
...transform([ext[0], ext[1]], 'EPSG:4326', 'EPSG:3857'),
|
|
2441
|
+
...transform([ext[2], ext[3]], 'EPSG:4326', 'EPSG:3857'),
|
|
2068
2442
|
];
|
|
2069
|
-
const radius = (
|
|
2070
|
-
const radius2 = new LineString([circle.getCenter(), eastPoint]).getLength();
|
|
2443
|
+
const radius = (coords[2] - coords[0]) / 2;
|
|
2071
2444
|
const polygonGeom = new Polygon(StringifyFeatureHelper.drawCircle(circle.getCenter(), radius));
|
|
2072
|
-
// var edgeCoordinate = [circle.getCenter()[0] + radius, circle.getCenter()[1]];
|
|
2073
|
-
// var wgs84Sphere = new Sphere(6378137);
|
|
2074
2445
|
return StringifyFeatureHelper.polygon(new Feature(polygonGeom), format);
|
|
2075
|
-
// const rad = circle.getRadius();
|
|
2076
|
-
// const degrees = 180 / Math.PI; // radians to degrees
|
|
2077
|
-
// const radians = Math.PI / 180; // degrees to radians
|
|
2078
|
-
// const rlat = rad * degrees * 1000;
|
|
2079
|
-
// const rlng = rad * radians;
|
|
2080
|
-
// return StringifyFeatureHelper.polygon(new Feature<Geometry>(circular(circle.getCenter(),circle.getRadius() * METERS_PER_UNIT)), format);
|
|
2081
2446
|
}
|
|
2447
|
+
/**
|
|
2448
|
+
* Draw a circle based on a center point and radius.
|
|
2449
|
+
*
|
|
2450
|
+
* @param {number[]} point - The center point coordinates in EPSG:4326 format.
|
|
2451
|
+
* @param {number} radius - The radius of the circle in meters.
|
|
2452
|
+
* @return {Coordinate[][]} - The coordinates of the circle boundary in EPSG:4326 format.
|
|
2453
|
+
*/
|
|
2082
2454
|
static drawCircle(point, radius) {
|
|
2083
2455
|
const tetetemp = transform(point, 'EPSG:4326', 'EPSG:3857');
|
|
2084
2456
|
// const tetetemp = point;
|
|
@@ -2111,5 +2483,5 @@ class StringifyFeatureHelper {
|
|
|
2111
2483
|
* Generated bundle index. Do not edit.
|
|
2112
2484
|
*/
|
|
2113
2485
|
|
|
2114
|
-
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 };
|
|
2486
|
+
export { AddControlCommand, CalculateAreaExecutor, CancelDrawingCommand, CancelFeatureModificationCommand, CloseTooltipCommand, ClusterLayerComponent, ClusterLayerSettings, DrawSelectionAreaCommand, DrawingType, FeatureLayerComponent, FeatureLayerSettings, FeatureOutputFormat, FitToPolygonsCommand, GetMapPositionExecutor, 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 };
|
|
2115
2487
|
//# sourceMappingURL=maps-components.mjs.map
|