Sign in

Tutorial: Adding OpenStreetMap to your website!

#1912
Verhoeckx

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’).