I am using EasyButton plugin of leaflet (link). More specifically I applied EasyBar which unites several buttons.
Plus, at certain zoom levels, I add/remove various layers with zoomend function (link). Is it possible to apply a function in which I can refer to BOTH button and zoom level? I don't know the formal code way but the idea something like the following:
map.on('zoomend', onZoomend);
function onZoomend(){
if(map.getZoom()<8) else if btn2.enable(){}};
**and here is my code:
map.on('zoomend', onZoomend);
function onZoomend(){
if(map.getZoom()<8)(){
map.addControl(info0);
map.removeControl(info1);
map.removeControl(info2);
map.removeControl(info3);
}
if(map.getZoom()==8){
map.addControl(info1);
map.removeControl(info2);
map.removeControl(info3);
} };
No comments:
Post a Comment