我试图更改鼠标悬停在传单地图标记引脚上时的工具提示尾部三角形颜色,但我无法检查确切的类名称来覆盖它。有没有办法改变颜色并需要将三角形的位置移动到标记图像的左侧以及CSS类名。这篇文章显示了弹出窗口的确切要求以及我需要工具提示。
const tooltipOptions = {
direction: 'top',
offset: [0, -44],
// className: 'leaflet-tooltip-tip', -- tried adding the class to change the color but didnt help.
};
onMouseOverEvent.bindTooltip('My tooltip', tooltipOptions).openTooltip();
最后在开发工具控制台的debbuger的帮助下找到了tooltip的css类名
setTimeout(()=> {debugger}, 3000)
然后检查元素来检查类并修改如下
.leaflet-tooltip-top:before {
border-top-color: red !important;
}
可能对将来的某人有用。谢谢你。