Skip to content

事件

open

当弹窗被添加到地图上(打开)时触发

示例:

html
<script>
  const myPopup = new EhhGisGl.Popup().setLngLat([0, 0]).addTo(map)

  myPopup.on('open', () => {
    console.log('弹窗已打开')
  })
</script>

close

当弹窗从地图上移除(关闭)时触发。

示例:

html
<script>
  const myPopup = new EhhGisGl.Popup().setLngLat([0, 0]).addTo(map)

  myPopup.on('close', () => {
    console.log('弹窗已打开')
  })
</script>