block by nitaku 5875c370da8852fd925783eca2fb58cc

World map II

Full Screen

Following the previous example, this is an attempt to label the countries of the world with the corresponding ISO 3166-1 alpha-2 code.

This turned out to be more difficult than expected, because some countries in disputed areas have no ISO code (represented in this map as red labels). Data from Natural Earth‘s datasets assign an arbitrary ID to these cases (the string ‘-99’). That makes it impossible to merge the topoJSON and the TSV provided by Mike Bostock’s world atlas back into one, since some entries carry the same identifier.

Moreover, using the country shape’s centroid to place the label is less than ideal in many cases (e.g., France).

index.js

index.html

index.coffee

index.css