-
Notifications
You must be signed in to change notification settings - Fork 636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
更新 china_city_data.json 的操作方法,获取到最新版的省市区数据 #228
Comments
This was referenced Feb 3, 2023
Open
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
鉴于 citypickerview/src/main/assets/china_city_data.json 于2021年之后就没有更新,导致选择器的行政区划数据过于滞后,部分新的区县没有。每年都会有十几到几十个区县撤并,因此行政区划数据应当需要经常更新维护。
可以到我的开源库:https://github.com/xiangyuecn/AreaCity-JsSpider-StatsGov 获取到最新的省市区数据,基本上月更,除了省市区乡镇四级区划外,还有坐标边界数据。
对于 省直辖县级市 比如:湖北的仙桃、潜江,海南的琼海、五指山,直筒子市:广东中山、东莞,海南儋州等,这两种会少一级数据,导致很未处理此问题的级联选择器产生各种bug;我的开源库对于上述两种城市有专门特殊处理,比如:湖北-潜江-龙湾镇,将填充一个同名的区级,变成 湖北-潜江-潜江-龙湾镇。
注意:id为区划代码简化后的数字,省级为2位数,市级为4位数(县级市、直筒子市为6位),区县级为6位数(县级市、直筒子市的为9位),此id是唯一的。
转成 china_city_data.json ,请用下面方法(使用时,建议开发当天转换得到新文件,这样就能使用到最新版本数据):
自定义js代码
自定义js代码:
The text was updated successfully, but these errors were encountered: