Skip to content

Commit

Permalink
Some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alxart committed Apr 26, 2024
1 parent e234579 commit 4118555
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
4 changes: 4 additions & 0 deletions src/labelGroups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export const DEFAULT_IMAGE: LabelImage = {
padding: [5, 10, 5, 10],
};

/**
* @hidden
* @internal
*/
export class LabelGroups {
private labelsByGroupId: Map<string, Label[]> = new Map();

Expand Down
31 changes: 22 additions & 9 deletions src/realtyScene/realtyScene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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,
]
: [],
});
}
}
Expand Down

0 comments on commit 4118555

Please sign in to comment.