传单“ zoomend”功能不适用于querySelector更改功能

下午好,

继续查询开始于该查询:

https://gis.stackexchange.com/questions/340911/leaflet-plot-map-onzoomend-function-into-addeventlistenerfunction

我试图将map.on('zoomend',function(document.querySelector("input[name=cf]").addEventListener('change',function()结合使用,以便在缩小某个级别时删除指定的图层。

我的代码现在如下所示:

 map.on('zoomend',function() {
 document.querySelector("input[name=cf]").addEventListener('change',function() { //checking the 
 jobs in the sidebar layer 1
if(this.checked) map.addLayer(job) //geoJson layer
else map.removeLayer(job)
if(this.checked) map.addLayer(featuresLayer) //clustered geoJson layer
else map.removeLayer(featuresLayer)
})
if (map.getzoom() <7){
        map.removeLayer(job);
}
else{
     map.addLayer(job);
}       
});

传单“ zoomend”功能不适用于querySelector更改功能

https://i.stack.imgur.com/Mf76i.png

有人可以帮我解决这个问题吗?

提前谢谢

laosizhxy 回答:传单“ zoomend”功能不适用于querySelector更改功能

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3142847.html

大家都在问