diff --git a/packages/ngw-kit/src/WebMapLayerItem.ts b/packages/ngw-kit/src/WebMapLayerItem.ts index 64ac4f1b4..8da245b8d 100644 --- a/packages/ngw-kit/src/WebMapLayerItem.ts +++ b/packages/ngw-kit/src/WebMapLayerItem.ts @@ -101,9 +101,11 @@ export class WebMapLayerItem extends Item { ...item, headers: this.options.headers }; - if (this.options.order && this.options.drawOrderEnabled) { - const subOrder = this._rootDescendantsCount - item.draw_order_position; - options.order = this.options.order + subOrder * 0.1; + if (this.options.order) { + const subOrder = this.options.drawOrderEnabled + ? this._rootDescendantsCount - item.draw_order_position + : this.id; + options.order = Number((this.options.order | 0) + '.' + subOrder); } newLayer = await this.webMap.addLayer(adapter, options); } diff --git a/packages/vuetify-ngw-components/src/components/NgwLayersList/NgwLayersList.ts b/packages/vuetify-ngw-components/src/components/NgwLayersList/NgwLayersList.ts index f15f3ebd5..df2ad48de 100644 --- a/packages/vuetify-ngw-components/src/components/NgwLayersList/NgwLayersList.ts +++ b/packages/vuetify-ngw-components/src/components/NgwLayersList/NgwLayersList.ts @@ -59,7 +59,6 @@ export class NgwLayersList extends Vue { @Watch('ngwMap') updateNgwMap() { - console.log(1234); this.destroy(); this.create(); } @@ -198,9 +197,7 @@ export class NgwLayersList extends Vue { if ( item.children && this.hideWebmapRoot && - webMapLayer.layer && - webMapLayer.layer.item && - webMapLayer.layer.item.item_type === 'root' + webMapLayer.layer?.item.item_type === 'root' ) { item.children.reverse().forEach(x => this.items.push(x)); webMapLayer.layer && webMapLayer.layer.properties.set('visibility', true); diff --git a/packages/webmap/src/WebMapLayers.ts b/packages/webmap/src/WebMapLayers.ts index 82cae0769..4b74287e6 100644 --- a/packages/webmap/src/WebMapLayers.ts +++ b/packages/webmap/src/WebMapLayers.ts @@ -35,7 +35,7 @@ export class WebMapLayers< E extends WebMapEvents = WebMapEvents > extends BaseWebMap { private _layersIds = 1; - private _layersOrders = 0; + private _layersOrders = 1; private readonly _baseLayers: string[] = []; private readonly _layers: { [id: string]: LayerAdapter } = {}; private readonly _selectedLayers: string[] = [];