You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code snippet could help you to remove the added layer from the map. If you click on the map, the just-added layer will be removed. Or you can introduce a button in HTML and write a Jquery.
HTML:
VT Layer
JS:
//remove and add layer on clicking checkbox vt_layer using jquery
$("#vt_layer").click(function () {
if (this.checked) {
map.addLayer(bandar_asphalt);
} else {
map.removeLayer(bandar_asphalt);
}
}
);
Without using JQuery:
MAP.on("click", function (e) {
if (map.hasLayer(bandar_asphalt)) {
map.removeLayer(bandar_asphalt);
}
});
hi
I have added a layer to the map with below code and after I want to remove that layer from the map, how can I do this?
The text was updated successfully, but these errors were encountered: