Skip to content

Commit

Permalink
fix 点选弹窗关闭后,清除内容,防止视频自动播放 review by qiw
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxianhuii committed Jan 26, 2024
1 parent 204c1e1 commit f7e222d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/mapboxgl/web-map/control/identify/Identify.vue
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ export default {
},
// 过滤数据, 添加popup
addPopup(feature, fields) {
this.viewModel.popup?.off('close', this.clearPopup);
this.popupProps = {};
if (feature.properties) {
// 过滤字段
Expand All @@ -252,10 +253,15 @@ export default {
this.$nextTick(() => {
this.isHide = false; // 显示内容
this.viewModel.addPopup(coordinates, this.$refs.Popup);
this.viewModel.popup.on('close', this.clearPopup);
setPopupArrowStyle(this.tablePopupBgData);
});
}
},
clearPopup() {
// 如果不清除弹窗内容,当弹窗内容有视频,且开启自动播放+弹窗/全屏时,会导致更改配置时,即使没打开点选弹窗,视频也会自动弹窗播放
this.popupProps = {};
},
// 添加高亮图层
addOverlayToMap(layer, filter) {
// 先移除之前的高亮layer
Expand Down

0 comments on commit f7e222d

Please sign in to comment.