• Stars
    star
    482
  • Rank 91,212 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 7 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

中国省市区数据(含港澳台)

area-data

中国行政区域数据(含港澳台)

v5

  • 更改新的数据来源:area-puppeteer
  • 在实用性上对数据作了格式化处理,见area-puppeteer#format.js
  • 新的导出会有两份数据:pca.jspcaa.js,前者仅包含省市数据,后者包含省市(县)区数据

v3.1

增加广东省中山市和东莞市的区镇数据(参考京东 pc 端的地区选择)

v3

增加港澳台数据(参考京东 pc 端的地区选择),v3之后不再提供或更新街道数据

v2

v2版本中,data.js 中不再包含街道数据,以减小打包体积。格式化的街道数据单独存放在 street.js 中,单独暴露全局变量 STREETS。可通过该CDN链接单独引入,或者下载该文件自行引入。

v1

v1版本中,data.js 包含省市区以及街道数据。

Installation

Install the pkg with npm:

npm install area-data --save

or yarn

yarn add area-data

or bower

bower install area-data

获取数据

// v5之前的版本
import AreaData from 'area-data';

// v5及之后的版本
import { pca, pcaa } from 'area-data';
// 可以根据需要按需引入:
import PCA from 'area-data/pca'; 
import PCAA from 'area-data/pcaa'; 

pca['86'] // 等同于 AreaData['86']
// 所有省份:{'110000': '北京市', '120000': '天津市', '130000': '河北省', ...}

pcaa['130000'] // 等同于 AreaData['130000']
// 对应省份的所有城市:{'130100': '石家庄市', '130200': '唐山市', '130300': '秦皇岛市', ...}

pcaa['130200'] // 等同于 AreaData['130200']
// 对应市的所有县区:{'130201': '市辖区', '130202': '路南区', '130203': '路北区', ...}

### v1
AreaData['130202']
// 对应县区的所有街道:{'130202001000': '学院南路街道', '130202002000': '友谊街道', ...}

官方数据(截止到2016.07.31): 城乡区域划分

数据来源: 最新省市区数据来自 area-puppeteer.

LICENSE

MIT

More Repositories

1

blog

🐶 👏 🌟 Welcome to star
JavaScript
3,782
star
2

front-end-handbook

Front-end Developer HandBook. Read online: https://dwqs.gitbooks.io/frontenddevhandbook/content/
CSS
605
star
3

vue-area-linkage

省市区联动选择: https://dwqs.github.io/vue-area-linkage/
Vue
477
star
4

vue-to-react

🛠️ 👉 Try to transform Vue component to React component
JavaScript
431
star
5

area-puppeteer

基于 puppeteer 的中国行政区域抓取爬虫
JavaScript
169
star
6

react-style-guide

A mostly reasonable approach to React and JSX
157
star
7

vue-mobx

😄 ⭐ 😇 Mobx binding for Vuejs 2.
TypeScript
110
star
8

v2-table

A simple table component based Vue 2.x: https://dwqs.github.io/v2-table/
Vue
100
star
9

js2excel

😌 😃 👿 A simple module for excel and json converts each other, which works in the browser.
TypeScript
99
star
10

v2-datepicker

A simple datepicker component based Vue 2.x: https://dwqs.github.io/v2-datepicker/
JavaScript
90
star
11

tech-read

Grab tech articles daily from UGC communities
JavaScript
77
star
12

react-native-image-viewer

A pure JavaScript image viewer component for react-native apps with pan, pinch.etc, supporting both iOS and Android.
JavaScript
67
star
13

codewars-practices

Some best practices for practice questions on codewars, update it weekly
67
star
14

react-area-linkage

省市区联动选择: https://dwqs.github.io/react-area-linkage/
JavaScript
61
star
15

react-virtual-list

A tiny virtualization list component(gzipped 6KB), supports dynamic height: https://dwqs.github.io/react-virtual-list/
JavaScript
46
star
16

vue-startup

A template with webpack 4 + vuejs 2 + + babel 7 setup for projects startup
JavaScript
43
star
17

chare

A simple CLI scaffolding for front-end projects
JavaScript
35
star
18

vue-resume

A Personal Resume Template is powered by Vue,Node.js & Webpack:http://resume.ido321.com
Vue
34
star
19

react-demos

Some react demos for myself: https://dwqs.github.io/react-demos
JavaScript
33
star
20

node-style-guide

A guide for styling your node.js / JavaScript code.
32
star
21

v2-lazy-list

A simple lazy-load list component based Vue 2.x: https://dwqs.github.io/v2-lazy-list/
JavaScript
31
star
22

mp-jithub

Mini program for Github
Vue
30
star
23

vue-typescript

A template with webpack 4 + vuejs 2 + typescript 2 setup for projects startup
TypeScript
27
star
24

revuejs

🐇 A tiny, light and handy state management for vuejs 2, writing less verbose code.
JavaScript
24
star
25

vue-toast

A toast component written with Vue, designed based on Ant Design [deprecated]
Vue
18
star
26

webpack-mpvue-startup

A template with webpack 3 + mpvue 1 setup for projects startup
JavaScript
14
star
27

beautify-scrollbar

Beautify browser's scrollbars: https://dwqs.github.io/beautify-scrollbar/index
JavaScript
13
star
28

lue

🌱 Vue and vuex based library, writing less verbose code.
JavaScript
12
star
29

mpvue-markdown-parser

A markdown parser for mpvue
JavaScript
9
star
30

nx

A hexo theme based on landscape-plus
CSS
9
star
31

babel-plugin-on-demand-import

Babel plugin for importing components on demand
JavaScript
9
star
32

react-startup

A template with webpack 4 + react 16 + react-router 4 + babel 7 setup for projects startup
JavaScript
8
star
33

chrome-extension-for-wiki

🐔 🐮 🐼 Add awesome article link to your wiki repo on github quickly./快速添加文章链接到 wiki repo 的 chrome 扩展
JavaScript
7
star
34

async-await-error-handling

Error handling friendly for async/await in ts and js
JavaScript
7
star
35

reproto

A tool for generate simple random password which contains letters, number and special characters
JavaScript
6
star
36

icons

Some interesting icon & design implemented by pure css.
5
star
37

orbithub

A chrome extensition for convenient github search
JavaScript
5
star
38

redux-actions-promise

🐰 🐱 🐻 FSA-compliant promise middleware for Redux, supports referencing dispatcher/state in action.
TypeScript
5
star
39

maoxuan

教员选集阅读笔记
5
star
40

tiny-dom-helpers

🌜 🌚 🌛 Tiny dom helpers, supports IE9 +.
JavaScript
5
star
41

scroll-on-webview

处理 webview 上的滚动
JavaScript
4
star
42

infine

A chrome extension for theme color replacement of Github
CSS
4
star
43

note

Personal note sites, write what you want, support markdown: http://note.ido321.com/
JavaScript
3
star
44

view-star-packages-on-npm

View your star packages on npmjs.com: https://dwqs.github.io/view-star-packages-on-npm
JavaScript
3
star
45

async-react-compoment

😎 👀 🙈 Async component loaded based webpack 3 for react-router 4.[unmaintained]
TypeScript
2
star
46

gitlang

Repository to list all programming languages github supports
JavaScript
2
star