From 4118555d368685685b21948aa4e71c5396604388 Mon Sep 17 00:00:00 2001 From: Alexander Artemev Date: Fri, 26 Apr 2024 23:38:24 +0700 Subject: [PATCH 1/2] Some fixes --- src/labelGroups.ts | 4 ++++ src/realtyScene/realtyScene.ts | 31 ++++++++++++++++++++++--------- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/labelGroups.ts b/src/labelGroups.ts index c5f9084..293f974 100644 --- a/src/labelGroups.ts +++ b/src/labelGroups.ts @@ -15,6 +15,10 @@ export const DEFAULT_IMAGE: LabelImage = { padding: [5, 10, 5, 10], }; +/** + * @hidden + * @internal + */ export class LabelGroups { private labelsByGroupId: Map = new Map(); diff --git a/src/realtyScene/realtyScene.ts b/src/realtyScene/realtyScene.ts index 0a8a625..f1b8477 100644 --- a/src/realtyScene/realtyScene.ts +++ b/src/realtyScene/realtyScene.ts @@ -103,12 +103,23 @@ export class RealtyScene { const prevModelOptions = prevState.buildingVisibility.get(buildingId); const newModelOptions = newState.buildingVisibility.get(buildingId); - // если опции не изменились, то ничего не делаем + // если опции не изменились, то выставляем только опции карты, если модель активна if ( prevModelOptions?.modelId === newModelOptions?.modelId && prevState.status === newState.status ) { buildingVisibility.set(buildingId, prevModelOptions); + + if (prevModelOptions && prevModelOptions.modelId === newState.activeModelId) { + const options = + this.buildings.get(prevModelOptions.modelId) ?? + this.floors.get(prevModelOptions.modelId); + + if (options) { + this.setMapOptions(options.mapOptions); + } + } + return; } @@ -230,14 +241,16 @@ export class RealtyScene { this.control.show({ buildingModelId: buildingOptions.modelId, activeModelId: newState.activeModelId, - floorLevels: [ - { - modelId: buildingOptions.modelId, - icon: 'building', - text: '', - }, - ...buildingOptions.floors, - ], + floorLevels: buildingOptions.floors.length + ? [ + { + modelId: buildingOptions.modelId, + icon: 'building', + text: '', + }, + ...buildingOptions.floors, + ] + : [], }); } } From dab8db014cbf6b554c800916e4b31e9973d74b1e Mon Sep 17 00:00:00 2001 From: Alexander Artemev Date: Sat, 27 Apr 2024 00:06:54 +0700 Subject: [PATCH 2/2] 2.0.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1ef0f36..472a266 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@2gis/mapgl-gltf", - "version": "2.0.0", + "version": "2.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@2gis/mapgl-gltf", - "version": "2.0.0", + "version": "2.0.1", "license": "BSD-2-Clause", "devDependencies": { "@2gis/mapgl": "^1.47.0", diff --git a/package.json b/package.json index 3910765..132e22a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@2gis/mapgl-gltf", - "version": "2.0.0", + "version": "2.0.1", "description": "Plugin for the rendering glTF models with MapGL", "main": "dist/bundle.js", "typings": "dist/types/index.d.ts",