使用Mapbox GL JS,并按照提供的示例展示如何将标记附加到地图上
for iteration in it.combinations(list_tmp, 2):
print(iteration)
如何在点击事件中隐藏/显示不同的标记
答案 0 :(得分:0)
像这样吗?
function hide() {
let markers = document.getElementsByClassName("marker");
for (let i = 0; i < markers.length; i++) {
markers[i].style.visibility = "hidden";
}
}
function show() {
let markers = document.getElementsByClassName("marker");
for (let i = 0; i < markers.length; i++) {
markers[i].style.visibility = "visible";
}
}