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

Share this video with your friends

Send Tweet

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.

William Fernandes
William Fernandes
~ 4 years ago

A new series that would be interesting is about OpenLayers.

Colby Fayock
Colby Fayock(instructor)
~ 4 years ago

A new series that would be interesting is about OpenLayers.

That's a good idea! I'll add it to my list