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.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *