map_codes
v1.1.0
Published
>根据adcode(行政区划代码)来获取高德或者百度对应的citycode
Downloads
1
Readme
介绍
根据adcode(行政区划代码)来获取高德或者百度对应的citycode
安装
npm install --save map_codes
使用
获得citycode
const { getCode } = require('./map_codes')
const code = getCode('510100') // 获得高德和百度的citycode:返回 { amap: { citycode: 028 }, bmap: { citycode: 075 } }
const aCode = getCode('510100', 'amap') // 获得高德地图的citycode:返回 028
const bCode = getCode('510100', 'bmap') // 获得百度地图的citycode:返回 75
获得adcode对应的数据
const { getData } = require('./map_codes')
const data = getData('510100')