@artstesh/maps 4.1.36 → 4.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/esm2020/map/map-plate/layers/osm-tile-layer/osm-tile-layer.component.mjs +12 -2
- package/dist/esm2020/map/map-plate/map-plate.component.mjs +3 -3
- package/dist/esm2020/map/messages/executors/generate-zoom-control.executor.mjs +1 -1
- package/dist/esm2020/map/models/map-settings.mjs +14 -1
- package/dist/esm2020/map/services/drawing/drawing.service.mjs +5 -2
- package/dist/esm2020/map/services/map-postboy.service.mjs +1 -9
- package/dist/esm2020/src/map/map-plate/layers/osm-tile-layer/osm-tile-layer.component.mjs +12 -2
- package/dist/esm2020/src/map/map-plate/map-plate.component.mjs +3 -3
- package/dist/esm2020/src/map/messages/executors/generate-zoom-control.executor.mjs +1 -1
- package/dist/esm2020/src/map/models/map-settings.mjs +14 -1
- package/dist/esm2020/src/map/services/drawing/drawing.service.mjs +5 -2
- package/dist/esm2020/src/map/services/map-postboy.service.mjs +1 -9
- package/dist/fesm2015/maps-components-src-map.mjs +29 -9
- package/dist/fesm2015/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2015/maps-components.mjs +29 -9
- package/dist/fesm2015/maps-components.mjs.map +1 -1
- package/dist/fesm2020/maps-components-src-map.mjs +29 -9
- package/dist/fesm2020/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2020/maps-components.mjs +29 -9
- package/dist/fesm2020/maps-components.mjs.map +1 -1
- package/dist/map/map-plate/layers/osm-tile-layer/osm-tile-layer.component.d.ts +4 -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/package.json +1 -1
- package/dist/src/map/map-plate/layers/osm-tile-layer/osm-tile-layer.component.d.ts +4 -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/package.json +13 -3
|
@@ -11,7 +11,7 @@ import { getCenter, createEmpty, extend } from 'ol/extent';
|
|
|
11
11
|
import Polygon, { circular, fromExtent } from 'ol/geom/Polygon';
|
|
12
12
|
import { Control, Zoom } from 'ol/control';
|
|
13
13
|
import { get, useGeographic, transform } from 'ol/proj';
|
|
14
|
-
import { PostboyGenericMessage, PostboyCallbackMessage, PostboyExecutor, PostboyService, PostboyAbstractRegistrator } from '@artstesh/postboy';
|
|
14
|
+
import { PostboyGenericMessage, PostboyCallbackMessage, PostboyExecutor, PostboyService, LockMessage, UnlockMessage, PostboyAbstractRegistrator } from '@artstesh/postboy';
|
|
15
15
|
import * as Sphere from 'ol/sphere';
|
|
16
16
|
import { getLength } from 'ol/sphere';
|
|
17
17
|
import { Draw, Modify, Translate, defaults } from 'ol/interaction';
|
|
@@ -86,6 +86,7 @@ class MapSettings {
|
|
|
86
86
|
this.zoom = 4;
|
|
87
87
|
this.lyrs = MapLyrs.Hybrid;
|
|
88
88
|
this.language = 'en';
|
|
89
|
+
this.osmOpacity = 1;
|
|
89
90
|
this.interactionSettings = {};
|
|
90
91
|
}
|
|
91
92
|
static copy(model) {
|
|
@@ -97,6 +98,7 @@ class MapSettings {
|
|
|
97
98
|
result.lyrs = model.lyrs;
|
|
98
99
|
result.interactionSettings = model.interactionSettings;
|
|
99
100
|
result.language = model.language;
|
|
101
|
+
result.osmOpacity = model.osmOpacity;
|
|
100
102
|
return result;
|
|
101
103
|
}
|
|
102
104
|
/**
|
|
@@ -163,6 +165,15 @@ class MapSettings {
|
|
|
163
165
|
setLanguage(language) {
|
|
164
166
|
return MapSettings.copy({ ...this, language });
|
|
165
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* Sets the opacity level for the OpenStreetMap layer.
|
|
170
|
+
*
|
|
171
|
+
* @param {number} osmOpacity - The opacity value for the OpenStreetMap layer, where 0 is fully transparent and 1 is fully opaque.
|
|
172
|
+
* @return {MapSettings} A new MapSettings instance with the updated OpenStreetMap opacity.
|
|
173
|
+
*/
|
|
174
|
+
setOsmOpacity(osmOpacity) {
|
|
175
|
+
return MapSettings.copy({ ...this, osmOpacity });
|
|
176
|
+
}
|
|
166
177
|
/**
|
|
167
178
|
* Compares the current MapSettings instance with another to determine if they are identical.
|
|
168
179
|
*
|
|
@@ -182,6 +193,8 @@ class MapSettings {
|
|
|
182
193
|
return false;
|
|
183
194
|
if (this.interactionSettings !== model.interactionSettings)
|
|
184
195
|
return false;
|
|
196
|
+
if (this.osmOpacity !== model.osmOpacity)
|
|
197
|
+
return false;
|
|
185
198
|
return this.center.length === model.center.length && !this.center.filter((c, i) => c !== model.center[i]).length;
|
|
186
199
|
}
|
|
187
200
|
}
|
|
@@ -924,11 +937,6 @@ RemoveRasterTileCommand.ID = 'd1c4bf6a-e2f2-4385-a7a2-cecb525f8939';
|
|
|
924
937
|
class MapPostboyService extends PostboyService {
|
|
925
938
|
constructor() {
|
|
926
939
|
super();
|
|
927
|
-
this.addLocker({
|
|
928
|
-
locker: StartDrawingCommand.ID,
|
|
929
|
-
unlocker: DrawingFinishedEvent.ID,
|
|
930
|
-
locking: [MapClickEvent.ID],
|
|
931
|
-
});
|
|
932
940
|
}
|
|
933
941
|
}
|
|
934
942
|
MapPostboyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MapPostboyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -1234,6 +1242,7 @@ class DrawingService {
|
|
|
1234
1242
|
}
|
|
1235
1243
|
observeDrawing() {
|
|
1236
1244
|
this.postboy.sub(StartDrawingCommand).subscribe((ev) => {
|
|
1245
|
+
this.postboy.exec(new LockMessage(MapClickEvent));
|
|
1237
1246
|
this.draw((l) => {
|
|
1238
1247
|
if (!l || !this.map) {
|
|
1239
1248
|
this.clearInteraction(l);
|
|
@@ -1279,6 +1288,7 @@ class DrawingService {
|
|
|
1279
1288
|
this.map?.removeInteraction(this.drawInteraction);
|
|
1280
1289
|
layer?.setSource(new Vector({}));
|
|
1281
1290
|
}
|
|
1291
|
+
this.postboy.exec(new UnlockMessage(MapClickEvent));
|
|
1282
1292
|
setTimeout(() => this.postboy.fire(new DrawingFinishedEvent()), 300);
|
|
1283
1293
|
}
|
|
1284
1294
|
}
|
|
@@ -1708,6 +1718,7 @@ class OsmTileLayerComponent extends DestructibleComponent {
|
|
|
1708
1718
|
constructor() {
|
|
1709
1719
|
super();
|
|
1710
1720
|
this._url = '';
|
|
1721
|
+
this._opacity = 1;
|
|
1711
1722
|
}
|
|
1712
1723
|
set url(value) {
|
|
1713
1724
|
if (!value || this._url === value)
|
|
@@ -1715,6 +1726,12 @@ class OsmTileLayerComponent extends DestructibleComponent {
|
|
|
1715
1726
|
this._url = value;
|
|
1716
1727
|
this.initLayer();
|
|
1717
1728
|
}
|
|
1729
|
+
set opacity(value) {
|
|
1730
|
+
if (!value || this._opacity === value)
|
|
1731
|
+
return;
|
|
1732
|
+
this._opacity = value;
|
|
1733
|
+
this.initLayer();
|
|
1734
|
+
}
|
|
1718
1735
|
set map(value) {
|
|
1719
1736
|
if (!value || this._map === value)
|
|
1720
1737
|
return;
|
|
@@ -1738,18 +1755,21 @@ class OsmTileLayerComponent extends DestructibleComponent {
|
|
|
1738
1755
|
source: new OSM({
|
|
1739
1756
|
url: this._url,
|
|
1740
1757
|
}),
|
|
1758
|
+
opacity: this._opacity,
|
|
1741
1759
|
});
|
|
1742
1760
|
this.layer.set('name', 'osm-tile-layer');
|
|
1743
1761
|
this._map.addLayer(this.layer);
|
|
1744
1762
|
}
|
|
1745
1763
|
}
|
|
1746
1764
|
OsmTileLayerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: OsmTileLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1747
|
-
OsmTileLayerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: OsmTileLayerComponent, selector: "art-osm-tile-layer", inputs: { url: "url", map: "map" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1765
|
+
OsmTileLayerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: OsmTileLayerComponent, selector: "art-osm-tile-layer", inputs: { url: "url", opacity: "opacity", map: "map" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1748
1766
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: OsmTileLayerComponent, decorators: [{
|
|
1749
1767
|
type: Component,
|
|
1750
1768
|
args: [{ selector: 'art-osm-tile-layer', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
1751
1769
|
}], ctorParameters: function () { return []; }, propDecorators: { url: [{
|
|
1752
1770
|
type: Input
|
|
1771
|
+
}], opacity: [{
|
|
1772
|
+
type: Input
|
|
1753
1773
|
}], map: [{
|
|
1754
1774
|
type: Input
|
|
1755
1775
|
}] } });
|
|
@@ -2777,7 +2797,7 @@ MapPlateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
|
|
|
2777
2797
|
FeatureService,
|
|
2778
2798
|
FeatureModificationService,
|
|
2779
2799
|
ControlsService,
|
|
2780
|
-
], usesInheritance: true, ngImport: i0, template: "<ng-content></ng-content>\r\n<art-osm-tile-layer *ngIf=\"osmUrl && map\" [map]=\"map\" [url]=\"osmUrl\"></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: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: OsmTileLayerComponent, selector: "art-osm-tile-layer", inputs: ["url", "map"] }, { kind: "component", type: FeatureLayerComponent, selector: "art-feature-layer", inputs: ["settings"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
2800
|
+
], usesInheritance: true, ngImport: i0, template: "<ng-content></ng-content>\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: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: OsmTileLayerComponent, selector: "art-osm-tile-layer", inputs: ["url", "opacity", "map"] }, { kind: "component", type: FeatureLayerComponent, selector: "art-feature-layer", inputs: ["settings"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
2781
2801
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MapPlateComponent, decorators: [{
|
|
2782
2802
|
type: Component,
|
|
2783
2803
|
args: [{ selector: 'art-map-plate', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
@@ -2791,7 +2811,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2791
2811
|
FeatureService,
|
|
2792
2812
|
FeatureModificationService,
|
|
2793
2813
|
ControlsService,
|
|
2794
|
-
], encapsulation: ViewEncapsulation.None, template: "<ng-content></ng-content>\r\n<art-osm-tile-layer *ngIf=\"osmUrl && map\" [map]=\"map\" [url]=\"osmUrl\"></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"] }]
|
|
2814
|
+
], encapsulation: ViewEncapsulation.None, template: "<ng-content></ng-content>\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"] }]
|
|
2795
2815
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: MapPostboyService }, { type: MapPlateFactory }, { type: MessageRegistratorService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { settings: [{
|
|
2796
2816
|
type: Input
|
|
2797
2817
|
}] } });
|