-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata.js
More file actions
361 lines (352 loc) · 11.2 KB
/
data.js
File metadata and controls
361 lines (352 loc) · 11.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
// 中国各省区数据
const provincesData = {
// 直辖市
'beijing': {
name: '北京市',
capital: '北京',
type: 'municipality',
center: [116.4074, 39.9042],
mapPath: 'M300,150 L350,150 L350,200 L300,200 Z',
capitalPos: [325, 175]
},
'tianjin': {
name: '天津市',
capital: '天津',
type: 'municipality',
center: [117.1901, 39.1037],
mapPath: 'M360,140 L400,140 L400,180 L360,180 Z',
capitalPos: [380, 160]
},
'shanghai': {
name: '上海市',
capital: '上海',
type: 'municipality',
center: [121.4737, 31.2304],
mapPath: 'M450,300 L490,300 L490,340 L450,340 Z',
capitalPos: [470, 320]
},
'chongqing': {
name: '重庆市',
capital: '重庆',
type: 'municipality',
center: [106.5048, 29.5343],
mapPath: 'M200,380 L250,380 L250,420 L200,420 Z',
capitalPos: [225, 400]
},
// 省份
'hebei': {
name: '河北省',
capital: '石家庄',
type: 'province',
center: [114.5149, 38.0428],
mapPath: 'M280,120 L380,120 L400,160 L380,200 L320,210 L280,180 Z',
capitalPos: [330, 160]
},
'shanxi': {
name: '山西省',
capital: '太原',
type: 'province',
center: [112.5488, 37.8706],
mapPath: 'M240,130 L280,120 L280,180 L240,190 Z',
capitalPos: [260, 155]
},
'liaoning': {
name: '辽宁省',
capital: '沈阳',
type: 'province',
center: [123.4297, 41.7963],
mapPath: 'M420,80 L480,80 L480,140 L420,140 Z',
capitalPos: [450, 110]
},
'jilin': {
name: '吉林省',
capital: '长春',
type: 'province',
center: [125.3245, 43.8868],
mapPath: 'M480,60 L540,60 L540,120 L480,120 Z',
capitalPos: [510, 90]
},
'heilongjiang': {
name: '黑龙江省',
capital: '哈尔滨',
type: 'province',
center: [126.6420, 45.7567],
mapPath: 'M500,20 L580,20 L580,80 L540,80 L500,60 Z',
capitalPos: [540, 50]
},
'jiangsu': {
name: '江苏省',
capital: '南京',
type: 'province',
center: [118.7672, 32.0415],
mapPath: 'M400,280 L460,280 L460,320 L400,320 Z',
capitalPos: [430, 300]
},
'zhejiang': {
name: '浙江省',
capital: '杭州',
type: 'province',
center: [120.1538, 30.2877],
mapPath: 'M460,320 L520,320 L520,370 L460,370 Z',
capitalPos: [490, 345]
},
'anhui': {
name: '安徽省',
capital: '合肥',
type: 'province',
center: [117.3272, 31.8612],
mapPath: 'M360,290 L420,290 L420,340 L360,340 Z',
capitalPos: [390, 315]
},
'fujian': {
name: '福建省',
capital: '福州',
type: 'province',
center: [119.3062, 26.0753],
mapPath: 'M480,400 L530,400 L530,450 L480,450 Z',
capitalPos: [505, 425]
},
'jiangxi': {
name: '江西省',
capital: '南昌',
type: 'province',
center: [115.8921, 28.6765],
mapPath: 'M400,360 L450,360 L450,410 L400,410 Z',
capitalPos: [425, 385]
},
'shandong': {
name: '山东省',
capital: '济南',
type: 'province',
center: [117.0009, 36.6758],
mapPath: 'M360,200 L440,200 L440,250 L360,250 Z',
capitalPos: [400, 225]
},
'henan': {
name: '河南省',
capital: '郑州',
type: 'province',
center: [113.6653, 34.7575],
mapPath: 'M320,210 L400,210 L400,270 L320,270 Z',
capitalPos: [360, 240]
},
'hubei': {
name: '湖北省',
capital: '武汉',
type: 'province',
center: [114.2989, 30.5844],
mapPath: 'M300,320 L380,320 L380,380 L300,380 Z',
capitalPos: [340, 350]
},
'hunan': {
name: '湖南省',
capital: '长沙',
type: 'province',
center: [112.9448, 28.2282],
mapPath: 'M280,380 L360,380 L360,440 L280,440 Z',
capitalPos: [320, 410]
},
'guangdong': {
name: '广东省',
capital: '广州',
type: 'province',
center: [113.2802, 23.1251],
mapPath: 'M320,480 L420,480 L420,540 L320,540 Z',
capitalPos: [370, 510]
},
'hainan': {
name: '海南省',
capital: '海口',
type: 'province',
center: [110.3312, 20.0312],
mapPath: 'M280,580 L320,580 L320,620 L280,620 Z',
capitalPos: [300, 600]
},
'sichuan': {
name: '四川省',
capital: '成都',
type: 'province',
center: [104.0648, 30.6595],
mapPath: 'M160,350 L240,350 L240,430 L160,430 Z',
capitalPos: [200, 390]
},
'guizhou': {
name: '贵州省',
capital: '贵阳',
type: 'province',
center: [106.7137, 26.5783],
mapPath: 'M200,440 L260,440 L260,490 L200,490 Z',
capitalPos: [230, 465]
},
'yunnan': {
name: '云南省',
capital: '昆明',
type: 'province',
center: [102.7123, 25.0406],
mapPath: 'M120,460 L200,460 L200,540 L120,540 Z',
capitalPos: [160, 500]
},
'shaanxi': {
name: '陕西省',
capital: '西安',
type: 'province',
center: [108.9482, 34.2635],
mapPath: 'M240,240 L300,240 L300,320 L240,320 Z',
capitalPos: [270, 280]
},
'gansu': {
name: '甘肃省',
capital: '兰州',
type: 'province',
center: [103.8343, 36.0611],
mapPath: 'M120,200 L220,200 L220,280 L120,280 Z',
capitalPos: [170, 240]
},
'qinghai': {
name: '青海省',
capital: '西宁',
type: 'province',
center: [101.7782, 36.6171],
mapPath: 'M80,240 L160,240 L160,320 L80,320 Z',
capitalPos: [120, 280]
},
// 自治区
'neimenggu': {
name: '内蒙古自治区',
capital: '呼和浩特',
type: 'autonomous_region',
center: [111.6708, 40.8183],
mapPath: 'M180,80 L420,80 L420,140 L180,140 Z',
capitalPos: [300, 110]
},
'guangxi': {
name: '广西壮族自治区',
capital: '南宁',
type: 'autonomous_region',
center: [108.3669, 22.8170],
mapPath: 'M240,500 L340,500 L340,560 L240,560 Z',
capitalPos: [290, 530]
},
'xizang': {
name: '西藏自治区',
capital: '拉萨',
type: 'autonomous_region',
center: [91.1322, 29.6602],
mapPath: 'M20,320 L140,320 L140,440 L20,440 Z',
capitalPos: [80, 380]
},
'ningxia': {
name: '宁夏回族自治区',
capital: '银川',
type: 'autonomous_region',
center: [106.2586, 38.4707],
mapPath: 'M200,180 L240,180 L240,220 L200,220 Z',
capitalPos: [220, 200]
},
'xinjiang': {
name: '新疆维吾尔自治区',
capital: '乌鲁木齐',
type: 'autonomous_region',
center: [87.6168, 43.7934],
mapPath: 'M20,80 L140,80 L140,200 L20,200 Z',
capitalPos: [80, 140]
},
// 特别行政区
'hongkong': {
name: '香港特别行政区',
capital: '香港',
type: 'special_region',
center: [114.1694, 22.3193],
mapPath: 'M410,530 L430,530 L430,550 L410,550 Z',
capitalPos: [420, 540]
},
'macao': {
name: '澳门特别行政区',
capital: '澳门',
type: 'special_region',
center: [113.5491, 22.1987],
mapPath: 'M400,540 L420,540 L420,560 L400,560 Z',
capitalPos: [410, 550]
}
};
// 中国地图简化路径数据
const chinaMapPaths = {
'beijing': 'M300,150 L350,150 L350,200 L300,200 Z',
'tianjin': 'M360,140 L400,140 L400,180 L360,180 Z',
'hebei': 'M280,120 L380,120 L400,160 L380,200 L320,210 L280,180 Z',
'shanxi': 'M240,130 L280,120 L280,180 L240,190 Z',
'neimenggu': 'M180,80 L420,80 L420,140 L180,140 Z',
'liaoning': 'M420,80 L480,80 L480,140 L420,140 Z',
'jilin': 'M480,60 L540,60 L540,120 L480,120 Z',
'heilongjiang': 'M500,20 L580,20 L580,80 L540,80 L500,60 Z',
'shanghai': 'M450,300 L490,300 L490,340 L450,340 Z',
'jiangsu': 'M400,280 L460,280 L460,320 L400,320 Z',
'zhejiang': 'M460,320 L520,320 L520,370 L460,370 Z',
'anhui': 'M360,290 L420,290 L420,340 L360,340 Z',
'fujian': 'M480,400 L530,400 L530,450 L480,450 Z',
'jiangxi': 'M400,360 L450,360 L450,410 L400,410 Z',
'shandong': 'M360,200 L440,200 L440,250 L360,250 Z',
'henan': 'M320,210 L400,210 L400,270 L320,270 Z',
'hubei': 'M300,320 L380,320 L380,380 L300,380 Z',
'hunan': 'M280,380 L360,380 L360,440 L280,440 Z',
'guangdong': 'M320,480 L420,480 L420,540 L320,540 Z',
'guangxi': 'M240,500 L340,500 L340,560 L240,560 Z',
'hainan': 'M280,580 L320,580 L320,620 L280,620 Z',
'chongqing': 'M200,380 L250,380 L250,420 L200,420 Z',
'sichuan': 'M160,350 L240,350 L240,430 L160,430 Z',
'guizhou': 'M200,440 L260,440 L260,490 L200,490 Z',
'yunnan': 'M120,460 L200,460 L200,540 L120,540 Z',
'xizang': 'M20,320 L140,320 L140,440 L20,440 Z',
'shaanxi': 'M240,240 L300,240 L300,320 L240,320 Z',
'gansu': 'M120,200 L220,200 L220,280 L120,280 Z',
'qinghai': 'M80,240 L160,240 L160,320 L80,320 Z',
'ningxia': 'M200,180 L240,180 L240,220 L200,220 Z',
'xinjiang': 'M20,80 L140,80 L140,200 L20,200 Z',
'hongkong': 'M410,530 L430,530 L430,550 L410,550 Z',
'macao': 'M400,540 L420,540 L420,560 L400,560 Z'
};
// 省份详细地图路径(简化版本,用于单独显示)
const provinceDetailPaths = {
'beijing': {
outline: 'M50,50 L350,50 L350,350 L50,350 Z',
districts: [
{ name: '朝阳区', path: 'M200,100 L300,100 L300,200 L200,200 Z' },
{ name: '海淀区', path: 'M100,100 L200,100 L200,200 L100,200 Z' },
{ name: '西城区', path: 'M150,200 L250,200 L250,250 L150,250 Z' },
{ name: '东城区', path: 'M150,150 L250,150 L250,200 L150,200 Z' }
]
},
'shanghai': {
outline: 'M80,80 L320,80 L320,320 L80,320 Z',
districts: [
{ name: '浦东新区', path: 'M200,120 L280,120 L280,280 L200,280 Z' },
{ name: '黄浦区', path: 'M160,180 L200,180 L200,220 L160,220 Z' },
{ name: '静安区', path: 'M120,140 L160,140 L160,180 L120,180 Z' }
]
}
// 可以根据需要添加更多省份的详细地图
};
// 获取所有省份名称列表
function getAllProvinces() {
return Object.keys(provincesData);
}
// 获取省份信息
function getProvinceInfo(provinceId) {
return provincesData[provinceId];
}
// 获取随机省份
function getRandomProvince() {
const provinces = getAllProvinces();
const randomIndex = Math.floor(Math.random() * provinces.length);
return provinces[randomIndex];
}
// 获取省份类型的中文描述
function getProvinceTypeText(type) {
const typeMap = {
'province': '省',
'municipality': '直辖市',
'autonomous_region': '自治区',
'special_region': '特别行政区'
};
return typeMap[type] || '';
}