Surbowl / world-geo-json-zh

🌏 简体中文 GeoJSON 世界地图,带有国家(地区)的 ISO 3166 代码、中文简称与全称。A simplified Chinese world map in GeoJSON format, including ISO 3166 codes, Chinese short names, and full names of countries (regions).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

希望能提供查询 ISO3166 数据方法

tonytony2020 opened this issue · comments

commented

类似 https://github.com/richorama/country-code-lookup
"CN" => China region info
但 country-code-lookup 包缺中文,如 "CN" => "**"/"**大陆"

您好,world-geo-json-zh 是一个 JSON 格式的地图数据集,本身并不提供查询数据的 API,但是您可以将他改造为您需要的数据,下面是一个简单的例子。

// 加载 https://raw.githubusercontent.com/Surbowl/world-geo-json-zh/main/world.zh.json
var data = loadData();

var infos = data.features.map(a => a.properties);
var chinaRegionInfo = infos.find(c => c.iso_a2 === 'CN');
console.log(chinaRegionInfo);