Place a marker in each country using mapbox

I am using Mapbox to create a map of several choropleth. Something like the lines of this example,

I am using countries instead of USA. I have a map and I can switch between layers However, I have an additional requirement to add a marker in each country that shows how many projects are active in that country. I found out how I can add custom markers to the map using this example,

The problem is I need to put a marker in the center of each country. Does anyone know a way to put a marker in the middle of each country?

I tried to use earth earth 0 label data but has multiple points for each country. It looks like the "scalerank = 0" points were in the middle of the countries, but if I filter these points, I still get a few points for some countries (for example, Russia has 4, but Belgium also has 4). If you map all of the scalable 0 points on the map, you get the following output: /12.206

Does anyone know of a dataset that has one point per country, or another way to place a marker at the center of each country using a mapbox?


source to share

1 answer

It seems difficult to find a list of country points to place markers. So I took the said admin labal 0 points and tried to misinform it to only have one suitable marker for each country.

The result can be downloaded here in GEOJSON format:

If you want a visual representation of the points take a look at this map:

I need these points to prove the concept design, so I didn't check all the markers very carefully, I also left out some of the more sensitive country border policies. If you have a project where this is important, check the file before use, but the points in this file can be easily edited to suit your preference.



All Articles