Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.


    Change the Location of a React Leaflet Map with Leaflet's flyTo and setView


    In this lesson, we'll use the Leaflet setView and flyTo methods available on a map instance to change the location of a React Leaflet map. Using buttons to demonstrate, we'll walk through adding the setView method using a position and zoom level as well as the flyTo method which allows us to animate changing the location along with a specified duration.