Merge pull request #400 from antvis/district_data

District data
This commit is contained in:
@thinkinggis 2020-06-11 16:20:48 +08:00 committed by GitHub
commit 0a65c417bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 122 additions and 181 deletions

View File

@ -190,6 +190,9 @@ scene.on('loaded', () => {
data: ProvinceData, data: ProvinceData,
joinBy: [ 'NAME_CHN', 'name' ], joinBy: [ 'NAME_CHN', 'name' ],
depth: 1, depth: 1,
provinceStroke: '#783D2D',
cityStroke: '#EBCCB4',
cityStrokeWidth: 1,
fill: { fill: {
color: { color: {
field: 'NAME_CHN', field: 'NAME_CHN',

View File

@ -9,7 +9,7 @@ const scene = new Scene({
style: 'blank', style: 'blank',
zoom: 0, zoom: 0,
minZoom: 0, minZoom: 0,
maxZoom: 10 maxZoom: 5
}) })
}); });
scene.on('loaded', () => { scene.on('loaded', () => {

View File

@ -7,12 +7,12 @@ const dataLevel2: { [key: string]: any } = {
fill: { fill: {
type: 'pbf', type: 'pbf',
url: url:
'https://gw.alipayobjects.com/os/bmw-prod/d666a08d-fce1-48e2-913a-87d81772bcc9.bin', 'https://gw.alipayobjects.com/os/bmw-prod/e66cdd3f-cd41-4533-9746-d8fdbe0a0056.bin',
}, },
line: { line: {
type: 'pbf', type: 'pbf',
url: url:
'https://gw.alipayobjects.com/os/bmw-prod/62f61f5f-cca7-4137-845d-13c8f9969664.bin', 'https://gw.alipayobjects.com/os/bmw-prod/f1b0fd97-ac90-4adb-b99c-01709e0e52c8.bin',
}, },
label: { label: {
type: 'pbf', type: 'pbf',

View File

@ -29,7 +29,6 @@
"@antv/l7-utils": "^2.2.12", "@antv/l7-utils": "^2.2.12",
"@babel/runtime": "^7.7.7", "@babel/runtime": "^7.7.7",
"@types/amap-js-api": "^1.4.6", "@types/amap-js-api": "^1.4.6",
"antd": "4.2.5",
"gl-matrix": "^3.1.0", "gl-matrix": "^3.1.0",
"inversify": "^5.0.1", "inversify": "^5.0.1",
"mapbox-gl": "^1.2.1", "mapbox-gl": "^1.2.1",

View File

@ -197,7 +197,7 @@ export default class Country extends React.Component {
]; ];
scene.on('loaded', () => { scene.on('loaded', () => {
const Layer = new CountryLayer(scene, { const Layer = new CountryLayer(scene, {
visible: false, visible: true,
data: ProvinceData, data: ProvinceData,
joinBy: ['NAME_CHN', 'name'], joinBy: ['NAME_CHN', 'name'],
// label: { // label: {

View File

@ -23,254 +23,187 @@ export default class Country extends React.Component {
maxZoom: 4, maxZoom: 4,
}), }),
}); });
const data = [ const ProvinceData = [
{ {
name: '湖北', name: '云南省',
confirm: 16678, code: 530000,
suspect: 0, value: 17881.12,
heal: 533,
dead: 479,
}, },
{ {
name: '广东', name: '黑龙江省',
confirm: 895, code: 230000,
suspect: 0, value: 16361.62,
heal: 37,
dead: 0,
}, },
{ {
name: '浙江', name: '贵州省',
confirm: 895, code: 520000,
suspect: 0, value: 14806.45,
heal: 65,
dead: 0,
}, },
{ {
name: '河南', name: '北京市',
confirm: 764, code: 110000,
suspect: 0, value: 30319.98,
heal: 41,
dead: 2,
}, },
{ {
name: '湖南', name: '河北省',
confirm: 661, code: 130000,
suspect: 0, value: 36010.27,
heal: 35,
dead: 0,
}, },
{ {
name: '江西', name: '山西省',
confirm: 548, code: 140000,
suspect: 0, value: 16818.11,
heal: 27,
dead: 0,
}, },
{ {
name: '安徽', name: '吉林省',
confirm: 530, code: 220000,
suspect: 0, value: 15074,
heal: 20,
dead: 0,
}, },
{ {
name: '重庆', name: '宁夏回族自治区',
confirm: 376, code: 640000,
suspect: 0, value: 3705.18,
heal: 15,
dead: 2,
}, },
{ {
name: '江苏', name: '辽宁省',
confirm: 341, code: 210000,
suspect: 0, value: 25315.35,
heal: 13,
dead: 0,
}, },
{ {
name: '山东', name: '海南省',
confirm: 307, code: 460000,
suspect: 0, value: 4832.05,
heal: 13,
dead: 0,
}, },
{ {
name: '四川', name: '内蒙古自治区',
confirm: 301, code: 150000,
suspect: 0, value: 17289.22,
heal: 23,
dead: 1,
}, },
{ {
name: '北京', name: '天津市',
confirm: 253, code: 120000,
suspect: 0, value: 18809.64,
heal: 24,
dead: 1,
}, },
{ {
name: '上海', name: '新疆维吾尔自治区',
confirm: 243, code: 650000,
suspect: 0, value: 12199.08,
heal: 15,
dead: 1,
}, },
{ {
name: '福建', name: '上海市',
confirm: 205, code: 310000,
suspect: 0, value: 32679.87,
heal: 7,
dead: 0,
}, },
{ {
name: '黑龙江', name: '陕西省',
confirm: 190, code: 610000,
suspect: 0, value: 24438.32,
heal: 7,
dead: 2,
}, },
{ {
name: '陕西', name: '甘肃省',
confirm: 165, code: 620000,
suspect: 0, value: 8246.07,
heal: 6,
dead: 0,
}, },
{ {
name: '广西', name: '安徽省',
confirm: 150, code: 340000,
suspect: 0, value: 30006.82,
heal: 10,
dead: 0,
}, },
{ {
name: '河北', name: '香港特别行政区',
confirm: 135, code: 810000,
suspect: 0, value: 0,
heal: 4,
dead: 1,
}, },
{ {
name: '云南', name: '广东省',
confirm: 124, code: 440000,
suspect: 0, value: 97277.77,
heal: 5,
dead: 0,
}, },
{ {
name: '海南', name: '河南省',
confirm: 91, code: 410000,
suspect: 0, value: 48055.86,
heal: 4,
dead: 1,
}, },
{ {
name: '辽宁', name: '湖南省',
confirm: 81, code: 430000,
suspect: 0, value: 36425.78,
heal: 3,
dead: 0,
}, },
{ {
name: '山西', name: '江西省',
confirm: 81, code: 360000,
suspect: 0, value: 21984.78,
heal: 4,
dead: 0,
}, },
{ {
name: '天津', name: '四川省',
confirm: 69, code: 510000,
suspect: 0, value: 40678.13,
heal: 2,
dead: 1,
}, },
{ {
name: '贵州', name: '广西壮族自治区',
confirm: 64, code: 450000,
suspect: 0, value: 20353.51,
heal: 8,
dead: 0,
}, },
{ {
name: '甘肃', name: '江苏省',
confirm: 57, code: 320000,
suspect: 0, value: 92595.4,
heal: 4,
dead: 0,
}, },
{ {
name: '吉林', name: '澳门特别行政区',
confirm: 54, code: 820000,
suspect: 0, value: null,
heal: 1,
dead: 0,
}, },
{ {
name: '内蒙古', name: '浙江省',
confirm: 42, code: 330000,
suspect: 0, value: 56197.15,
heal: 3,
dead: 0,
}, },
{ {
name: '宁夏', name: '山东省',
confirm: 34, code: 370000,
suspect: 0, value: 76469.67,
heal: 1,
dead: 0,
}, },
{ {
name: '新疆', name: '青海省',
confirm: 32, code: 630000,
suspect: 0, value: 2865.23,
heal: 0,
dead: 0,
}, },
{ {
name: '香港', name: '重庆市',
confirm: 18, code: 500000,
suspect: 0, value: 20363.19,
heal: 0,
dead: 1,
}, },
{ {
name: '青海', name: '福建省',
confirm: 17, code: 350000,
suspect: 0, value: 35804.04,
heal: 3,
dead: 0,
}, },
{ {
name: '台湾', name: '湖北省',
confirm: 11, code: 420000,
suspect: 0, value: 39366.55,
heal: 0,
dead: 0,
}, },
{ {
name: '澳门', name: '西藏自治区',
confirm: 10, code: 540000,
suspect: 0, value: 1477.63,
heal: 0,
dead: 0,
}, },
{ {
name: '西藏', name: '台湾省',
confirm: 1, code: 710000,
suspect: 0, value: null,
heal: 0,
dead: 0,
}, },
]; ];
scene.on('loaded', () => { scene.on('loaded', () => {
const Layer = new CountryLayer(scene, { const Layer = new CountryLayer(scene, {
data, data: ProvinceData,
depth: 1, depth: 1,
joinBy: ['NAME_CHN', 'name'],
fill: { fill: {
scale: 'quantile', scale: 'quantile',
color: { color: {
field: 'confirm', field: 'value',
values: [ values: [
'#feedde', '#feedde',
'#fdd0a2', '#fdd0a2',
@ -299,7 +232,7 @@ export default class Country extends React.Component {
}); });
scene2.on('loaded', () => { scene2.on('loaded', () => {
const Layer2 = new CountryLayer(scene2, { const Layer2 = new CountryLayer(scene2, {
data, data: ProvinceData,
label: { label: {
enable: false, enable: false,
}, },
@ -307,10 +240,16 @@ export default class Country extends React.Component {
enable: false, enable: false,
}, },
autoFit: false, autoFit: false,
// label: {
// field: 'NAME_CHN',
// textAllowOverlap: true,
// },
depth: 1,
joinBy: ['NAME_CHN', 'name'],
fill: { fill: {
scale: 'quantile', scale: 'quantile',
color: { color: {
field: 'confirm', field: 'value',
values: [ values: [
'#feedde', '#feedde',
'#fdd0a2', '#fdd0a2',

View File

@ -27,7 +27,7 @@ export default class Country extends React.Component {
const Layer = new WorldLayer(scene, { const Layer = new WorldLayer(scene, {
data: [], data: [],
bubble: { bubble: {
enable: true, enable: false,
color: { color: {
field: 'NAME_CHN', field: 'NAME_CHN',
values: [ values: [