Categories
JavaScript Answers

How to remove the zoom control with LeafletJS?

Spread the love

Sometimes, we want to remove the zoom control with LeafletJS.

In this article, we’ll look at how to remove the zoom control with LeafletJS.

How to remove the zoom control with LeafletJS?

To remove the zoom control with LeafletJS, we can set the zoomControl option to false.

For instance, we write

const map = new L.map("map", { zoomControl: false });

to create a map with the L.map function.

We call it with an object with the zoomControl property set to false to remove the zoom control from the map.

Conclusion

To remove the zoom control with LeafletJS, we can set the zoomControl option to false.

Leave a Reply

Your email address will not be published.

If you like the content of this blog, subscribe to my email list to get exclusive articles not available to anyone else.