maptalks / maptalks.js

A light and plugable JavaScript library for integrated 2D/3D maps.
https://maptalks.org
BSD 3-Clause "New" or "Revised" License
4.31k stars 504 forks source link

setInfoWindow 单独设置 autoCloseOn:true,似乎不太管用,点击地图并不能关闭 #889

Closed CXY001 closed 5 years ago

CXY001 commented 5 years ago

maptalks's version and what browser you use? ----谷歌浏览器

Issue description ----setInfoWindow 单独设置 autoCloseOn:true,似乎不太管用,点击地图并不能关闭

Please provide a reproduction URL (on any jsfiddle like site)

fuzhenn commented 5 years ago

autoCloseOn 的参数不是 true/false,而是事件名(多个事件用空格分隔),即map抛出哪些事件后自动关闭 InfoWindow

可以参考这个示例,我把autoCloseOn设成了 contextmenu,这样能用右键点击关闭 InfoWindow. http://jsfiddle.net/fuzhenn/h1fob468/