我在Leafletjs中制作了几个自定义按钮 - 现在我想添加一个悬停工具提示来解释按钮的功能.我已经尝试在选项中添加"title:"和"tooltip:",但是当我将鼠标悬停在控件上时仍然看不到文本.
var load = L.Control.extend({
options: {
position: 'topright'
},
onAdd: function(map) {
var container = L.DomUtil.create('div', 'leaflet-bar leaflet-control leaflet-control-load-points');
//container.style.backgroundColor = 'white';
container.style.width = '25px';
container.style.height = '25px';
container.onclick = function() {
clear_markers(markers);
load_markers(markers);
}
return container;
},
});
Run Code Online (Sandbox Code Playgroud)