仅当鼠标悬停在工具提示或标记上时才保持反应传单工具提示打开的方法?
我正在使用React Flealet Tooltip作为MAPBOX地图。 当鼠标越过标记或工具提示本身时,我遇到了很多麻烦,试图使React FelleT Tooltip保持打开状态?我希望能够在悬停时打开,然后单击工具提示内的某些内容,并且当鼠标离开标记或工具提示时,我想关闭。
因此,如果鼠标处于红色,则工具提示是打开的,如果不是,则该工具提示是关闭的。
我尝试的任何指示都
我尝试了API https://leafleafletjs.com/slavaukraini/reference.html#tooltip 可能需要建立的专业知识来实现这一行为。
I am using react leaflet tooltip for a mapbox map.
I'm having a lot of trouble trying to keep react leaflet tooltip open when the mouse is over either the marker or the tooltip itself? I want to be able to open on hover and then click on something inside the tooltip, and I want to close when the mouse leaves the marker or the tooltip.
So if the mouse is in the red then the tooltip is open, and if it is not, then the tooltip is closed.
Any pointers appreciated
I tried what was available in the api https://leafletjs.com/SlavaUkraini/reference.html#tooltip, but I think there may be more customization I don't have the expertise to build may be needed to pull off this behavior.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一种方法是不要将其设置为鼠标离开时关闭。
然后,将由用户单击地图或单击“关闭”以关闭弹出窗口。
如果徘徊在显示弹出窗口的任何其他标记中,则将自动关闭原始标记。
One way to do it is to not set it to close when the mouse leaves.
Then it will be up to the user to either click on the map or click "close" to close the popup.
If any other markers are hovered that show popups then the original one will be automatically closed.