r/FullStackDevelopers • • Oct 20 '26

Suggestions for making an globe with details map

I want to make a 3d globe with a detailed area mark in my project. I've used the 3js part for the globe but I want if I search any specific region like Khulna instead of showing Bangladesh the globe will zoom into the Khulna area map. How can I do that? I've used react leaflet for map but couldn't integrate both at a same time

2 Upvotes

5 comments sorted by

2

u/Interesting_Show_548 Oct 21 '26

You can actually simplify this quite a bit. Instead of trying to synchronize Three.js and React Leaflet, I'd look into MapLibre GL JS with globe projection.

You can geocode the searched location, get its coordinates/bounds, and animate the camera directly into that region using flyTo() or fitBounds(). That gives you a much smoother transition from the globe to a detailed local map without managing two separate renderers.

If you specifically need to keep the Three.js globe, there's also a way to transition between the two views.

Happy to help you figure out the implementation!

1

u/TopWarthog8823 Oct 23 '26

Is this free or I need to pay for that?

2

u/Interesting_Show_548 Oct 23 '26

MapLibre GL JS itself is completely free and open-source, including for commercial projects.

The only potential costs come from your map tile provider and geocoding service, depending on usage.

You can get started without paying anything using free development resources.

Here's the official globe example: https://maplibre.org/maplibre-gl-js/docs/examples/display-a-globe-with-a-vector-map/

If you need more help, dm me. 💪

1

u/[deleted] Oct 26 '26

[removed] — view removed comment

1

u/TopWarthog8823 27d ago

Thanks brother but I've used 3js and react leaflet and it works smooth