1
我想顯示每個地圖標記的工具提示onload,而不需要懸停或單擊以顯示它。這裏是我嘗試鏈接openPopup函數bindPopup:mapbox顯示多個工具提示onload
function onEachFeature(feature, layer) {
if (feature.properties && feature.properties.popupContent) {
popupContent = feature.properties.popupContent;
}
layer.bindPopup(popupContent).openPopup();
}
但是,工具提示不會出現,除非點擊。
我看到文檔的this page提供了以下功能,但它只是一個單一的標記,而不是多重的。
marker.eachLayer(function(m) {
m.openPopup();
});
如何顯示所有標記onload?
美麗,謝謝 – nathanbweb