Skip to content

Commit

Permalink
Fix #851 map: display issue when calling minimize()+hide()
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic100 committed Feb 5, 2023
1 parent 46813fe commit b751717
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/plugin-map.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
defaultZoom: 40,
// position: 'top left',
// maxZoom: 300,
// compassImage: null,
// overlayImage: null,
// static: true,
// visibleOnLoad: false,
hotspots: [
Expand Down
14 changes: 11 additions & 3 deletions packages/map-plugin/src/components/MapComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export class MapComponent extends AbstractComponent {
this.state.forceRender = true;
break;
case 'transitionend':
if (!this.state.maximized && this.overlay) {
if (!this.state.maximized) {
this.overlay.style.display = '';
}
this.state.forceRender = false;
Expand Down Expand Up @@ -253,9 +253,17 @@ export class MapComponent extends AbstractComponent {
return this.state.visible && !this.state.collapsed;
}

override show(): void {
override show() {
super.show();
this.update();
if (!this.state.maximized) {
this.overlay.style.display = '';
}
}

override hide() {
super.hide();
this.state.forceRender = false;
}

/**
Expand Down Expand Up @@ -324,7 +332,7 @@ export class MapComponent extends AbstractComponent {

utils.toggleClass(this.container, 'psv-map--maximized', this.state.maximized);

if (this.state.maximized && this.overlay) {
if (this.state.maximized) {
this.overlay.style.display = 'none';
}

Expand Down

0 comments on commit b751717

Please sign in to comment.