zcreativelabs / react-simple-maps

Beautiful React SVG maps with d3-geo and topojson using a declarative api.
https://www.react-simple-maps.io/
MIT License
3.12k stars 426 forks source link

Is there a way to use ISO-2 country codes for ID instead of ISO-3 ? #151

Closed kHRISl33t closed 5 years ago

kHRISl33t commented 5 years ago

As I saw in previous issue comments, you should be able to use iso-2 codes under properties. But for me properties only contains name which is the full name and nothing else and id contains the ISO-3 code.

{(geographies, projection) => geographies.map(geography => {
    console.log('id', geography.id)
    console.log('properties', geography.properties)
})}

Am I missing something obvious? :) I'm using world-50m.json topojson.

kHRISl33t commented 5 years ago

Nevermind, it was my fault! Somehow the json was not loaded properly.