Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Tutorial: Adding OpenStreetMap to your website!

#1912
Avatar photo[anonymous]

Feature

Add a zoom in and a zoom out button.

Solution

Add the controls.

Code

`map.addControl(new mapboxgl.NavigationControl({showCompass: false}), ‘top-right’);`

Comments

Because I didn’t want the see the compass I added ‘showCompass:false’ to the NavigationControl function. With the last argument you set the location of the controls (‘top-right’).