@artstesh/maps 6.1.15 → 6.2.0
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/esm2022/map/common/destructible.component.mjs +6 -3
- package/dist/esm2022/map/map-plate/controls/map-control-zoom/map-control-zoom.component.mjs +3 -3
- package/dist/esm2022/map/map-plate/features/markers/markers.component.mjs +3 -3
- package/dist/esm2022/map/map-plate/features/polygons/polygons.component.mjs +3 -3
- package/dist/esm2022/map/map-plate/layers/cluster-layer/cluster-layer.component.mjs +3 -3
- package/dist/esm2022/map/map-plate/layers/feature-layer/feature-layer.component.mjs +3 -3
- package/dist/esm2022/map/map-plate/layers/image-layer/image-layer.component.mjs +3 -3
- package/dist/esm2022/map/map-plate/layers/osm-tile-layer/osm-tile-layer.component.mjs +14 -4
- package/dist/esm2022/map/map-plate/layers/raster-tile/raster-tile-layer.component.mjs +3 -3
- package/dist/esm2022/map/map-plate/layers/tile-layer/tile-layer.component.mjs +3 -3
- package/dist/esm2022/map/map-plate/map-plate.component.mjs +9 -10
- package/dist/esm2022/map/map-plate/tooltips/tooltip/tooltip.component.mjs +6 -4
- package/dist/esm2022/map/messages/executors/generate-zoom-control.executor.mjs +1 -1
- package/dist/esm2022/map/models/map-settings.mjs +14 -1
- package/dist/esm2022/map/public-api.mjs +1 -2
- package/dist/esm2022/src/map/common/destructible.component.mjs +6 -3
- package/dist/esm2022/src/map/map-plate/controls/map-control-zoom/map-control-zoom.component.mjs +3 -3
- package/dist/esm2022/src/map/map-plate/features/markers/markers.component.mjs +3 -3
- package/dist/esm2022/src/map/map-plate/features/polygons/polygons.component.mjs +3 -3
- package/dist/esm2022/src/map/map-plate/layers/cluster-layer/cluster-layer.component.mjs +3 -3
- package/dist/esm2022/src/map/map-plate/layers/feature-layer/feature-layer.component.mjs +3 -3
- package/dist/esm2022/src/map/map-plate/layers/image-layer/image-layer.component.mjs +3 -3
- package/dist/esm2022/src/map/map-plate/layers/osm-tile-layer/osm-tile-layer.component.mjs +14 -4
- package/dist/esm2022/src/map/map-plate/layers/raster-tile/raster-tile-layer.component.mjs +3 -3
- package/dist/esm2022/src/map/map-plate/layers/tile-layer/tile-layer.component.mjs +3 -3
- package/dist/esm2022/src/map/map-plate/map-plate.component.mjs +9 -10
- package/dist/esm2022/src/map/map-plate/tooltips/tooltip/tooltip.component.mjs +6 -4
- package/dist/esm2022/src/map/messages/executors/generate-zoom-control.executor.mjs +1 -1
- package/dist/esm2022/src/map/models/map-settings.mjs +14 -1
- package/dist/esm2022/src/map/public-api.mjs +1 -2
- package/dist/fesm2022/maps-components-src-map.mjs +395 -426
- package/dist/fesm2022/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2022/maps-components.mjs +395 -426
- package/dist/fesm2022/maps-components.mjs.map +1 -1
- package/dist/map/common/destructible.component.d.ts +1 -1
- package/dist/map/map-plate/controls/map-control-zoom/map-control-zoom.component.d.ts +1 -1
- package/dist/map/map-plate/features/markers/markers.component.d.ts +1 -1
- package/dist/map/map-plate/features/polygons/polygons.component.d.ts +1 -1
- package/dist/map/map-plate/layers/cluster-layer/cluster-layer.component.d.ts +1 -1
- package/dist/map/map-plate/layers/feature-layer/feature-layer.component.d.ts +1 -1
- package/dist/map/map-plate/layers/image-layer/image-layer.component.d.ts +1 -1
- package/dist/map/map-plate/layers/osm-tile-layer/osm-tile-layer.component.d.ts +4 -2
- package/dist/map/map-plate/layers/raster-tile/raster-tile-layer.component.d.ts +1 -1
- package/dist/map/map-plate/layers/tile-layer/tile-layer.component.d.ts +1 -1
- package/dist/map/map-plate/map-plate.component.d.ts +3 -2
- package/dist/map/map-plate/tooltips/tooltip/tooltip.component.d.ts +3 -2
- package/dist/map/messages/executors/generate-zoom-control.executor.d.ts +2 -2
- package/dist/map/models/map-settings.d.ts +8 -0
- package/dist/map/public-api.d.ts +0 -1
- package/dist/src/map/common/destructible.component.d.ts +1 -1
- package/dist/src/map/map-plate/controls/map-control-zoom/map-control-zoom.component.d.ts +1 -1
- package/dist/src/map/map-plate/features/markers/markers.component.d.ts +1 -1
- package/dist/src/map/map-plate/features/polygons/polygons.component.d.ts +1 -1
- package/dist/src/map/map-plate/layers/cluster-layer/cluster-layer.component.d.ts +1 -1
- package/dist/src/map/map-plate/layers/feature-layer/feature-layer.component.d.ts +1 -1
- package/dist/src/map/map-plate/layers/image-layer/image-layer.component.d.ts +1 -1
- package/dist/src/map/map-plate/layers/osm-tile-layer/osm-tile-layer.component.d.ts +4 -2
- package/dist/src/map/map-plate/layers/raster-tile/raster-tile-layer.component.d.ts +1 -1
- package/dist/src/map/map-plate/layers/tile-layer/tile-layer.component.d.ts +1 -1
- package/dist/src/map/map-plate/map-plate.component.d.ts +3 -2
- package/dist/src/map/map-plate/tooltips/tooltip/tooltip.component.d.ts +3 -2
- package/dist/src/map/messages/executors/generate-zoom-control.executor.d.ts +2 -2
- package/dist/src/map/models/map-settings.d.ts +8 -0
- package/dist/src/map/public-api.d.ts +0 -1
- package/package.json +12 -6
- package/dist/esm2022/map/map.module.mjs +0 -73
- package/dist/esm2022/src/map/map.module.mjs +0 -73
- package/dist/map/map.module.d.ts +0 -19
- package/dist/src/map/map.module.d.ts +0 -19
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Injectable, ChangeDetectionStrategy, Input, ViewEncapsulation, ViewChild, NgModule } from '@angular/core';
|
|
3
|
-
import * as i4 from '@angular/common';
|
|
4
|
-
import { CommonModule } from '@angular/common';
|
|
5
1
|
import { Feature, Collection } from 'ol';
|
|
6
2
|
export { Feature } from 'ol';
|
|
7
3
|
import { Point, LineString } from 'ol/geom';
|
|
@@ -10,6 +6,8 @@ import { GeoJSON, WKT } from 'ol/format';
|
|
|
10
6
|
import { getCenter, createEmpty, extend } from 'ol/extent';
|
|
11
7
|
import Polygon, { circular, fromExtent } from 'ol/geom/Polygon';
|
|
12
8
|
import { Control, Zoom } from 'ol/control';
|
|
9
|
+
import * as i0 from '@angular/core';
|
|
10
|
+
import { Component, Injectable, ChangeDetectionStrategy, Input, input, ViewEncapsulation, ViewChild } from '@angular/core';
|
|
13
11
|
import { get, useGeographic, transform } from 'ol/proj';
|
|
14
12
|
import { PostboyGenericMessage, PostboyCallbackMessage, PostboyExecutor, PostboyService, PostboyAbstractRegistrator } from '@artstesh/postboy';
|
|
15
13
|
import * as Sphere from 'ol/sphere';
|
|
@@ -28,32 +26,17 @@ import Cluster from 'ol/source/Cluster';
|
|
|
28
26
|
import Static from 'ol/source/ImageStatic';
|
|
29
27
|
import ImageLayer from 'ol/layer/Image';
|
|
30
28
|
import RasterSource from 'ol/source/Raster';
|
|
29
|
+
import { NgTemplateOutlet, NgIf } from '@angular/common';
|
|
31
30
|
import Map from 'ol/Map';
|
|
32
31
|
import View from 'ol/View';
|
|
33
|
-
import Overlay from 'ol/Overlay';
|
|
34
32
|
import Style from 'ol/style/Style';
|
|
35
33
|
import { Icon, Circle as Circle$1, Fill, Stroke, Text } from 'ol/style';
|
|
36
34
|
export { Fill, RegularShape, Stroke, Style, Text } from 'ol/style';
|
|
37
35
|
import { METERS_PER_UNIT } from 'ol/proj/epsg4326';
|
|
36
|
+
import Overlay from 'ol/Overlay';
|
|
38
37
|
import * as Circle from 'ol/style/Circle';
|
|
39
38
|
export { Circle as CircleStyle };
|
|
40
39
|
|
|
41
|
-
class DestructibleComponent {
|
|
42
|
-
subs = [];
|
|
43
|
-
onDestroy;
|
|
44
|
-
ngOnDestroy() {
|
|
45
|
-
this.subs.forEach((s) => s.unsubscribe());
|
|
46
|
-
if (this.onDestroy)
|
|
47
|
-
this.onDestroy();
|
|
48
|
-
}
|
|
49
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: DestructibleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
50
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: DestructibleComponent, selector: "ng-component", ngImport: i0, template: '', isInline: true });
|
|
51
|
-
}
|
|
52
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: DestructibleComponent, decorators: [{
|
|
53
|
-
type: Component,
|
|
54
|
-
args: [{ template: '' }]
|
|
55
|
-
}] });
|
|
56
|
-
|
|
57
40
|
var MapLyrs;
|
|
58
41
|
(function (MapLyrs) {
|
|
59
42
|
MapLyrs[MapLyrs["Hybrid"] = 1] = "Hybrid";
|
|
@@ -84,6 +67,7 @@ class MapSettings {
|
|
|
84
67
|
zoom = 4;
|
|
85
68
|
lyrs = MapLyrs.Hybrid;
|
|
86
69
|
language = 'en';
|
|
70
|
+
osmOpacity = 1;
|
|
87
71
|
interactionSettings = {};
|
|
88
72
|
static copy(model) {
|
|
89
73
|
const result = new MapSettings();
|
|
@@ -94,6 +78,7 @@ class MapSettings {
|
|
|
94
78
|
result.lyrs = model.lyrs;
|
|
95
79
|
result.interactionSettings = model.interactionSettings;
|
|
96
80
|
result.language = model.language;
|
|
81
|
+
result.osmOpacity = model.osmOpacity;
|
|
97
82
|
return result;
|
|
98
83
|
}
|
|
99
84
|
/**
|
|
@@ -160,6 +145,15 @@ class MapSettings {
|
|
|
160
145
|
setLanguage(language) {
|
|
161
146
|
return MapSettings.copy({ ...this, language });
|
|
162
147
|
}
|
|
148
|
+
/**
|
|
149
|
+
* Sets the opacity level for the OpenStreetMap layer.
|
|
150
|
+
*
|
|
151
|
+
* @param {number} osmOpacity - The opacity value for the OpenStreetMap layer, where 0 is fully transparent and 1 is fully opaque.
|
|
152
|
+
* @return {MapSettings} A new MapSettings instance with the updated OpenStreetMap opacity.
|
|
153
|
+
*/
|
|
154
|
+
setOsmOpacity(osmOpacity) {
|
|
155
|
+
return MapSettings.copy({ ...this, osmOpacity });
|
|
156
|
+
}
|
|
163
157
|
/**
|
|
164
158
|
* Compares the current MapSettings instance with another to determine if they are identical.
|
|
165
159
|
*
|
|
@@ -179,6 +173,8 @@ class MapSettings {
|
|
|
179
173
|
return false;
|
|
180
174
|
if (this.interactionSettings !== model.interactionSettings)
|
|
181
175
|
return false;
|
|
176
|
+
if (this.osmOpacity !== model.osmOpacity)
|
|
177
|
+
return false;
|
|
182
178
|
return this.center.length === model.center.length && !this.center.filter((c, i) => c !== model.center[i]).length;
|
|
183
179
|
}
|
|
184
180
|
}
|
|
@@ -313,6 +309,25 @@ class MapControl extends Control {
|
|
|
313
309
|
}
|
|
314
310
|
}
|
|
315
311
|
|
|
312
|
+
class DestructibleComponent {
|
|
313
|
+
subs = [];
|
|
314
|
+
onDestroy;
|
|
315
|
+
ngOnDestroy() {
|
|
316
|
+
this.subs.forEach((s) => s.unsubscribe());
|
|
317
|
+
if (this.onDestroy)
|
|
318
|
+
this.onDestroy();
|
|
319
|
+
}
|
|
320
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: DestructibleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
321
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: DestructibleComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: '', isInline: true });
|
|
322
|
+
}
|
|
323
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: DestructibleComponent, decorators: [{
|
|
324
|
+
type: Component,
|
|
325
|
+
args: [{
|
|
326
|
+
standalone: true,
|
|
327
|
+
template: '',
|
|
328
|
+
}]
|
|
329
|
+
}] });
|
|
330
|
+
|
|
316
331
|
/**
|
|
317
332
|
* Represents a command to add a custom control to a map.
|
|
318
333
|
*/
|
|
@@ -1776,11 +1791,11 @@ class TileLayerComponent extends DestructibleComponent {
|
|
|
1776
1791
|
this.postboy.fire(new RemoveTileCommand(this.layer));
|
|
1777
1792
|
}
|
|
1778
1793
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: TileLayerComponent, deps: [{ token: MapPostboyService }, { token: TileLayerFactory }], target: i0.ɵɵFactoryTarget.Component });
|
|
1779
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: TileLayerComponent, selector: "art-tile-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1794
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: TileLayerComponent, isStandalone: true, selector: "art-tile-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1780
1795
|
}
|
|
1781
1796
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: TileLayerComponent, decorators: [{
|
|
1782
1797
|
type: Component,
|
|
1783
|
-
args: [{ selector: 'art-tile-layer', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
1798
|
+
args: [{ selector: 'art-tile-layer', standalone: true, template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
1784
1799
|
}], ctorParameters: () => [{ type: MapPostboyService }, { type: TileLayerFactory }], propDecorators: { settings: [{
|
|
1785
1800
|
type: Input
|
|
1786
1801
|
}] } });
|
|
@@ -1791,13 +1806,20 @@ class OsmTileLayerComponent extends DestructibleComponent {
|
|
|
1791
1806
|
super();
|
|
1792
1807
|
}
|
|
1793
1808
|
_url = '';
|
|
1809
|
+
_map;
|
|
1810
|
+
_opacity = 1;
|
|
1794
1811
|
set url(value) {
|
|
1795
1812
|
if (!value || this._url === value)
|
|
1796
1813
|
return;
|
|
1797
1814
|
this._url = value;
|
|
1798
1815
|
this.initLayer();
|
|
1799
1816
|
}
|
|
1800
|
-
|
|
1817
|
+
set opacity(value) {
|
|
1818
|
+
if (!value || this._opacity === value)
|
|
1819
|
+
return;
|
|
1820
|
+
this._opacity = value;
|
|
1821
|
+
this.initLayer();
|
|
1822
|
+
}
|
|
1801
1823
|
set map(value) {
|
|
1802
1824
|
if (!value || this._map === value)
|
|
1803
1825
|
return;
|
|
@@ -1821,18 +1843,21 @@ class OsmTileLayerComponent extends DestructibleComponent {
|
|
|
1821
1843
|
source: new OSM({
|
|
1822
1844
|
url: this._url,
|
|
1823
1845
|
}),
|
|
1846
|
+
opacity: this._opacity,
|
|
1824
1847
|
});
|
|
1825
1848
|
this.layer.set('name', 'osm-tile-layer');
|
|
1826
1849
|
this._map.addLayer(this.layer);
|
|
1827
1850
|
}
|
|
1828
1851
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: OsmTileLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1829
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: OsmTileLayerComponent, selector: "art-osm-tile-layer", inputs: { url: "url", map: "map" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1852
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: OsmTileLayerComponent, isStandalone: true, selector: "art-osm-tile-layer", inputs: { url: "url", opacity: "opacity", map: "map" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1830
1853
|
}
|
|
1831
1854
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: OsmTileLayerComponent, decorators: [{
|
|
1832
1855
|
type: Component,
|
|
1833
|
-
args: [{ selector: 'art-osm-tile-layer', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
1856
|
+
args: [{ selector: 'art-osm-tile-layer', standalone: true, template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
1834
1857
|
}], ctorParameters: () => [], propDecorators: { url: [{
|
|
1835
1858
|
type: Input
|
|
1859
|
+
}], opacity: [{
|
|
1860
|
+
type: Input
|
|
1836
1861
|
}], map: [{
|
|
1837
1862
|
type: Input
|
|
1838
1863
|
}] } });
|
|
@@ -2032,11 +2057,11 @@ class FeatureLayerComponent extends DestructibleComponent {
|
|
|
2032
2057
|
this.postboy.fire(new RemoveLayerCommand(this.layer));
|
|
2033
2058
|
}
|
|
2034
2059
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: FeatureLayerComponent, deps: [{ token: MapPostboyService }, { token: FeatureLayerFactory }], target: i0.ɵɵFactoryTarget.Component });
|
|
2035
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: FeatureLayerComponent, selector: "art-feature-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2060
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: FeatureLayerComponent, isStandalone: true, selector: "art-feature-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2036
2061
|
}
|
|
2037
2062
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: FeatureLayerComponent, decorators: [{
|
|
2038
2063
|
type: Component,
|
|
2039
|
-
args: [{ selector: 'art-feature-layer', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
2064
|
+
args: [{ selector: 'art-feature-layer', standalone: true, template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
2040
2065
|
}], ctorParameters: () => [{ type: MapPostboyService }, { type: FeatureLayerFactory }], propDecorators: { settings: [{
|
|
2041
2066
|
type: Input
|
|
2042
2067
|
}] } });
|
|
@@ -2309,11 +2334,11 @@ class ClusterLayerComponent extends DestructibleComponent {
|
|
|
2309
2334
|
this.postboy.fire(new RemoveLayerCommand(this.manager.layer));
|
|
2310
2335
|
}
|
|
2311
2336
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ClusterLayerComponent, deps: [{ token: MapPostboyService }, { token: ClusterLayerFactory }], target: i0.ɵɵFactoryTarget.Component });
|
|
2312
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: ClusterLayerComponent, selector: "art-cluster-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2337
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: ClusterLayerComponent, isStandalone: true, selector: "art-cluster-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2313
2338
|
}
|
|
2314
2339
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ClusterLayerComponent, decorators: [{
|
|
2315
2340
|
type: Component,
|
|
2316
|
-
args: [{ selector: 'art-cluster-layer', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
2341
|
+
args: [{ selector: 'art-cluster-layer', standalone: true, template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
2317
2342
|
}], ctorParameters: () => [{ type: MapPostboyService }, { type: ClusterLayerFactory }], propDecorators: { settings: [{
|
|
2318
2343
|
type: Input
|
|
2319
2344
|
}] } });
|
|
@@ -2506,11 +2531,11 @@ class ImageLayerComponent extends DestructibleComponent {
|
|
|
2506
2531
|
this.postboy.fire(new RemoveImageLayerCommand(this.layer));
|
|
2507
2532
|
}
|
|
2508
2533
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ImageLayerComponent, deps: [{ token: MapPostboyService }, { token: ImageLayerFactory }], target: i0.ɵɵFactoryTarget.Component });
|
|
2509
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: ImageLayerComponent, selector: "art-image-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2534
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: ImageLayerComponent, isStandalone: true, selector: "art-image-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2510
2535
|
}
|
|
2511
2536
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ImageLayerComponent, decorators: [{
|
|
2512
2537
|
type: Component,
|
|
2513
|
-
args: [{ selector: 'art-image-layer', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
2538
|
+
args: [{ selector: 'art-image-layer', standalone: true, template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
2514
2539
|
}], ctorParameters: () => [{ type: MapPostboyService }, { type: ImageLayerFactory }], propDecorators: { settings: [{
|
|
2515
2540
|
type: Input
|
|
2516
2541
|
}] } });
|
|
@@ -2781,11 +2806,11 @@ class RasterTileLayerComponent extends DestructibleComponent {
|
|
|
2781
2806
|
this.postboy.fire(new RemoveRasterTileCommand(this.layer));
|
|
2782
2807
|
}
|
|
2783
2808
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: RasterTileLayerComponent, deps: [{ token: MapPostboyService }, { token: RasterTileLayerFactory }], target: i0.ɵɵFactoryTarget.Component });
|
|
2784
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: RasterTileLayerComponent, selector: "art-raster-tile-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2809
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: RasterTileLayerComponent, isStandalone: true, selector: "art-raster-tile-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2785
2810
|
}
|
|
2786
2811
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: RasterTileLayerComponent, decorators: [{
|
|
2787
2812
|
type: Component,
|
|
2788
|
-
args: [{ selector: 'art-raster-tile-layer', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
2813
|
+
args: [{ selector: 'art-raster-tile-layer', standalone: true, template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
2789
2814
|
}], ctorParameters: () => [{ type: MapPostboyService }, { type: RasterTileLayerFactory }], propDecorators: { settings: [{
|
|
2790
2815
|
type: Input
|
|
2791
2816
|
}] } });
|
|
@@ -2820,6 +2845,7 @@ class MapPlateComponent extends DestructibleComponent {
|
|
|
2820
2845
|
mapFactory;
|
|
2821
2846
|
registrator;
|
|
2822
2847
|
detector;
|
|
2848
|
+
contentRef = input(null);
|
|
2823
2849
|
renderTryCount = 0;
|
|
2824
2850
|
map;
|
|
2825
2851
|
osmUrl = '';
|
|
@@ -2879,7 +2905,7 @@ class MapPlateComponent extends DestructibleComponent {
|
|
|
2879
2905
|
this.map.updateSize();
|
|
2880
2906
|
}
|
|
2881
2907
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapPlateComponent, deps: [{ token: i0.ElementRef }, { token: MapPostboyService }, { token: MapPlateFactory }, { token: MessageRegistratorService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2882
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
2908
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.7", type: MapPlateComponent, isStandalone: true, selector: "art-map-plate", inputs: { contentRef: { classPropertyName: "contentRef", publicName: "contentRef", isSignal: true, isRequired: false, transformFunction: null }, settings: { classPropertyName: "settings", publicName: "settings", isSignal: false, isRequired: false, transformFunction: null } }, providers: [
|
|
2883
2909
|
MessageRegistratorService,
|
|
2884
2910
|
MapStateService,
|
|
2885
2911
|
MapManagementService,
|
|
@@ -2890,11 +2916,11 @@ class MapPlateComponent extends DestructibleComponent {
|
|
|
2890
2916
|
FeatureService,
|
|
2891
2917
|
FeatureModificationService,
|
|
2892
2918
|
ControlsService,
|
|
2893
|
-
], usesInheritance: true, ngImport: i0, template: "<ng-
|
|
2919
|
+
], usesInheritance: true, ngImport: i0, template: "<ng-container *ngTemplateOutlet=\"contentRef()\"> </ng-container>\r\n<art-osm-tile-layer *ngIf=\"osmUrl && map\" [map]=\"map\" [url]=\"osmUrl\" [opacity]=\"_settings.osmOpacity\"></art-osm-tile-layer>\r\n<art-feature-layer *ngIf=\"map\" [settings]=\"drawingLayerSettings\"></art-feature-layer>\r\n", styles: ["art-map-plate{display:block;width:100%;height:100%}\n"], dependencies: [{ kind: "component", type: OsmTileLayerComponent, selector: "art-osm-tile-layer", inputs: ["url", "opacity", "map"] }, { kind: "component", type: FeatureLayerComponent, selector: "art-feature-layer", inputs: ["settings"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
2894
2920
|
}
|
|
2895
2921
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapPlateComponent, decorators: [{
|
|
2896
2922
|
type: Component,
|
|
2897
|
-
args: [{ selector: 'art-map-plate', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
2923
|
+
args: [{ selector: 'art-map-plate', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
2898
2924
|
MessageRegistratorService,
|
|
2899
2925
|
MapStateService,
|
|
2900
2926
|
MapManagementService,
|
|
@@ -2905,7 +2931,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImpor
|
|
|
2905
2931
|
FeatureService,
|
|
2906
2932
|
FeatureModificationService,
|
|
2907
2933
|
ControlsService,
|
|
2908
|
-
], encapsulation: ViewEncapsulation.None, template: "<ng-
|
|
2934
|
+
], encapsulation: ViewEncapsulation.None, imports: [OsmTileLayerComponent, FeatureLayerComponent, NgTemplateOutlet, NgIf], template: "<ng-container *ngTemplateOutlet=\"contentRef()\"> </ng-container>\r\n<art-osm-tile-layer *ngIf=\"osmUrl && map\" [map]=\"map\" [url]=\"osmUrl\" [opacity]=\"_settings.osmOpacity\"></art-osm-tile-layer>\r\n<art-feature-layer *ngIf=\"map\" [settings]=\"drawingLayerSettings\"></art-feature-layer>\r\n", styles: ["art-map-plate{display:block;width:100%;height:100%}\n"] }]
|
|
2909
2935
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: MapPostboyService }, { type: MapPlateFactory }, { type: MessageRegistratorService }, { type: i0.ChangeDetectorRef }], propDecorators: { settings: [{
|
|
2910
2936
|
type: Input
|
|
2911
2937
|
}] } });
|
|
@@ -2944,119 +2970,17 @@ class MarkersComponent extends DestructibleComponent {
|
|
|
2944
2970
|
this.postboy.fire(new PlaceLayerFeaturesCommand(this.layerName, this._markers.map((m) => m.feature)));
|
|
2945
2971
|
}
|
|
2946
2972
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MarkersComponent, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2947
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: MarkersComponent, selector: "art-markers", inputs: { layerName: "layerName", markers: "markers" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2973
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: MarkersComponent, isStandalone: true, selector: "art-markers", inputs: { layerName: "layerName", markers: "markers" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2948
2974
|
}
|
|
2949
2975
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MarkersComponent, decorators: [{
|
|
2950
2976
|
type: Component,
|
|
2951
|
-
args: [{ selector: 'art-markers', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
2977
|
+
args: [{ selector: 'art-markers', standalone: true, template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
2952
2978
|
}], ctorParameters: () => [{ type: MapPostboyService }], propDecorators: { layerName: [{
|
|
2953
2979
|
type: Input
|
|
2954
2980
|
}], markers: [{
|
|
2955
2981
|
type: Input
|
|
2956
2982
|
}] } });
|
|
2957
2983
|
|
|
2958
|
-
class TooltipSettings {
|
|
2959
|
-
id;
|
|
2960
|
-
containerClass = 'custom-tooltip-class';
|
|
2961
|
-
constructor(id) {
|
|
2962
|
-
this.id = id ?? IdGenerator.get();
|
|
2963
|
-
}
|
|
2964
|
-
static copy(model) {
|
|
2965
|
-
const result = new TooltipSettings(model.id);
|
|
2966
|
-
result.show = model.show;
|
|
2967
|
-
result.containerClass = model.containerClass;
|
|
2968
|
-
return result;
|
|
2969
|
-
}
|
|
2970
|
-
show = (e) => true;
|
|
2971
|
-
setShow(show) {
|
|
2972
|
-
return TooltipSettings.copy({ ...this, show });
|
|
2973
|
-
}
|
|
2974
|
-
setClass(containerClass) {
|
|
2975
|
-
return TooltipSettings.copy({ ...this, containerClass });
|
|
2976
|
-
}
|
|
2977
|
-
isSame(model) {
|
|
2978
|
-
if (this.show !== model.show)
|
|
2979
|
-
return false;
|
|
2980
|
-
if (this.containerClass !== model.containerClass)
|
|
2981
|
-
return false;
|
|
2982
|
-
if (this.id !== model.id)
|
|
2983
|
-
return false;
|
|
2984
|
-
return true;
|
|
2985
|
-
}
|
|
2986
|
-
}
|
|
2987
|
-
|
|
2988
|
-
class TooltipComponent extends DestructibleComponent {
|
|
2989
|
-
postboy;
|
|
2990
|
-
detector;
|
|
2991
|
-
container;
|
|
2992
|
-
overlay;
|
|
2993
|
-
show = false;
|
|
2994
|
-
map;
|
|
2995
|
-
constructor(postboy, detector) {
|
|
2996
|
-
super();
|
|
2997
|
-
this.postboy = postboy;
|
|
2998
|
-
this.detector = detector;
|
|
2999
|
-
}
|
|
3000
|
-
_settings = new TooltipSettings();
|
|
3001
|
-
set settings(value) {
|
|
3002
|
-
if (!value || this._settings.isSame(value))
|
|
3003
|
-
return;
|
|
3004
|
-
this._settings = value;
|
|
3005
|
-
this.detector.detectChanges();
|
|
3006
|
-
}
|
|
3007
|
-
ngOnInit() {
|
|
3008
|
-
this.subs.push(this.observeMapRender());
|
|
3009
|
-
this.subs.push(this.observeMapClick());
|
|
3010
|
-
this.subs.push(this.observeClose());
|
|
3011
|
-
}
|
|
3012
|
-
addOverlay(coordinates) {
|
|
3013
|
-
this.removeOverlay();
|
|
3014
|
-
this.overlay = new Overlay(this.options(coordinates));
|
|
3015
|
-
this.map?.addOverlay(this.overlay);
|
|
3016
|
-
this.show = true;
|
|
3017
|
-
this.detector.detectChanges();
|
|
3018
|
-
}
|
|
3019
|
-
options = (coordinates) => {
|
|
3020
|
-
return {
|
|
3021
|
-
element: this.container?.nativeElement,
|
|
3022
|
-
autoPan: false,
|
|
3023
|
-
autoPanAnimation: { duration: 0 },
|
|
3024
|
-
position: coordinates,
|
|
3025
|
-
};
|
|
3026
|
-
};
|
|
3027
|
-
observeMapClick() {
|
|
3028
|
-
return this.postboy.sub(MapClickEvent).subscribe((ev) => {
|
|
3029
|
-
this._settings.show(ev) ? this.addOverlay(ev.coordinates) : this.removeOverlay();
|
|
3030
|
-
});
|
|
3031
|
-
}
|
|
3032
|
-
observeClose() {
|
|
3033
|
-
return this.postboy
|
|
3034
|
-
.sub(CloseTooltipCommand)
|
|
3035
|
-
.pipe(filter((ev) => ev.tooltipId === this._settings.id))
|
|
3036
|
-
.subscribe(() => this.removeOverlay());
|
|
3037
|
-
}
|
|
3038
|
-
observeMapRender() {
|
|
3039
|
-
return this.postboy.sub(MapRenderedEvent).subscribe((m) => {
|
|
3040
|
-
this.map = m.map;
|
|
3041
|
-
});
|
|
3042
|
-
}
|
|
3043
|
-
removeOverlay = () => {
|
|
3044
|
-
!!this.overlay && this.map?.removeOverlay(this.overlay);
|
|
3045
|
-
this.show = false;
|
|
3046
|
-
};
|
|
3047
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: TooltipComponent, deps: [{ token: MapPostboyService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3048
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", 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 });
|
|
3049
|
-
}
|
|
3050
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: TooltipComponent, decorators: [{
|
|
3051
|
-
type: Component,
|
|
3052
|
-
args: [{ selector: 'art-tooltip', changeDetection: ChangeDetectionStrategy.OnPush, 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"] }]
|
|
3053
|
-
}], ctorParameters: () => [{ type: MapPostboyService }, { type: i0.ChangeDetectorRef }], propDecorators: { container: [{
|
|
3054
|
-
type: ViewChild,
|
|
3055
|
-
args: ['tip']
|
|
3056
|
-
}], settings: [{
|
|
3057
|
-
type: Input
|
|
3058
|
-
}] } });
|
|
3059
|
-
|
|
3060
2984
|
/**
|
|
3061
2985
|
* Component for rendering polygons on a map.
|
|
3062
2986
|
* It listens for changes in the `polygons` input property and
|
|
@@ -3094,11 +3018,11 @@ class PolygonsComponent extends DestructibleComponent {
|
|
|
3094
3018
|
})));
|
|
3095
3019
|
}
|
|
3096
3020
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: PolygonsComponent, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3097
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: PolygonsComponent, selector: "art-polygons", inputs: { layerName: "layerName", polygons: "polygons" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3021
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: PolygonsComponent, isStandalone: true, selector: "art-polygons", inputs: { layerName: "layerName", polygons: "polygons" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3098
3022
|
}
|
|
3099
3023
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: PolygonsComponent, decorators: [{
|
|
3100
3024
|
type: Component,
|
|
3101
|
-
args: [{ selector: 'art-polygons', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
3025
|
+
args: [{ selector: 'art-polygons', standalone: true, template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
3102
3026
|
}], ctorParameters: () => [{ type: MapPostboyService }], propDecorators: { layerName: [{
|
|
3103
3027
|
type: Input
|
|
3104
3028
|
}], polygons: [{
|
|
@@ -3106,64 +3030,256 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImpor
|
|
|
3106
3030
|
}] } });
|
|
3107
3031
|
|
|
3108
3032
|
/**
|
|
3109
|
-
*
|
|
3033
|
+
* Helper class to create and modify marker styles.
|
|
3110
3034
|
*/
|
|
3111
|
-
class
|
|
3112
|
-
/**
|
|
3113
|
-
* The CSS class name of the control element.
|
|
3114
|
-
*
|
|
3115
|
-
* @type {string}
|
|
3116
|
-
*/
|
|
3117
|
-
controlClass = 'ol-zoom';
|
|
3118
|
-
/**
|
|
3119
|
-
* The CSS class name for zoom in button.
|
|
3120
|
-
* @type {string}
|
|
3121
|
-
*/
|
|
3122
|
-
zoomInClass = 'ol-zoom-in';
|
|
3035
|
+
class MarkerStyleHelper {
|
|
3123
3036
|
/**
|
|
3124
|
-
*
|
|
3125
|
-
*
|
|
3126
|
-
* @
|
|
3037
|
+
* Creates a new Style object from an SVG.
|
|
3038
|
+
* @param {string} svg - The SVG string.
|
|
3039
|
+
* @param {Array<number>} [size=[30, 30]] - The size of the icon image.
|
|
3040
|
+
* @param {number} [zIndex=400] - The zIndex of the style.
|
|
3041
|
+
* @returns {Style} A new Style object.
|
|
3127
3042
|
*/
|
|
3128
|
-
|
|
3043
|
+
static fromSvg(svg, size = [30, 30], zIndex = 400) {
|
|
3044
|
+
let image = new Image();
|
|
3045
|
+
image.src = 'data:image/svg+xml,' + escape(svg);
|
|
3046
|
+
return new Style({
|
|
3047
|
+
image: new Icon({
|
|
3048
|
+
img: image,
|
|
3049
|
+
imgSize: size,
|
|
3050
|
+
}),
|
|
3051
|
+
zIndex,
|
|
3052
|
+
});
|
|
3053
|
+
}
|
|
3129
3054
|
/**
|
|
3130
|
-
*
|
|
3055
|
+
* Returns a Style object with a circle style.
|
|
3131
3056
|
*
|
|
3132
|
-
* @
|
|
3057
|
+
* @param {number} radius - The radius of the circle.
|
|
3058
|
+
* @param {string} fill - The fill color of the circle. Format: '#RRGGBB' or 'rgba(R, G, B, A)'.
|
|
3059
|
+
* @param {string} strokeColor - The stroke color of the circle. Format: '#RRGGBB' or 'rgba(R, G, B, A)'.
|
|
3060
|
+
* @param {number} [strokeWidth=1] - The width of the stroke. Default is 1.
|
|
3061
|
+
* @returns {Style} - A Style object with a Circle image.
|
|
3133
3062
|
*/
|
|
3134
|
-
|
|
3063
|
+
static circle(radius, fill, strokeColor, strokeWidth = 1) {
|
|
3064
|
+
return new Style({
|
|
3065
|
+
image: new Circle$1({
|
|
3066
|
+
radius,
|
|
3067
|
+
fill: new Fill({ color: fill }),
|
|
3068
|
+
stroke: new Stroke({ color: strokeColor, width: strokeWidth }),
|
|
3069
|
+
}),
|
|
3070
|
+
});
|
|
3071
|
+
}
|
|
3135
3072
|
/**
|
|
3136
|
-
*
|
|
3073
|
+
* Applies the given Text to the provided Style.
|
|
3137
3074
|
*
|
|
3138
|
-
* @
|
|
3075
|
+
* @param {Style} style - The Style to modify.
|
|
3076
|
+
* @param {Text} text - The Text to apply to the Style.
|
|
3077
|
+
* @return {Style} - The modified Style with the applied Text.
|
|
3139
3078
|
*/
|
|
3140
|
-
|
|
3079
|
+
static withText(style, text) {
|
|
3080
|
+
style.setText(text);
|
|
3081
|
+
return style;
|
|
3082
|
+
}
|
|
3083
|
+
}
|
|
3084
|
+
|
|
3085
|
+
/**
|
|
3086
|
+
* A helper class for creating polygon styles.
|
|
3087
|
+
* @class
|
|
3088
|
+
*/
|
|
3089
|
+
class PolygonStyleHelper {
|
|
3141
3090
|
/**
|
|
3142
|
-
*
|
|
3091
|
+
* Creates a Style object with the given fill color, stroke color, and stroke width.
|
|
3143
3092
|
*
|
|
3144
|
-
* @param {
|
|
3145
|
-
* @
|
|
3093
|
+
* @param {string} fill - The fill color in hexadecimal or RGB format.
|
|
3094
|
+
* @param {string} stroke - The stroke color in hexadecimal or RGB format.
|
|
3095
|
+
* @param {number} [strokeWidth=1] - The width of the stroke. Defaults to 1.
|
|
3096
|
+
* @return {Style} The created Style object.
|
|
3146
3097
|
*/
|
|
3147
|
-
static
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3098
|
+
static simple(fill, stroke, strokeWidth = 1) {
|
|
3099
|
+
return new Style({
|
|
3100
|
+
fill: new Fill({
|
|
3101
|
+
color: fill,
|
|
3102
|
+
}),
|
|
3103
|
+
stroke: new Stroke({
|
|
3104
|
+
color: stroke,
|
|
3105
|
+
width: strokeWidth,
|
|
3106
|
+
}),
|
|
3107
|
+
});
|
|
3155
3108
|
}
|
|
3156
3109
|
/**
|
|
3157
|
-
*
|
|
3158
|
-
*
|
|
3159
|
-
* @param {ZoomControlSettings} model - The ZoomControlSettings object to compare with.
|
|
3110
|
+
* Creates a new Style object with the given fill, stroke, stroke width, and pin radius.
|
|
3160
3111
|
*
|
|
3161
|
-
* @
|
|
3112
|
+
* @param {string} fill - The color to use for the fill of the style.
|
|
3113
|
+
* @param {string} stroke - The color to use for the stroke of the style.
|
|
3114
|
+
* @param {number} [strokeWidth=1] - The width of the stroke. Defaults to 1.
|
|
3115
|
+
* @param {number} [pinRadius=5] - The radius of the circle used as the image for the style. Defaults to 5.
|
|
3116
|
+
* @returns {Style} - The newly created Style object.
|
|
3162
3117
|
*/
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3118
|
+
static edit(fill, stroke, strokeWidth = 1, pinRadius = 5) {
|
|
3119
|
+
return new Style({
|
|
3120
|
+
image: new Circle$1({
|
|
3121
|
+
fill: new Fill({
|
|
3122
|
+
color: stroke,
|
|
3123
|
+
}),
|
|
3124
|
+
radius: pinRadius,
|
|
3125
|
+
}),
|
|
3126
|
+
fill: new Fill({
|
|
3127
|
+
color: fill,
|
|
3128
|
+
}),
|
|
3129
|
+
stroke: new Stroke({
|
|
3130
|
+
color: stroke,
|
|
3131
|
+
width: strokeWidth,
|
|
3132
|
+
}),
|
|
3133
|
+
});
|
|
3134
|
+
}
|
|
3135
|
+
}
|
|
3136
|
+
|
|
3137
|
+
/**
|
|
3138
|
+
* Helper class for creating text styles.
|
|
3139
|
+
*/
|
|
3140
|
+
class TextStyleHelper {
|
|
3141
|
+
/**
|
|
3142
|
+
* Creates and returns a new Text instance with specified styling properties.
|
|
3143
|
+
*
|
|
3144
|
+
* @param {string} text - The text content to display.
|
|
3145
|
+
* @param {string} font - The font style to use for the text.
|
|
3146
|
+
* @param {string} color - The color of the text.
|
|
3147
|
+
* @param {string|null|undefined} [backColor] - The background color of the text. Optional.
|
|
3148
|
+
* @param {number[]|null|undefined} [padding] - The padding around the text in pixels. Optional.
|
|
3149
|
+
* @param {string|null|undefined} [textBaseline] - The text baseline alignment. Optional.
|
|
3150
|
+
* @param {number|null|undefined} [offsetY] - The vertical offset for the text. Optional.
|
|
3151
|
+
* @return {Text} A new Text instance configured with the specified properties.
|
|
3152
|
+
*/
|
|
3153
|
+
static get(text, font, color, backColor, padding, textBaseline, offsetY) {
|
|
3154
|
+
return new Text({
|
|
3155
|
+
text: text,
|
|
3156
|
+
font: font,
|
|
3157
|
+
textAlign: 'center',
|
|
3158
|
+
fill: new Fill({
|
|
3159
|
+
color: color,
|
|
3160
|
+
}),
|
|
3161
|
+
backgroundFill: backColor ? new Fill({ color: backColor }) : undefined,
|
|
3162
|
+
padding: padding ?? undefined,
|
|
3163
|
+
textBaseline: textBaseline ?? undefined,
|
|
3164
|
+
offsetY: offsetY ?? undefined,
|
|
3165
|
+
});
|
|
3166
|
+
}
|
|
3167
|
+
}
|
|
3168
|
+
|
|
3169
|
+
/**
|
|
3170
|
+
* A helper class for converting and stringify features.
|
|
3171
|
+
*/
|
|
3172
|
+
class StringifyFeatureHelper {
|
|
3173
|
+
static polygon(feature, format = FeatureOutputFormat.GeoJson) {
|
|
3174
|
+
return format === FeatureOutputFormat.GeoJson
|
|
3175
|
+
? new GeoJSON().writeFeature(feature)
|
|
3176
|
+
: new WKT().writeFeature(feature);
|
|
3177
|
+
}
|
|
3178
|
+
/**
|
|
3179
|
+
* Creates a polygon feature representing a circle based on a given feature with a circle geometry.
|
|
3180
|
+
*
|
|
3181
|
+
* @param {Feature<Geometry>} feature - The input feature with a circle geometry.
|
|
3182
|
+
* @param {FeatureOutputFormat} format - The format for outputting the polygon feature. (default: FeatureOutputFormat.GeoJson)
|
|
3183
|
+
*
|
|
3184
|
+
* @return {string} - The string representation of the polygon feature.
|
|
3185
|
+
*/
|
|
3186
|
+
static circle(feature, format = FeatureOutputFormat.GeoJson) {
|
|
3187
|
+
const circle = feature.getGeometry();
|
|
3188
|
+
const ext = feature.getGeometry().getExtent();
|
|
3189
|
+
const coords = [
|
|
3190
|
+
...transform([ext[0], ext[1]], 'EPSG:4326', 'EPSG:3857'),
|
|
3191
|
+
...transform([ext[2], ext[3]], 'EPSG:4326', 'EPSG:3857'),
|
|
3192
|
+
];
|
|
3193
|
+
const radius = (coords[2] - coords[0]) / 2;
|
|
3194
|
+
const polygonGeom = new Polygon(StringifyFeatureHelper.drawCircle(circle.getCenter(), radius));
|
|
3195
|
+
return StringifyFeatureHelper.polygon(new Feature(polygonGeom), format);
|
|
3196
|
+
}
|
|
3197
|
+
/**
|
|
3198
|
+
* Draw a circle based on a center point and radius.
|
|
3199
|
+
*
|
|
3200
|
+
* @param {number[]} point - The center point coordinates in EPSG:4326 format.
|
|
3201
|
+
* @param {number} radius - The radius of the circle in meters.
|
|
3202
|
+
* @return {Coordinate[][]} - The coordinates of the circle boundary in EPSG:4326 format.
|
|
3203
|
+
*/
|
|
3204
|
+
static drawCircle(point, radius) {
|
|
3205
|
+
const tetetemp = transform(point, 'EPSG:4326', 'EPSG:3857');
|
|
3206
|
+
// const tetetemp = point;
|
|
3207
|
+
const radians = Math.PI / 180; // degrees to radians
|
|
3208
|
+
const degrees = 180 / Math.PI; // radians to degrees
|
|
3209
|
+
const earthsradius = 6378137.0;
|
|
3210
|
+
const rlat = (radius / earthsradius) * degrees;
|
|
3211
|
+
const rlng = rlat / Math.cos(tetetemp[1] * radians);
|
|
3212
|
+
const extp = [];
|
|
3213
|
+
for (let i = 0; i <= 32; i++) {
|
|
3214
|
+
const theta = Math.PI * (i / 16);
|
|
3215
|
+
extp.push([
|
|
3216
|
+
tetetemp[0] + rlng * Math.cos(theta) * METERS_PER_UNIT,
|
|
3217
|
+
tetetemp[1] + rlat * Math.sin(theta) * METERS_PER_UNIT,
|
|
3218
|
+
]);
|
|
3219
|
+
}
|
|
3220
|
+
return [extp.map((e) => transform(e, 'EPSG:3857', 'EPSG:4326'))];
|
|
3221
|
+
}
|
|
3222
|
+
}
|
|
3223
|
+
|
|
3224
|
+
/**
|
|
3225
|
+
* Represents the settings for a zoom control.
|
|
3226
|
+
*/
|
|
3227
|
+
class ZoomControlSettings {
|
|
3228
|
+
/**
|
|
3229
|
+
* The CSS class name of the control element.
|
|
3230
|
+
*
|
|
3231
|
+
* @type {string}
|
|
3232
|
+
*/
|
|
3233
|
+
controlClass = 'ol-zoom';
|
|
3234
|
+
/**
|
|
3235
|
+
* The CSS class name for zoom in button.
|
|
3236
|
+
* @type {string}
|
|
3237
|
+
*/
|
|
3238
|
+
zoomInClass = 'ol-zoom-in';
|
|
3239
|
+
/**
|
|
3240
|
+
* The CSS class name for the zoom out button element.
|
|
3241
|
+
*
|
|
3242
|
+
* @type {string}
|
|
3243
|
+
*/
|
|
3244
|
+
zoomOutClass = 'ol-zoom-out';
|
|
3245
|
+
/**
|
|
3246
|
+
* The label for the zoom in action.
|
|
3247
|
+
*
|
|
3248
|
+
* @type {string}
|
|
3249
|
+
*/
|
|
3250
|
+
zoomInLabel = 'Zoom In';
|
|
3251
|
+
/**
|
|
3252
|
+
* The label for the zoom out control.
|
|
3253
|
+
*
|
|
3254
|
+
* @type {string}
|
|
3255
|
+
*/
|
|
3256
|
+
zoomOutLabel = 'Zoom Out';
|
|
3257
|
+
/**
|
|
3258
|
+
* Copies the provided ZoomControlSettings object.
|
|
3259
|
+
*
|
|
3260
|
+
* @param {ZoomControlSettings} model - The ZoomControlSettings object to be copied.
|
|
3261
|
+
* @return {ZoomControlSettings} - The copied ZoomControlSettings object.
|
|
3262
|
+
*/
|
|
3263
|
+
static copy(model) {
|
|
3264
|
+
const result = new ZoomControlSettings();
|
|
3265
|
+
result.controlClass = model.controlClass;
|
|
3266
|
+
result.zoomInClass = model.zoomInClass;
|
|
3267
|
+
result.zoomOutClass = model.zoomOutClass;
|
|
3268
|
+
result.zoomInLabel = model.zoomInLabel;
|
|
3269
|
+
result.zoomOutLabel = model.zoomOutLabel;
|
|
3270
|
+
return result;
|
|
3271
|
+
}
|
|
3272
|
+
/**
|
|
3273
|
+
* Checks if the current ZoomControlSettings object is equal to the given model.
|
|
3274
|
+
*
|
|
3275
|
+
* @param {ZoomControlSettings} model - The ZoomControlSettings object to compare with.
|
|
3276
|
+
*
|
|
3277
|
+
* @return {boolean} - true if the current object is equal to the given model, false otherwise.
|
|
3278
|
+
*/
|
|
3279
|
+
isSame(model) {
|
|
3280
|
+
if (this.zoomInClass !== model.zoomInClass)
|
|
3281
|
+
return false;
|
|
3282
|
+
if (this.zoomOutClass !== model.zoomOutClass)
|
|
3167
3283
|
return false;
|
|
3168
3284
|
if (this.zoomInLabel !== model.zoomInLabel)
|
|
3169
3285
|
return false;
|
|
@@ -3273,264 +3389,117 @@ class MapControlZoomComponent extends DestructibleComponent {
|
|
|
3273
3389
|
}
|
|
3274
3390
|
eliminate = () => !!this.map && !!this.control && this.map.removeControl(this.control);
|
|
3275
3391
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapControlZoomComponent, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3276
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: MapControlZoomComponent, selector: "art-map-control-zoom", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3392
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: MapControlZoomComponent, isStandalone: true, selector: "art-map-control-zoom", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3277
3393
|
}
|
|
3278
3394
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapControlZoomComponent, decorators: [{
|
|
3279
3395
|
type: Component,
|
|
3280
|
-
args: [{ selector: 'art-map-control-zoom', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
3396
|
+
args: [{ selector: 'art-map-control-zoom', standalone: true, template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
3281
3397
|
}], ctorParameters: () => [{ type: MapPostboyService }], propDecorators: { settings: [{
|
|
3282
3398
|
type: Input
|
|
3283
3399
|
}] } });
|
|
3284
3400
|
|
|
3285
|
-
class
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
OsmTileLayerComponent,
|
|
3291
|
-
FeatureLayerComponent,
|
|
3292
|
-
MarkersComponent,
|
|
3293
|
-
TooltipComponent,
|
|
3294
|
-
PolygonsComponent,
|
|
3295
|
-
ClusterLayerComponent,
|
|
3296
|
-
MapControlZoomComponent,
|
|
3297
|
-
ImageLayerComponent,
|
|
3298
|
-
RasterTileLayerComponent], imports: [CommonModule], exports: [MapPlateComponent,
|
|
3299
|
-
FeatureLayerComponent,
|
|
3300
|
-
MarkersComponent,
|
|
3301
|
-
TileLayerComponent,
|
|
3302
|
-
TooltipComponent,
|
|
3303
|
-
PolygonsComponent,
|
|
3304
|
-
ClusterLayerComponent,
|
|
3305
|
-
MapControlZoomComponent,
|
|
3306
|
-
ImageLayerComponent,
|
|
3307
|
-
RasterTileLayerComponent] });
|
|
3308
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapModule, imports: [CommonModule] });
|
|
3309
|
-
}
|
|
3310
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapModule, decorators: [{
|
|
3311
|
-
type: NgModule,
|
|
3312
|
-
args: [{
|
|
3313
|
-
imports: [CommonModule],
|
|
3314
|
-
declarations: [
|
|
3315
|
-
DestructibleComponent,
|
|
3316
|
-
MapPlateComponent,
|
|
3317
|
-
TileLayerComponent,
|
|
3318
|
-
OsmTileLayerComponent,
|
|
3319
|
-
FeatureLayerComponent,
|
|
3320
|
-
MarkersComponent,
|
|
3321
|
-
TooltipComponent,
|
|
3322
|
-
PolygonsComponent,
|
|
3323
|
-
ClusterLayerComponent,
|
|
3324
|
-
MapControlZoomComponent,
|
|
3325
|
-
ImageLayerComponent,
|
|
3326
|
-
RasterTileLayerComponent,
|
|
3327
|
-
],
|
|
3328
|
-
exports: [
|
|
3329
|
-
MapPlateComponent,
|
|
3330
|
-
FeatureLayerComponent,
|
|
3331
|
-
MarkersComponent,
|
|
3332
|
-
TileLayerComponent,
|
|
3333
|
-
TooltipComponent,
|
|
3334
|
-
PolygonsComponent,
|
|
3335
|
-
ClusterLayerComponent,
|
|
3336
|
-
MapControlZoomComponent,
|
|
3337
|
-
ImageLayerComponent,
|
|
3338
|
-
RasterTileLayerComponent,
|
|
3339
|
-
],
|
|
3340
|
-
}]
|
|
3341
|
-
}] });
|
|
3342
|
-
|
|
3343
|
-
/**
|
|
3344
|
-
* Helper class to create and modify marker styles.
|
|
3345
|
-
*/
|
|
3346
|
-
class MarkerStyleHelper {
|
|
3347
|
-
/**
|
|
3348
|
-
* Creates a new Style object from an SVG.
|
|
3349
|
-
* @param {string} svg - The SVG string.
|
|
3350
|
-
* @param {Array<number>} [size=[30, 30]] - The size of the icon image.
|
|
3351
|
-
* @param {number} [zIndex=400] - The zIndex of the style.
|
|
3352
|
-
* @returns {Style} A new Style object.
|
|
3353
|
-
*/
|
|
3354
|
-
static fromSvg(svg, size = [30, 30], zIndex = 400) {
|
|
3355
|
-
let image = new Image();
|
|
3356
|
-
image.src = 'data:image/svg+xml,' + escape(svg);
|
|
3357
|
-
return new Style({
|
|
3358
|
-
image: new Icon({
|
|
3359
|
-
img: image,
|
|
3360
|
-
imgSize: size,
|
|
3361
|
-
}),
|
|
3362
|
-
zIndex,
|
|
3363
|
-
});
|
|
3401
|
+
class TooltipSettings {
|
|
3402
|
+
id;
|
|
3403
|
+
containerClass = 'custom-tooltip-class';
|
|
3404
|
+
constructor(id) {
|
|
3405
|
+
this.id = id ?? IdGenerator.get();
|
|
3364
3406
|
}
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
* @param {string} strokeColor - The stroke color of the circle. Format: '#RRGGBB' or 'rgba(R, G, B, A)'.
|
|
3371
|
-
* @param {number} [strokeWidth=1] - The width of the stroke. Default is 1.
|
|
3372
|
-
* @returns {Style} - A Style object with a Circle image.
|
|
3373
|
-
*/
|
|
3374
|
-
static circle(radius, fill, strokeColor, strokeWidth = 1) {
|
|
3375
|
-
return new Style({
|
|
3376
|
-
image: new Circle$1({
|
|
3377
|
-
radius,
|
|
3378
|
-
fill: new Fill({ color: fill }),
|
|
3379
|
-
stroke: new Stroke({ color: strokeColor, width: strokeWidth }),
|
|
3380
|
-
}),
|
|
3381
|
-
});
|
|
3407
|
+
static copy(model) {
|
|
3408
|
+
const result = new TooltipSettings(model.id);
|
|
3409
|
+
result.show = model.show;
|
|
3410
|
+
result.containerClass = model.containerClass;
|
|
3411
|
+
return result;
|
|
3382
3412
|
}
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
* @param {Style} style - The Style to modify.
|
|
3387
|
-
* @param {Text} text - The Text to apply to the Style.
|
|
3388
|
-
* @return {Style} - The modified Style with the applied Text.
|
|
3389
|
-
*/
|
|
3390
|
-
static withText(style, text) {
|
|
3391
|
-
style.setText(text);
|
|
3392
|
-
return style;
|
|
3413
|
+
show = (e) => true;
|
|
3414
|
+
setShow(show) {
|
|
3415
|
+
return TooltipSettings.copy({ ...this, show });
|
|
3393
3416
|
}
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
/**
|
|
3397
|
-
* A helper class for creating polygon styles.
|
|
3398
|
-
* @class
|
|
3399
|
-
*/
|
|
3400
|
-
class PolygonStyleHelper {
|
|
3401
|
-
/**
|
|
3402
|
-
* Creates a Style object with the given fill color, stroke color, and stroke width.
|
|
3403
|
-
*
|
|
3404
|
-
* @param {string} fill - The fill color in hexadecimal or RGB format.
|
|
3405
|
-
* @param {string} stroke - The stroke color in hexadecimal or RGB format.
|
|
3406
|
-
* @param {number} [strokeWidth=1] - The width of the stroke. Defaults to 1.
|
|
3407
|
-
* @return {Style} The created Style object.
|
|
3408
|
-
*/
|
|
3409
|
-
static simple(fill, stroke, strokeWidth = 1) {
|
|
3410
|
-
return new Style({
|
|
3411
|
-
fill: new Fill({
|
|
3412
|
-
color: fill,
|
|
3413
|
-
}),
|
|
3414
|
-
stroke: new Stroke({
|
|
3415
|
-
color: stroke,
|
|
3416
|
-
width: strokeWidth,
|
|
3417
|
-
}),
|
|
3418
|
-
});
|
|
3417
|
+
setClass(containerClass) {
|
|
3418
|
+
return TooltipSettings.copy({ ...this, containerClass });
|
|
3419
3419
|
}
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
*/
|
|
3429
|
-
static edit(fill, stroke, strokeWidth = 1, pinRadius = 5) {
|
|
3430
|
-
return new Style({
|
|
3431
|
-
image: new Circle$1({
|
|
3432
|
-
fill: new Fill({
|
|
3433
|
-
color: stroke,
|
|
3434
|
-
}),
|
|
3435
|
-
radius: pinRadius,
|
|
3436
|
-
}),
|
|
3437
|
-
fill: new Fill({
|
|
3438
|
-
color: fill,
|
|
3439
|
-
}),
|
|
3440
|
-
stroke: new Stroke({
|
|
3441
|
-
color: stroke,
|
|
3442
|
-
width: strokeWidth,
|
|
3443
|
-
}),
|
|
3444
|
-
});
|
|
3420
|
+
isSame(model) {
|
|
3421
|
+
if (this.show !== model.show)
|
|
3422
|
+
return false;
|
|
3423
|
+
if (this.containerClass !== model.containerClass)
|
|
3424
|
+
return false;
|
|
3425
|
+
if (this.id !== model.id)
|
|
3426
|
+
return false;
|
|
3427
|
+
return true;
|
|
3445
3428
|
}
|
|
3446
3429
|
}
|
|
3447
3430
|
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
* @param {string|null|undefined} [textBaseline] - The text baseline alignment. Optional.
|
|
3461
|
-
* @param {number|null|undefined} [offsetY] - The vertical offset for the text. Optional.
|
|
3462
|
-
* @return {Text} A new Text instance configured with the specified properties.
|
|
3463
|
-
*/
|
|
3464
|
-
static get(text, font, color, backColor, padding, textBaseline, offsetY) {
|
|
3465
|
-
return new Text({
|
|
3466
|
-
text: text,
|
|
3467
|
-
font: font,
|
|
3468
|
-
textAlign: 'center',
|
|
3469
|
-
fill: new Fill({
|
|
3470
|
-
color: color,
|
|
3471
|
-
}),
|
|
3472
|
-
backgroundFill: backColor ? new Fill({ color: backColor }) : undefined,
|
|
3473
|
-
padding: padding ?? undefined,
|
|
3474
|
-
textBaseline: textBaseline ?? undefined,
|
|
3475
|
-
offsetY: offsetY ?? undefined,
|
|
3476
|
-
});
|
|
3431
|
+
class TooltipComponent extends DestructibleComponent {
|
|
3432
|
+
postboy;
|
|
3433
|
+
detector;
|
|
3434
|
+
contentRef = input(null, {});
|
|
3435
|
+
container;
|
|
3436
|
+
overlay;
|
|
3437
|
+
show = false;
|
|
3438
|
+
map;
|
|
3439
|
+
constructor(postboy, detector) {
|
|
3440
|
+
super();
|
|
3441
|
+
this.postboy = postboy;
|
|
3442
|
+
this.detector = detector;
|
|
3477
3443
|
}
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
static polygon(feature, format = FeatureOutputFormat.GeoJson) {
|
|
3485
|
-
return format === FeatureOutputFormat.GeoJson
|
|
3486
|
-
? new GeoJSON().writeFeature(feature)
|
|
3487
|
-
: new WKT().writeFeature(feature);
|
|
3444
|
+
_settings = new TooltipSettings();
|
|
3445
|
+
set settings(value) {
|
|
3446
|
+
if (!value || this._settings.isSame(value))
|
|
3447
|
+
return;
|
|
3448
|
+
this._settings = value;
|
|
3449
|
+
this.detector.detectChanges();
|
|
3488
3450
|
}
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
* @param {FeatureOutputFormat} format - The format for outputting the polygon feature. (default: FeatureOutputFormat.GeoJson)
|
|
3494
|
-
*
|
|
3495
|
-
* @return {string} - The string representation of the polygon feature.
|
|
3496
|
-
*/
|
|
3497
|
-
static circle(feature, format = FeatureOutputFormat.GeoJson) {
|
|
3498
|
-
const circle = feature.getGeometry();
|
|
3499
|
-
const ext = feature.getGeometry().getExtent();
|
|
3500
|
-
const coords = [
|
|
3501
|
-
...transform([ext[0], ext[1]], 'EPSG:4326', 'EPSG:3857'),
|
|
3502
|
-
...transform([ext[2], ext[3]], 'EPSG:4326', 'EPSG:3857'),
|
|
3503
|
-
];
|
|
3504
|
-
const radius = (coords[2] - coords[0]) / 2;
|
|
3505
|
-
const polygonGeom = new Polygon(StringifyFeatureHelper.drawCircle(circle.getCenter(), radius));
|
|
3506
|
-
return StringifyFeatureHelper.polygon(new Feature(polygonGeom), format);
|
|
3451
|
+
ngOnInit() {
|
|
3452
|
+
this.subs.push(this.observeMapRender());
|
|
3453
|
+
this.subs.push(this.observeMapClick());
|
|
3454
|
+
this.subs.push(this.observeClose());
|
|
3507
3455
|
}
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3456
|
+
addOverlay(coordinates) {
|
|
3457
|
+
this.removeOverlay();
|
|
3458
|
+
this.overlay = new Overlay(this.options(coordinates));
|
|
3459
|
+
this.map?.addOverlay(this.overlay);
|
|
3460
|
+
this.show = true;
|
|
3461
|
+
this.detector.detectChanges();
|
|
3462
|
+
}
|
|
3463
|
+
options = (coordinates) => {
|
|
3464
|
+
return {
|
|
3465
|
+
element: this.container?.nativeElement,
|
|
3466
|
+
autoPan: false,
|
|
3467
|
+
autoPanAnimation: { duration: 0 },
|
|
3468
|
+
position: coordinates,
|
|
3469
|
+
};
|
|
3470
|
+
};
|
|
3471
|
+
observeMapClick() {
|
|
3472
|
+
return this.postboy.sub(MapClickEvent).subscribe((ev) => {
|
|
3473
|
+
this._settings.show(ev) ? this.addOverlay(ev.coordinates) : this.removeOverlay();
|
|
3474
|
+
});
|
|
3475
|
+
}
|
|
3476
|
+
observeClose() {
|
|
3477
|
+
return this.postboy
|
|
3478
|
+
.sub(CloseTooltipCommand)
|
|
3479
|
+
.pipe(filter((ev) => ev.tooltipId === this._settings.id))
|
|
3480
|
+
.subscribe(() => this.removeOverlay());
|
|
3481
|
+
}
|
|
3482
|
+
observeMapRender() {
|
|
3483
|
+
return this.postboy.sub(MapRenderedEvent).subscribe((m) => {
|
|
3484
|
+
this.map = m.map;
|
|
3485
|
+
});
|
|
3532
3486
|
}
|
|
3487
|
+
removeOverlay = () => {
|
|
3488
|
+
!!this.overlay && this.map?.removeOverlay(this.overlay);
|
|
3489
|
+
this.show = false;
|
|
3490
|
+
};
|
|
3491
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: TooltipComponent, deps: [{ token: MapPostboyService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3492
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.7", type: TooltipComponent, isStandalone: true, selector: "art-tooltip", inputs: { contentRef: { classPropertyName: "contentRef", publicName: "contentRef", isSignal: true, isRequired: false, transformFunction: null }, settings: { classPropertyName: "settings", publicName: "settings", isSignal: false, isRequired: false, transformFunction: null } }, 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-container *ngTemplateOutlet=\"contentRef()\"> </ng-container>\r\n</div>\r\n", styles: [".tooltip-wrapper{position:absolute}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3533
3493
|
}
|
|
3494
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: TooltipComponent, decorators: [{
|
|
3495
|
+
type: Component,
|
|
3496
|
+
args: [{ selector: 'art-tooltip', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet], template: "<div #tip [class]=\"['tooltip-wrapper', _settings.containerClass]\" [hidden]=\"!show\">\r\n <ng-container *ngTemplateOutlet=\"contentRef()\"> </ng-container>\r\n</div>\r\n", styles: [".tooltip-wrapper{position:absolute}\n"] }]
|
|
3497
|
+
}], ctorParameters: () => [{ type: MapPostboyService }, { type: i0.ChangeDetectorRef }], propDecorators: { container: [{
|
|
3498
|
+
type: ViewChild,
|
|
3499
|
+
args: ['tip']
|
|
3500
|
+
}], settings: [{
|
|
3501
|
+
type: Input
|
|
3502
|
+
}] } });
|
|
3534
3503
|
|
|
3535
3504
|
/*
|
|
3536
3505
|
* Public API Surface of maps
|
|
@@ -3544,5 +3513,5 @@ class StringifyFeatureHelper {
|
|
|
3544
3513
|
* Generated bundle index. Do not edit.
|
|
3545
3514
|
*/
|
|
3546
3515
|
|
|
3547
|
-
export { AddControlCommand, CalculateAreaExecutor, CancelDrawingCommand, CancelFeatureModificationCommand, CloseTooltipCommand, ClusterLayerComponent, ClusterLayerSettings, DrawSelectionAreaCommand, DrawingType, FeatureLayerComponent, FeatureLayerSettings, FeatureOutputFormat, FilterFeaturesInAreaExecutor, FilterFeaturesInPointExecutor, FitToFeaturesCommand, FitToPolygonsCommand, GetFeaturesInAreaQuery, GetFeaturesInPointQuery, GetGeometryLengthExecutor, GetMapPositionExecutor, ImageLayerComponent, ImageLayerSettings, MapClickEvent, MapConstants, MapControl, MapControlZoomComponent, MapFeatureHoveredEvent, MapLyrs, MapLyrsLabel,
|
|
3516
|
+
export { AddControlCommand, CalculateAreaExecutor, CancelDrawingCommand, CancelFeatureModificationCommand, CloseTooltipCommand, ClusterLayerComponent, ClusterLayerSettings, DrawSelectionAreaCommand, DrawingType, FeatureLayerComponent, FeatureLayerSettings, FeatureOutputFormat, FilterFeaturesInAreaExecutor, FilterFeaturesInPointExecutor, FitToFeaturesCommand, FitToPolygonsCommand, GetFeaturesInAreaQuery, GetFeaturesInPointQuery, GetGeometryLengthExecutor, GetMapPositionExecutor, ImageLayerComponent, ImageLayerSettings, MapClickEvent, MapConstants, MapControl, MapControlZoomComponent, MapFeatureHoveredEvent, MapLyrs, MapLyrsLabel, MapMoveEndEvent, MapPlateComponent, MapPointerMoveEvent, MapPostboyService, MapRenderedEvent, MapSettings, MarkerModel, MarkerStyleHelper, MarkersComponent, MessageRegistratorService, ModifyFeatureCommand, OsmTileLayerComponent, PolygonModel, PolygonSelfIntersectionExecutor, PolygonStyleHelper, PolygonsComponent, RasterTileLayerComponent, RasterTileLayerSettings, RemoveControlCommand, SetMapCenterCommand, StartDrawingCommand, StringifyFeatureHelper, TextStyleHelper, TileLayerComponent, TileLayerSettings, TooltipComponent, TooltipSettings, ZoomControlSettings };
|
|
3548
3517
|
//# sourceMappingURL=maps-components.mjs.map
|