Skip to content

Commit

Permalink
Bug: fix open/close overlay when user interacts
Browse files Browse the repository at this point in the history
  • Loading branch information
iamvdo committed Dec 9, 2021
1 parent e15f3bb commit 6c52ba3
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/components/yeti/map-layers/AvalancheBulletinsLayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,8 @@ export default {
// = prevent overlay from moving
if (this.panIntoView) {
this.panIntoView = false;
// update bulletin overlay though (hide/show if needed)
this.updateBulletinsOverlay();
return;
}
Expand Down Expand Up @@ -524,7 +526,7 @@ export default {
}
} else {
// remove when no feature found (click on map)
this.closeOverlay();
this.closeOverlay(true);
}
},
updateBulletinsOverlay() {
Expand All @@ -542,16 +544,21 @@ export default {
}
},
openOverlay(coordinates, panIntoView = false) {
bulletinsOverlay.setPosition(coordinates);
this.$nextTick(() => {
bulletinsOverlay.setPosition(coordinates);
if (panIntoView) {
this.panIntoView = true;
bulletinsOverlay.panIntoView(bulletinsOverlayPanOptions);
}
if (panIntoView) {
this.panIntoView = true;
bulletinsOverlay.panIntoView(bulletinsOverlayPanOptions);
}
});
},
closeOverlay() {
closeOverlay(force = false) {
bulletinsOverlay.setPosition(undefined);
this.activeBulletins = null;
if (force) {
this.activeBulletins = null;
}
},
},
};
Expand Down

0 comments on commit 6c52ba3

Please sign in to comment.