1
我希望在用戶點擊圖層控件中的「城市」複選框時獲得通知 - 該控件顯示或隱藏linked example中的城市標記。這裏是一個JSFiddle玩耍。如何在Leaflet LayerGroup顯示或隱藏時得到通知?
我看到LayerGroup派生一些events from FeatureGroup。如果我錯了,請糾正我:據我瞭解,顯示和隱藏標記與layeradd和layerremove不一樣?
的input
元素包含沒有id
綁定到:
<label>
<input class="leaflet-control-layers-selector" type="checkbox" checked="">
<span> Cities</span>
</label>
怎麼能當標記能見度切換通知我?