
Fixing AI code, over-engineering JavaScript, and more: discover what’s new in The Replay, LogRocket’s newsletter for dev and engineering leaders, in the December 10th issue.

TOON is a lightweight format designed to reduce token usage in LLM prompts. This post breaks down how it compares to JSON, where the savings come from, and when it actually helps.

Andrew Evans, principal engineer and tech lead at CarMax discusses five ways to fix AI-generated code and help you debug, test, and ship safely.

This tutorial walks through recreating Apple’s Liquid Glass UI on the web using SVG filters, CSS, and React. You’ll learn how to build refraction and reflection effects with custom displacement and specular maps, and how to balance performance and accessibility when using advanced filter pipelines.
Would you be interested in joining LogRocket's developer community?
Join LogRocket’s Content Advisory Board. You’ll help inform the type of content we create and get access to exclusive meetups, social accreditation, and swag.
Sign up now
15 Replies to "React Leaflet tutorial"
Very cool. Might it be a better practice to import the Map component as another name such as LeafletMap though to avoid potential future conflict with the Map data-structure?
I think you’re probably right, Joshua! Good suggestion 🙂
thank you thank you very much. It helped me a lot. Especially to solve errors with the marker. Nothing I had seen had worked for me but I followed your simple steps and it was perfect everything worked
Nice! I’m glad it was able to help. I have an article that talks about clustering markers in React Leaflet if that is something you need: https://www.leighhalliday.com/leaflet-clustering
hi , is there away to recenter the map on the clicked marker
I am having a problem with the open street maps mapm having missing tiles and being jumbled up.
I have a npx create-react-app with the app.css containing that leaflet-container then in the app.js I have the code below wotih the ottawa centric map I added an import ./leaflet.css as well trying to fix my tiling problem but that then gives me an error of:
Module not found: Can’t resolve ‘./images/layers-2x.png’ in ‘D:\code\ComIT\ReactJS\comit-poject-robm\src’
I am looking for same
you have to update the map center with new position, so on click of marker u can get the markes (lat,lng) and set the same value to the map center
Thanks!! It was so useful for me!
can you implement routes or directions with react leaflet?
When i put Map component inside my App.js (even with the TileLyer as Children and center, zoom props) i don’t get anything on my screen even that grey screen which is supposed to be shown doesn’t. Thank you for any help
Please i got this message in my console and the map isn’t display everywhere:
Failed to find a valid digest in the ‘integrity’ attribute for resource ‘https://unpkg.com/[email protected]/dist/leaflet.css’ with computed SHA-256 integrity ‘SHMGCYmST46SoyGgo4YR/9AlK1vf3ff84Aq9yK4hdqM=’. The resource has been blocked.
Thanks for this tutorials, i’ve finally win a way to complete it. Now please how can i make the Marker to move when i’m scrolling and how can i can a name of a place automatically just with latitude and longitude. Thanks
https://github.com/LucaschS/ClimbingApp
My app doesnt work can anybody help me
You should avoid react-leaflet. If you need to render thousands of objects, you perhaps come across performance issues https://twitter.com/Andrej_Gajdos/status/1661023641432358917