How to import area & line markers

👉 This article explains how to import area & line markers. If you have questions about how to import point markers, visit the article "How to import point markers". If you want to learn how to style your area & line markers, visit: "How to style area & line markers".

To add areas (like settlement boundaries) & lines (like subway lines) to Datawrapper Locator maps, you need to import a GeoJSON. To do so, turn on the switch in step 1: Add markers:

There you have the option to upload a valid GeoJSON. You can also copy and paste a GeoJSON in the text area at the bottom. 

1

Where to get GeoJSONs from

There are multiple ways to get your hands on a GeoJSON file:

2

Prerequisites for your GeoJSONs

In order to import your areas and lines in Datawrapper, it needs to... 

  • be a GeoJSON and a valid JSON file (check validity with this online tool).
  • be smaller than 2MB. The larger your file, the longer it takes for your map to load for those who are viewing your map, and for editing the map; so try to keep it as small as possible. If your GeoJSON is too big, go to mapshaper.org, upload your GeoJSON and try to simplify the geometry. Click the "simplify" button in the upper right, followed by "Apply". Then drag the slider at the top to the right as far as you can while the geometry still looks good enough. The displayed percentage tells you how much of the data size is left. Typically you can go down to 10-15% without noticing a big difference. When you're done, click "Export", select GeoJSON and re-upload the data to Datawrapper.
  • use the WGS-84 coordinate system (EPSG:4326 projection).
  • include coordinates.
  • have less than 20 differently styled features. Scroll to "How to import your GeoJSON to Datawrapper" to learn more.

It's ok if your GeoJSON includes additional information and properties,  like in this one that shows the metro lines in Shanghai as of 2016:

3

How to import your GeoJSON to Datawrapper

Once you have a GeoJSON ready, copy & paste it into the text area or click on "Import GeoJSON or CSV":

You will see that Datawrapper shows all lines with the same stying properties (like "color") as one marker. In our GeoJSON, no lines but two have a color defined. These two subway lines have the property "color": "red", that's why they're shown as an own marker and appear red on the map. If you want to style the individual subway lines, you need to give them properties before importing them to Datawrapper.

👉 You can also add properties to the GeoJSON, to style the areas and lines before importing them to Datawrapper. For more information and a list of supported property names, visit the article: " How to style your markers before importing them to Datawrapper".

Your map will be slower for both you (in the editing process) and your readers (when they open the website on which you embed the map), when you upload GeoJSONs that are very big or that will result in many different markers. Consider styling lines and areas in the same way, so that they get imported to Datawrapper as one marker. 

4

How to change the order of areas and lines

Maybe two or more areas overlap on your map, and you're not happy with the order. To change that, you can grab and drag your markers around in the marker list:

Please note: If your map shows not just areas and lines, but also points, then they will always be on top. It's not possible to get point markers to appear below line or area markers.

Still need help? Contact Us Contact Us