1×
Become a member
to unlock all features

Level Up!

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

Autoplay

    Use Leaflet's Geolocation API to Find a Browser's Location to Update a React Leaflet Map

    reactReact

    In this lesson, we'll use Leaflet's map locate method to use the browser's API to find the visitor's current location and update the React Leaflet map to that location. We'll walk through what the locate method does, set an event handler to trigger when it locates, and use the accuracy and location data to add a circle to the map designating the area.