@artstesh/maps 9.0.5 → 9.1.0-alpha.1
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/fesm2022/maps-components-src-map.mjs +28 -24
- package/dist/fesm2022/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2022/maps-components.mjs +28 -24
- package/dist/fesm2022/maps-components.mjs.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/src/map/index.d.ts +5 -4
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ import { getCenter, createEmpty, extend } from 'ol/extent';
|
|
|
7
7
|
import Polygon, { circular, fromExtent } from 'ol/geom/Polygon';
|
|
8
8
|
import { Control, Zoom } from 'ol/control';
|
|
9
9
|
import * as i0 from '@angular/core';
|
|
10
|
-
import { Component, Injectable, Input, ChangeDetectionStrategy, input, ViewEncapsulation, ViewChild } from '@angular/core';
|
|
10
|
+
import { Component, Injectable, Input, ChangeDetectionStrategy, input, signal, ViewEncapsulation, ViewChild } from '@angular/core';
|
|
11
11
|
import { get, useGeographic, transform } from 'ol/proj';
|
|
12
12
|
import { PostboyGenericMessage, PostboyCallbackMessage, PostboyExecutor, PostboyService, LockMessage, UnlockMessage, PostboyAbstractRegistrator } from '@artstesh/postboy';
|
|
13
13
|
import * as Sphere from 'ol/sphere';
|
|
@@ -27,7 +27,7 @@ import Static from 'ol/source/ImageStatic';
|
|
|
27
27
|
import ImageLayer from 'ol/layer/Image';
|
|
28
28
|
import RasterSource from 'ol/source/Raster';
|
|
29
29
|
import TileLayer$1 from 'ol/layer/WebGLTile';
|
|
30
|
-
import {
|
|
30
|
+
import { NgTemplateOutlet, NgIf } from '@angular/common';
|
|
31
31
|
import Map from 'ol/Map';
|
|
32
32
|
import View from 'ol/View';
|
|
33
33
|
import Style from 'ol/style/Style';
|
|
@@ -3076,18 +3076,20 @@ class MapPlateComponent extends DestructibleComponent {
|
|
|
3076
3076
|
mapFactory;
|
|
3077
3077
|
registrator;
|
|
3078
3078
|
detector;
|
|
3079
|
+
ngZone;
|
|
3079
3080
|
contentRef = input.required(...(ngDevMode ? [{ debugName: "contentRef" }] : []));
|
|
3080
3081
|
renderTryCount = 0;
|
|
3081
|
-
map;
|
|
3082
|
-
osmUrl = '';
|
|
3082
|
+
map = signal(null, ...(ngDevMode ? [{ debugName: "map" }] : []));
|
|
3083
|
+
osmUrl = signal('', ...(ngDevMode ? [{ debugName: "osmUrl" }] : []));
|
|
3083
3084
|
drawingLayerSettings = new FeatureLayerSettings().setName(MapConstants.DrawingLayerId);
|
|
3084
|
-
constructor(elementRef, postboy, mapFactory, registrator, detector) {
|
|
3085
|
+
constructor(elementRef, postboy, mapFactory, registrator, detector, ngZone) {
|
|
3085
3086
|
super();
|
|
3086
3087
|
this.elementRef = elementRef;
|
|
3087
3088
|
this.postboy = postboy;
|
|
3088
3089
|
this.mapFactory = mapFactory;
|
|
3089
3090
|
this.registrator = registrator;
|
|
3090
3091
|
this.detector = detector;
|
|
3092
|
+
this.ngZone = ngZone;
|
|
3091
3093
|
registrator.up();
|
|
3092
3094
|
}
|
|
3093
3095
|
_settings = new MapSettings();
|
|
@@ -3098,18 +3100,20 @@ class MapPlateComponent extends DestructibleComponent {
|
|
|
3098
3100
|
this.setOsm();
|
|
3099
3101
|
}
|
|
3100
3102
|
initializeMap() {
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
this.map
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
this.
|
|
3103
|
+
this.ngZone.runOutsideAngular(() => {
|
|
3104
|
+
useGeographic();
|
|
3105
|
+
this.map.set(this.mapFactory.build(this._settings));
|
|
3106
|
+
this.map()?.setTarget(this.elementRef.nativeElement);
|
|
3107
|
+
this.detector.detectChanges();
|
|
3108
|
+
this.map()?.once('postrender', () => {
|
|
3109
|
+
this.map()?.updateSize();
|
|
3110
|
+
this.postboy.fire(new MapRenderedEvent(this.map()));
|
|
3111
|
+
});
|
|
3112
|
+
this.map()?.on('pointermove', (ev) => {
|
|
3113
|
+
this.postboy.fire(new MapPointerMoveEvent(ev.pixel));
|
|
3114
|
+
});
|
|
3115
|
+
this.setOsm();
|
|
3111
3116
|
});
|
|
3112
|
-
this.setOsm();
|
|
3113
3117
|
}
|
|
3114
3118
|
ngAfterViewInit() {
|
|
3115
3119
|
const mapContainer = this.elementRef.nativeElement;
|
|
@@ -3129,14 +3133,14 @@ class MapPlateComponent extends DestructibleComponent {
|
|
|
3129
3133
|
this.registrator.down();
|
|
3130
3134
|
};
|
|
3131
3135
|
setOsm() {
|
|
3132
|
-
if (!this.map)
|
|
3136
|
+
if (!this.map())
|
|
3133
3137
|
return;
|
|
3134
|
-
this.osmUrl
|
|
3138
|
+
this.osmUrl.set(`https://mt{0-3}.google.com/vt/lyrs=${MapLyrsLabel.get(this._settings.lyrs)}&hl=${this._settings.language}&x={x}&y={y}&z={z}`);
|
|
3135
3139
|
this.detector.detectChanges();
|
|
3136
|
-
this.map
|
|
3140
|
+
this.map()?.updateSize();
|
|
3137
3141
|
}
|
|
3138
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MapPlateComponent, deps: [{ token: i0.ElementRef }, { token: MapPostboyService }, { token: MapPlateFactory }, { token: MessageRegistratorService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3139
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
3142
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MapPlateComponent, deps: [{ token: i0.ElementRef }, { token: MapPostboyService }, { token: MapPlateFactory }, { token: MessageRegistratorService }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
3143
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: MapPlateComponent, isStandalone: true, selector: "art-map-plate", inputs: { contentRef: { classPropertyName: "contentRef", publicName: "contentRef", isSignal: true, isRequired: true, transformFunction: null }, settings: { classPropertyName: "settings", publicName: "settings", isSignal: false, isRequired: false, transformFunction: null } }, providers: [
|
|
3140
3144
|
MessageRegistratorService,
|
|
3141
3145
|
MapStateService,
|
|
3142
3146
|
MapManagementService,
|
|
@@ -3147,7 +3151,7 @@ class MapPlateComponent extends DestructibleComponent {
|
|
|
3147
3151
|
FeatureService,
|
|
3148
3152
|
FeatureModificationService,
|
|
3149
3153
|
ControlsService,
|
|
3150
|
-
], usesInheritance: true, ngImport: i0, template: "<ng-container *ngTemplateOutlet=\"contentRef()\"> </ng-container>\r\n<art-osm-tile-layer
|
|
3154
|
+
], usesInheritance: true, ngImport: i0, template: "<ng-container *ngTemplateOutlet=\"contentRef()\"> </ng-container>\r\n@if (osmUrl() && map()) {\r\n <art-osm-tile-layer [map]=\"map()!\" [url]=\"osmUrl()\" [opacity]=\"_settings.osmOpacity\"></art-osm-tile-layer>\r\n}\r\n@if (map()) {\r\n <art-feature-layer [settings]=\"drawingLayerSettings\"></art-feature-layer>\r\n}\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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
3151
3155
|
}
|
|
3152
3156
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MapPlateComponent, decorators: [{
|
|
3153
3157
|
type: Component,
|
|
@@ -3162,8 +3166,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
3162
3166
|
FeatureService,
|
|
3163
3167
|
FeatureModificationService,
|
|
3164
3168
|
ControlsService,
|
|
3165
|
-
], encapsulation: ViewEncapsulation.None, imports: [OsmTileLayerComponent, FeatureLayerComponent, NgIf, NgTemplateOutlet], template: "<ng-container *ngTemplateOutlet=\"contentRef()\"> </ng-container>\r\n<art-osm-tile-layer
|
|
3166
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: MapPostboyService }, { type: MapPlateFactory }, { type: MessageRegistratorService }, { type: i0.ChangeDetectorRef }], propDecorators: { contentRef: [{ type: i0.Input, args: [{ isSignal: true, alias: "contentRef", required: true }] }], settings: [{
|
|
3169
|
+
], encapsulation: ViewEncapsulation.None, imports: [OsmTileLayerComponent, FeatureLayerComponent, NgIf, NgTemplateOutlet], template: "<ng-container *ngTemplateOutlet=\"contentRef()\"> </ng-container>\r\n@if (osmUrl() && map()) {\r\n <art-osm-tile-layer [map]=\"map()!\" [url]=\"osmUrl()\" [opacity]=\"_settings.osmOpacity\"></art-osm-tile-layer>\r\n}\r\n@if (map()) {\r\n <art-feature-layer [settings]=\"drawingLayerSettings\"></art-feature-layer>\r\n}\r\n", styles: ["art-map-plate{display:block;width:100%;height:100%}\n"] }]
|
|
3170
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: MapPostboyService }, { type: MapPlateFactory }, { type: MessageRegistratorService }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }], propDecorators: { contentRef: [{ type: i0.Input, args: [{ isSignal: true, alias: "contentRef", required: true }] }], settings: [{
|
|
3167
3171
|
type: Input
|
|
3168
3172
|
}] } });
|
|
3169
3173
|
|