r/reactjs • u/Inevitable-Data-404 • Jun 20 '25
Needs Help Free alternative to Google Maps JS API in React?
Hey!
I’m learning the MERN stack on Udemy and currently working with React. For a project, I need to use Google Maps JavaScript API to show a map with markers — but it requires billing, which I can't afford right now.
Are there any free and easy-to-use alternatives that work well with React? Mainly need basic map display and markers.
Thanks in advance!
15
Upvotes
23
u/ProgrammerDad1993 Jun 20 '25
Openstreetmaps?
Edit: open layers?
13
u/mauriciocap Jun 20 '25
Support Leaflet, much better and you can use FLOSS OpenStreetMap data, a project worth supporting too. You can also learn to render/style your own maps if needed. I built an application for utility companies, like electricity distribution or internet, layering the technical elements above the street map, with search, etc.
5
u/Traditional-Kitchen8 Jun 20 '25
For simply showing couple of markers and rendering a map you won’t be charged. Limit your api key to your domain and only browser usage. And delete it after you are done with tutorial.
4
u/plymer968 Jun 20 '25
React-Map-GL + MapLibre-GL
I am building a data-heavy weather map app combining a ton of raster and vector data types and working with these libraries has been a dream.
I am using OpenFreeMap as my tile source.
Don’t even bother looking at anything else. I did months of research and this was by far the best setup I could find.
7
u/Exciting_Object_2716 Jun 20 '25
https://react-leaflet.js.org/ https://www.npmjs.com/package/react-leaflet
2
u/AndrewSouthern729 Jun 20 '25
ArcGIS Maps SDK has a lot that can be utilized without a license. It’s not the easiest to use if I’m being honest but they have decent documentation and some amount of tutorials to get you familiar.
2
u/EuMusicalPilot I ❤️ hooks! 😈 Jun 20 '25
We switched to leaflet from google Maps with esri satellite map tiles.
2
u/sebastian_nowak Jun 20 '25
The most mature free and open source library for maps is probably maplibre right now. It's a community fork of mapbox, from before they changed their license.
You can plug in any map provider in there - look for something based on openstreetmaps, there are some that are free but will have usage limits.
1
u/AllInOneNerd Jun 20 '25
I had good experiences with MapLibre in the past. API is a little different compared to the Google maps api but is way more flexible
1
u/vagr Jun 20 '25
For a pet project/tutorial that isn't going to be deployed anywhere, I doubt you'll be charged since their monthly credit is pretty generous for small projects. I use their JS API for a commercialized project that gets small but not insignificant traffic and still haven't been charged.
1
u/Radinax Jun 20 '25
I used Leaflet in a production app and works great.
1
u/brainhack3r Jun 20 '25
I used @react-google-maps/api and to lookup regions I used openstreetmaps and their Nominatim API.
It's pretty rough to work with the raw Nominatim API though.
1
u/CommentFizz Jun 21 '25
For a free alternative, you might want to check out Leaflet with React-Leaflet. It’s open-source, pretty easy to use, and supports maps with markers. You can use free map tiles from providers like OpenStreetMap. Works great for basic mapping needs without any billing hassles.
1
u/my_girl_is_A10 Jun 22 '25
2nd for Leaflet and react-leaflet
1
u/ConZ372 Jun 23 '25
I use MapBox. Its built on OpenStreetMaps and is super easy to use.
while OSM is free and MapBox is priced on usage, i haven't managed to break past their free tier yet and have used across many platforms
1
u/Kallyfive Jan 08 '26
If you only need basic maps and markers, you don’t have to use Google at all. A lot of people learning React go with Leaflet plus OpenStreetMap because it’s free and simple to set up.
Other options worth looking at are Mapbox, MapTiler, HERE Maps, and TomTom. Most of these work fine with React and cover the basics without forcing you into paid plans right away.
1
u/Achilles_v2 Jun 05 '26
Where can i get api from that website?
0
u/k032 Jun 20 '25
For your use case, as a stand in for Google Maps API in a course, I'd recommend Leaflet. It's the simplest easiest to use map library that allows you to do basic things. More importantly it's extremely popular so if you get stuck there's tons of resources for it.
Mapbox, Maplibre, OpenLayers, and ArcGIS JS API all also do this...but they are a bit overkill for the situation. Or more niche. Or also are freemiun/paid products
Leaflet Library https://share.google/uYjxvFruq11gH13Vl
React components for Leaflet maps | React Leaflet https://share.google/KDRQw5k67Qye3qJVE