diff --git a/packages/cancelable-promise/src/PromiseControl.ts b/packages/cancelable-promise/src/PromiseControl.ts index 610dff743..0a8771e1d 100644 --- a/packages/cancelable-promise/src/PromiseControl.ts +++ b/packages/cancelable-promise/src/PromiseControl.ts @@ -50,7 +50,7 @@ export class PromiseControl { if (this.isLoaded) { this._promises.forEach((x) => { if (x.cancel) { - x.cancel(); + x.cancel() } }); this._promises.clear(); diff --git a/packages/vue-ngw-map/src/components/VueNgwMapNew.ts b/packages/vue-ngw-map/src/components/VueNgwMapNew.ts index 761a6b0c2..4ff5935a9 100644 --- a/packages/vue-ngw-map/src/components/VueNgwMapNew.ts +++ b/packages/vue-ngw-map/src/components/VueNgwMapNew.ts @@ -1,27 +1,8 @@ import Vue, { VNode, VNodeData, CreateElement } from 'vue'; -// import { Prop, Vue } from 'vue-property-decorator'; -// import Component from 'vue-class-component'; -import { MapAdapter } from '@nextgis/webmap'; -import { NgwMap, NgwMapOptions } from '@nextgis/ngw-map'; -import NgwConnector from '@nextgis/ngw-connector'; +import { NgwMap} from '@nextgis/ngw-map'; +import type { VueNgwMapData, VueNgwMapProps } from '../interfaces'; -export interface VueNgwMapData { - ngwMap: NgwMap; - ready: boolean; -} - -// interface Methods {} -// interface Computed {} -export interface VueNgwMapProps { - mapAdapter: MapAdapter; - fullFilling: boolean; - connector: NgwConnector; - baseUrl: string; - qmsId: string; - webMapId: string; - mapOptions: NgwMapOptions; -} export const VueNgwMap = Vue.extend({ props: { diff --git a/packages/vue-ngw-map/src/index.ts b/packages/vue-ngw-map/src/index.ts index 53db7ca1f..386e50a11 100644 --- a/packages/vue-ngw-map/src/index.ts +++ b/packages/vue-ngw-map/src/index.ts @@ -1,4 +1,4 @@ -import { VueNgwMapData, VueNgwMapProps } from './components/VueNgwMapNew'; +import type { VueNgwMapData, VueNgwMapProps } from './interfaces'; export type { VueNgwMapData, VueNgwMapProps }; diff --git a/packages/vue-ngw-map/src/interfaces.ts b/packages/vue-ngw-map/src/interfaces.ts new file mode 100644 index 000000000..97fe55c57 --- /dev/null +++ b/packages/vue-ngw-map/src/interfaces.ts @@ -0,0 +1,21 @@ +import { MapAdapter } from '@nextgis/webmap'; +import { NgwMap, NgwMapOptions } from '@nextgis/ngw-map'; + +import NgwConnector from '@nextgis/ngw-connector'; + +export interface VueNgwMapData { + ngwMap: NgwMap; + ready: boolean; +} + +// interface Methods {} +// interface Computed {} +export interface VueNgwMapProps { + mapAdapter: MapAdapter; + fullFilling: boolean; + connector: NgwConnector; + baseUrl: string; + qmsId: string; + webMapId: string; + mapOptions: NgwMapOptions; +} diff --git a/packages/webmap/src/WebMapLayers.ts b/packages/webmap/src/WebMapLayers.ts index 3d7e56928..660dbeb52 100644 --- a/packages/webmap/src/WebMapLayers.ts +++ b/packages/webmap/src/WebMapLayers.ts @@ -42,7 +42,7 @@ export class WebMapLayers< M = any, L = any, E extends WebMapEvents = WebMapEvents, - O extends MapOptions = MapOptions, + O extends MapOptions = MapOptions > extends WebMapMain { private _layersIdCounter = 1; private _layersOrderCounter = 1; @@ -169,7 +169,7 @@ export class WebMapLayers< */ async addBaseLayer< K extends keyof LayerAdapters, - O extends AdapterOptions = AdapterOptions, + O extends AdapterOptions = AdapterOptions >( adapter: K | Type, options?: O | LayerAdaptersOptions[K], @@ -202,7 +202,7 @@ export class WebMapLayers< */ async addLayer< K extends keyof LayerAdapters, - LO extends AdapterOptions = AdapterOptions, + LO extends AdapterOptions = AdapterOptions >( adapter: LayerAdapterDefinition, options: LO | LayerAdaptersOptions[K] = {}, @@ -333,7 +333,7 @@ export class WebMapLayers< async addLayerFromAsyncAdapter< K extends keyof LayerAdapters, - O extends AdapterOptions = AdapterOptions, + O extends AdapterOptions = AdapterOptions >( adapter: AdapterConstructor, options: O | LayerAdaptersOptions[K], @@ -447,7 +447,7 @@ export class WebMapLayers< */ addGeoJsonLayer< K extends keyof LayerAdapters = keyof LayerAdapters, - O extends GeoJsonAdapterOptions = GeoJsonAdapterOptions, + O extends GeoJsonAdapterOptions = GeoJsonAdapterOptions >( opt: O = {} as O, adapter?: LayerAdapterDefinition, @@ -471,7 +471,7 @@ export class WebMapLayers< G extends Geometry = Geometry, O extends GeoJsonAdapterOptions> = GeoJsonAdapterOptions< Feature - >, + > >(options = {} as O): Promise> { return this.addGeoJsonLayer<'GEOJSON', O>(options) as Promise< FeatureLayerAdapter @@ -554,14 +554,13 @@ export class WebMapLayers< // do not show baselayer if another on the map if (l.options.baselayer && this._baselayers.length) { - const anotherVisibleLayerBaseLayer = this._baselayers.find((x) => { + const anotherVisibleBaselayers = this._baselayers.filter((x) => { return x !== l.id && this.isLayerVisible(x); }); - if (anotherVisibleLayerBaseLayer) { - await this.hideLayer(anotherVisibleLayerBaseLayer); + for (const bl of anotherVisibleBaselayers) { + await this.hideLayer(bl); } } - if (l.showLayer) { l.showLayer.call(l, l.layer); } else if (l.layer !== undefined) {