Google My Maps allows you to export a map as a KML file, but without including images, mykml fixes this. mykml exports images as data URLs in the KML file, this format is compatible with umap and allows for portability.
- Export map data:
- Open your map in Google My Maps
- Open the browser console
- Copy-paste
exportPageData.jsand press enter - Save the downloaded file
pageData.jsonto theexportsdirectory in this repo - Export the map as KML (you should find an option
Export to KML/KMZin the three dots menu, but these instructions can change, check online) and save it asinput.kmlin theexportsdirectory in this repo
- Convert map data:
- If you followed exactly the instructions above run
python mykml.pyand you will get anoutput.kmlfile in theexportsdirectory of this repo - If you save the files with different names or paths than suggested, then run
python mykml.py --helpto see the different options
- If you followed exactly the instructions above run
- Try to make some maps in uMap and see the resulting format, because I don't think it fully supports the Google KML export file, so you could recreate entirely, without using Google's KML export
- Looks like that in the description field Google adds sometimes some HTML (not only text) and that's a problem, I used beautifulsoup to overcome it, but maybe I'm doing something wrong. Look also at "CDATA". - CHECK
- I think uMap has a limit of characters or something in the description field, so you can't have too big images, otherwise in base64 they take all the characters and the image is not rendered.
- The FastKML library has some problems with comparisons with strings... If have a comparison of a placemark value and a string, like this
placemark.name == "Test"you could get that the two strings are different even tho printing them, they look the same.
- Either rely on pageData or on the KML export, not on both
- The program assumes that the structure of your map is "folders -> placemarks", while in general it doesn't have to be like that
- Convert the code to Javascript to run in the browser