Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some fixes #35

Merged
merged 2 commits into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
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
Loading