问题
I can't find the way to hide all opened marker popups or even check marker popup state.
回答1:
I would think getPopup().isOpen()
would allow you to check state, and getPopup().remove()
(ran while iterating over all of your stored markers in some array) would accomplish what you need here.
来源:https://stackoverflow.com/questions/40849927/how-to-hide-all-opened-marker-popups-in-mapbox-gl