How to add custom inset maps
In Datawrapper locator maps, you can add an inset map in step 2: Design map. You can either choose a globe or select from a range of predefined inset maps ("regions").
But there are cases when you might need a custom inset map. For example
- to show an inset map of two countries/states, if a location is close to the border
- if an inset map of the whole state/country/continent is too big, but the next available sub-region is too detailed to be helpful
- when a location is on an island with two countries (e.g., Ireland/Northern Ireland), and you want to show the whole country.
In this article, we show you how to add a custom GeoJSON as your inset map.
First, you need a GeoJSON with the region that should become your inset map. To find a GeoJSON of your area, you can use a tool like geojson-maps.kyd.au, or simply search for it on the web.
For a GeoJSON with all US states, search for "US states GeoJSON". As a result, you might land on a Github page like this : https://github.com/PublicaMundi/MappingAPI/blob/master/data/geojson/us-states.json. It looks perfect:

But this already shows us a map. To get the actual GeoJSON, click on "Raw" in the top right. This will lead you to the raw GeoJSON: https://raw.githubusercontent.com/PublicaMundi/MappingAPI/master/data/geojson/us-states.json
Save this "text" to your Downloads folder by pressing Cmd/Ctrl+S:

Great! Now you got the GeoJSON on our computer. But it shows all US states, not the ones you might want. So here's what to do next:
In the second step, you edit your GeoJSON with the online tool mapshaper.org:

After dragging your downloaded GeoJSON in there, click Import. And voilà, you'll see the map:

Now select the states you want to show.
To do so, click on the little mouse pointer in the sidebar and choose selection tool. Now simply click on all the regions you want to keep, and then choose Keep:
Happy with the chosen states? To download your edited GeoJSON from Mapshaper, click on Export in the top right and then confirm that GeoJSON is selected. Then click on Export.

Almost there! Now you need to import the GeoJSON to your Datawrapper locator map. To do so, click on Custom, then Upload, and select the GeoJSON from your Downloads folder:
That's it! If you still have some questions, don't hesitate to get in touch with us at support@datawrapper.de. We're looking forward to helping you.