Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import a uMap into Leaflet

I have created a map with uMap, e.g. http://umap.openstreetmap.fr/de/map/raspail_1#19/48.84307/2.32840

Now I want to use the Leaflet API to embed this stuff (no iframe). Is there a way to e.g. export this map as JSON and import it into Leaflet. Or are there any possibilities to do this?

like image 671
DaFunkyAlex Avatar asked Feb 12 '26 03:02

DaFunkyAlex


2 Answers

You can Download the Data in GeoJson, KML and GPX. Go to the "more" button in the left > Share Button > Download raw data

download data from umap

like image 158
ubahnverleih Avatar answered Feb 14 '26 17:02

ubahnverleih


It doesn't look like the uMap supports it natively. What I have suggested below is hacky, but if the information means enough to you its a way to get it.

I started the devtools in chrome [F12]. I then navigated to the page you gave and clicked on the network tab of the tools. If you click on one of the entries that have what appears to be a numeric folder name you should see something that resemble the screenshot I added below. Each one of these folders seems to correspond to some data files (alan-fout.kml in the highlighted item in the pic). This is GeoJson that you could copy off, paste in a file and reference in a leaflet app. What isn't here is the stylings of those data items, which you would have to replicate with leaflet.

Instead of this, you may just prefer to find a tool that converts kml that you would have uploaded to uMap to GeoJson if that's the format you prefer. Leaflet also has a series of plugins that can consume formats like kml.

enter image description here

like image 31
Jason Koopmans Avatar answered Feb 14 '26 16:02

Jason Koopmans