diff --git a/examples/district/basic/API.en.md b/examples/district/basic/API.en.md deleted file mode 100644 index 3e8b07eff2..0000000000 --- a/examples/district/basic/API.en.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: API ---- -`markdown:docs/api/district/baselayer.zh.md` diff --git a/examples/district/basic/API.zh.md b/examples/district/basic/API.zh.md deleted file mode 100644 index 19fa5e5ef6..0000000000 --- a/examples/district/basic/API.zh.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: API ---- -`markdown:docs/api/district/baselayer.zh.md` - diff --git a/examples/district/basic/demo/attach_map.js b/examples/district/basic/demo/attach_map.js deleted file mode 100644 index 284bebcf20..0000000000 --- a/examples/district/basic/demo/attach_map.js +++ /dev/null @@ -1,92 +0,0 @@ -import { Scene } from '@antv/l7'; -import { CountryLayer } from '@antv/l7-district'; -import { Mapbox } from '@antv/l7-maps'; -const colors = [ '#B8E1FF', '#7DAAFF', '#3D76DD', '#0047A5', '#001D70' ]; -const scene = new Scene({ - id: 'map', - map: new Mapbox({ - center: [ 116.2825, 39.9 ], - pitch: 0, - style: 'blank', - zoom: 3, - minZoom: 0, - maxZoom: 10 - }) -}); -const attachMapContainer = document.createElement('div'); -attachMapContainer.id = 'attach'; -attachMapContainer.style.cssText = `position: absolute; -height: 125px; -width: 98px; -right: 50px; -bottom: 20px; -border: 1px solid #333;`; -document.getElementById('map').parentElement.append(attachMapContainer); - -scene.on('loaded', () => { - new CountryLayer(scene, { - data: [], - joinBy: [ 'NAME_CHN', 'name' ], - depth: 1, - provinceStroke: '#fff', - cityStroke: '#EBCCB4', - cityStrokeWidth: 1, - label: { - enable: false - }, - fill: { - color: { - field: 'NAME_CHN', - values: colors - } - }, - popup: { - enable: true, - Html: props => { - return `${props.NAME_CHN}`; - } - } - }); -}); - -// 添加附图,附图需要和主图保持一致 - -const scene2 = new Scene({ - id: 'attach', - logoVisible: false, - map: new Mapbox({ - center: [ 113.60540108435657, 12.833692637803168 ], - pitch: 0, - style: 'blank', - zoom: 1.93, - minZoom: 0, - maxZoom: 3, - interactive: false - }) -}); -scene2.on('loaded', () => { - new CountryLayer(scene2, { - data: [], - label: { - enable: false - }, - popup: { - enable: false - }, - autoFit: false, - depth: 1, - fill: { - color: { - field: 'NAME_CHN', - values: [ - '#feedde', - '#fdd0a2', - '#fdae6b', - '#fd8d3c', - '#e6550d', - '#a63603' - ] - } - } - }); -}); diff --git a/examples/district/basic/demo/china_map_2.js b/examples/district/basic/demo/china_map_2.js deleted file mode 100644 index 61884937ff..0000000000 --- a/examples/district/basic/demo/china_map_2.js +++ /dev/null @@ -1,210 +0,0 @@ -import { Scene } from '@antv/l7'; -import { CountryLayer } from '@antv/l7-district'; -import { Mapbox } from '@antv/l7-maps'; -const colors = [ '#B8E1FF', '#7DAAFF', '#3D76DD', '#0047A5', '#001D70' ]; -const ProvinceData = [ - { - name: '云南省', - code: 530000, - value: 17881.12 - }, - { - name: '黑龙江省', - code: 230000, - value: 16361.62 - }, - { - name: '贵州省', - code: 520000, - value: 14806.45 - }, - { - name: '北京市', - code: 110000, - value: 30319.98 - }, - { - name: '河北省', - code: 130000, - value: 36010.27 - }, - { - name: '山西省', - code: 140000, - value: 16818.11 - }, - { - name: '吉林省', - code: 220000, - value: 15074 - }, - { - name: '宁夏回族自治区', - code: 640000, - value: 3705.18 - }, - { - name: '辽宁省', - code: 210000, - value: 25315.35 - }, - { - name: '海南省', - code: 460000, - value: 4832.05 - }, - { - name: '内蒙古自治区', - code: 150000, - value: 17289.22 - }, - { - name: '天津市', - code: 120000, - value: 18809.64 - }, - { - name: '新疆维吾尔自治区', - code: 650000, - value: 12199.08 - }, - { - name: '上海市', - code: 310000, - value: 32679.87 - }, - { - name: '陕西省', - code: 610000, - value: 24438.32 - }, - { - name: '甘肃省', - code: 620000, - value: 8246.07 - }, - { - name: '安徽省', - code: 340000, - value: 30006.82 - }, - { - name: '香港特别行政区', - code: 810000, - value: 0 - }, - { - name: '广东省', - code: 440000, - value: 97277.77 - }, - { - name: '河南省', - code: 410000, - value: 48055.86 - }, - { - name: '湖南省', - code: 430000, - value: 36425.78 - }, - { - name: '江西省', - code: 360000, - value: 21984.78 - }, - { - name: '四川省', - code: 510000, - value: 40678.13 - }, - { - name: '广西壮族自治区', - code: 450000, - value: 20353.51 - }, - { - name: '江苏省', - code: 320000, - value: 92595.4 - }, - { - name: '澳门特别行政区', - code: 820000, - value: null - }, - { - name: '浙江省', - code: 330000, - value: 56197.15 - }, - { - name: '山东省', - code: 370000, - value: 76469.67 - }, - { - name: '青海省', - code: 630000, - value: 2865.23 - }, - { - name: '重庆市', - code: 500000, - value: 20363.19 - }, - { - name: '福建省', - code: 350000, - value: 35804.04 - }, - { - name: '湖北省', - code: 420000, - value: 39366.55 - }, - { - name: '西藏自治区', - code: 540000, - value: 1477.63 - }, - { - name: '台湾省', - code: 710000, - value: null - } -]; -const scene = new Scene({ - id: 'map', - map: new Mapbox({ - center: [ 116.2825, 39.9 ], - pitch: 0, - style: 'blank', - zoom: 3, - minZoom: 0, - maxZoom: 10 - }) -}); - -scene.on('loaded', () => { - new CountryLayer(scene, { - data: ProvinceData, - joinBy: [ 'NAME_CHN', 'name' ], - depth: 1, - provinceStroke: '#fff', - cityStroke: '#EBCCB4', - cityStrokeWidth: 1, - fill: { - color: { - field: 'NAME_CHN', - values: colors - } - }, - popup: { - enable: true, - Html: props => { - return `${props.NAME_CHN}`; - } - } - }); -}); diff --git a/examples/district/basic/demo/city.js b/examples/district/basic/demo/city.js deleted file mode 100644 index ec31b9bff8..0000000000 --- a/examples/district/basic/demo/city.js +++ /dev/null @@ -1,56 +0,0 @@ -import { Scene } from '@antv/l7'; -import { CityLayer } from '@antv/l7-district'; -import { Mapbox } from '@antv/l7-maps'; -const colors = [ '#B8E1FF', '#7DAAFF', '#3D76DD', '#0047A5', '#001D70' ]; - -async function initMap() { - const response = await fetch( - 'https://gw.alipayobjects.com/os/bmw-prod/149b599d-21ef-4c24-812c-20deaee90e20.json' - ); - const provinceData = await response.json(); - const data = Object.keys(provinceData).map(key => { - return { - code: key, - name: provinceData[key][0], - pop: provinceData[key][2] * 1 - }; - }); - - const scene = new Scene({ - id: 'map', - map: new Mapbox({ - center: [ 116.2825, 39.9 ], - pitch: 0, - style: 'blank', - zoom: 3, - minZoom: 3, - maxZoom: 10 - }) - }); - scene.on('loaded', () => { - new CityLayer(scene, { - data, - joinBy: [ 'adcode', 'code' ], - adcode: [ '330000', '330100' ], - depth: 3, - label: { - field: 'NAME_CHN', - textAllowOverlap: false - }, - fill: { - color: { field: 'pop', - values: colors - } - }, - popup: { - enable: true, - Html: props => { - return `${props.NAME_CHN}:${props.pop}`; - } - } - }); - }); - -} - -initMap(); diff --git a/examples/district/basic/demo/county.js b/examples/district/basic/demo/county.js deleted file mode 100644 index fb4381f1eb..0000000000 --- a/examples/district/basic/demo/county.js +++ /dev/null @@ -1,37 +0,0 @@ -import { Scene } from '@antv/l7'; -import { CountyLayer } from '@antv/l7-district'; -import { Mapbox } from '@antv/l7-maps'; -const colors = [ '#B8E1FF', '#7DAAFF', '#3D76DD', '#0047A5', '#001D70' ]; -const scene = new Scene({ - id: 'map', - map: new Mapbox({ - center: [ 116.2825, 39.9 ], - pitch: 0, - style: 'blank', - zoom: 3, - minZoom: 3, - maxZoom: 10 - }) -}); -scene.on('loaded', () => { - new CountyLayer(scene, { - data: [], - adcode: [ '110101', '110102', '110106' ], - depth: 3, - label: { - field: 'NAME_CHN' - }, - fill: { - color: { - field: 'NAME_CHN', - values: colors - } - }, - popup: { - enable: true, - Html: props => { - return `${props.NAME_CHN}`; - } - } - }); -}); diff --git a/examples/district/basic/demo/hainan.js b/examples/district/basic/demo/hainan.js deleted file mode 100644 index 3925965616..0000000000 --- a/examples/district/basic/demo/hainan.js +++ /dev/null @@ -1,106 +0,0 @@ -import { Scene } from '@antv/l7'; -import { ProvinceLayer, CountryLayer } from '@antv/l7-district'; -import { Mapbox } from '@antv/l7-maps'; -async function initMap() { - const scene = new Scene({ - id: 'map', - map: new Mapbox({ - center: [ 109.803, 19.347 ], - pitch: 0, - style: 'blank', - zoom: 7, - minZoom: 6, - maxZoom: 11 - }) - }); - const attachMapContainer = document.createElement('div'); - attachMapContainer.id = 'attach'; - attachMapContainer.style.cssText = `position: absolute; - height: 125px; - width: 98px; - right: 50px; - bottom: 20px; - border: 1px solid #333;`; - document.getElementById('map').parentElement.append(attachMapContainer); - scene.on('loaded', () => { - new ProvinceLayer(scene, { - data: [], - geoDataLevel: 1, - autoFit: false, - joinBy: [ 'adcode', 'code' ], - adcode: [ '460000' ], - depth: 2, - stroke: '#aaa', - label: { - enable: false, - field: 'NAME_CHN', - textAllowOverlap: false - }, - fill: { - color: '#A3d7FF' - }, - popup: { - enable: false, - Html: props => { - return `${props.NAME_CHN}:${props.pop}`; - } - } - }); - }); - - const scene2 = new Scene({ - id: 'attach', - logoVisible: false, - map: new Mapbox({ - center: [ 113.60540108435657, 12.833692637803168 ], - pitch: 0, - style: 'blank', - zoom: 1.93, - // zoom: 3, - minZoom: 0, - maxZoom: 3, - interactive: false - }) - }); - scene2.on('loaded', () => { - new CountryLayer(scene2, { - data: [], - label: { - enable: false - }, - popup: { - enable: false - }, - autoFit: false, - provinceStroke: '#aaa', - depth: 1, - fill: { - color: '#A3d7FF' - } - }); - new ProvinceLayer(scene2, { - data: [], - autoFit: false, - adcode: [ '460000' ], - depth: 2, - zIndex: 2, - stroke: '#aaa', - strokeWidth: 0.1, - label: { - enable: false, - field: 'NAME_CHN', - textAllowOverlap: false - }, - fill: { - color: '#A3d7ff' - }, - popup: { - enable: false, - Html: props => { - return `${props.NAME_CHN}:${props.pop}`; - } - } - }); - }); -} -initMap(); diff --git a/examples/district/basic/demo/meta.json b/examples/district/basic/demo/meta.json deleted file mode 100644 index bfbc9bb108..0000000000 --- a/examples/district/basic/demo/meta.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "title": { - "zh": "行政区划", - "en": "District" - }, - "demos": [ - { - "filename": "china_map_2.js", - "title": "中国地图", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_8e1672/afts/img/A*tClNQoAo5isAAAAAAAAAAABkARQnAQ" - }, - { - "filename": "world_map.js", - "title": "世界地图", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_8e1672/afts/img/A*EtRFRYyGs98AAAAAAAAAAABkARQnAQ" - }, - { - "filename": "province.js", - "title": "中国省级地图", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_8e1672/afts/img/A*eVVcRaCBkdYAAAAAAAAAAABkARQnAQ" - }, - { - "filename": "city.js", - "title": "中国市地图", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_8e1672/afts/img/A*C_y8Tr0V8GIAAAAAAAAAAABkARQnAQ" - }, - { - "filename": "county.js", - "title": "中国县地图", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_8e1672/afts/img/A*iVwLSpIf_ckAAAAAAAAAAABkARQnAQ" - }, - { - "filename": "attach_map.js", - "title": "中国地图附图", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_855bab/afts/img/A*bGX-Tbw5uVAAAAAAAAAAAABkARQnAQ" - }, - { - "filename": "hainan.js", - "title": "海南省地图", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_855bab/afts/img/A*nHOTQ61hFbYAAAAAAAAAAABkARQnAQ" - } - ] -} diff --git a/examples/district/basic/demo/province.js b/examples/district/basic/demo/province.js deleted file mode 100644 index 92c6b65b55..0000000000 --- a/examples/district/basic/demo/province.js +++ /dev/null @@ -1,55 +0,0 @@ -import { Scene } from '@antv/l7'; -import { ProvinceLayer } from '@antv/l7-district'; -import { Mapbox } from '@antv/l7-maps'; -const colors = [ '#B8E1FF', '#7DAAFF', '#3D76DD', '#0047A5', '#001D70' ]; -async function initMap() { - const response = await fetch( - 'https://gw.alipayobjects.com/os/bmw-prod/149b599d-21ef-4c24-812c-20deaee90e20.json' - ); - const provinceData = await response.json(); - const data = Object.keys(provinceData).map(key => { - return { - code: key, - name: provinceData[key][0], - pop: provinceData[key][2] * 1 - }; - }); - - const scene = new Scene({ - id: 'map', - map: new Mapbox({ - center: [ 116.2825, 39.9 ], - pitch: 0, - style: 'blank', - zoom: 3, - minZoom: 3, - maxZoom: 10 - }) - }); - - scene.on('loaded', () => { - new ProvinceLayer(scene, { - data, - joinBy: [ 'adcode', 'code' ], - adcode: [ '330000' ], - depth: 3, - label: { - field: 'NAME_CHN', - textAllowOverlap: false - }, - fill: { - color: { - field: 'pop', - values: colors - } - }, - popup: { - enable: true, - Html: props => { - return `${props.NAME_CHN}:${props.pop}`; - } - } - }); - }); -} -initMap(); diff --git a/examples/district/basic/demo/world_map.js b/examples/district/basic/demo/world_map.js deleted file mode 100644 index 76eda2a070..0000000000 --- a/examples/district/basic/demo/world_map.js +++ /dev/null @@ -1,44 +0,0 @@ -import { Scene } from '@antv/l7'; -import { WorldLayer } from '@antv/l7-district'; -import { Mapbox } from '@antv/l7-maps'; -const scene = new Scene({ - id: 'map', - map: new Mapbox({ - center: [ 116.2825, 39.9 ], - pitch: 0, - style: 'blank', - zoom: 0, - minZoom: 0, - maxZoom: 5 - }) -}); -scene.on('loaded', () => { - new WorldLayer(scene, { - data: [], - fill: { - color: { - field: 'NAME_CHN', - values: [ - '#feedde', - '#fdd0a2', - '#fdae6b', - '#fd8d3c', - '#e6550d', - '#a63603' - ] - } - }, - stroke: '#ccc', - label: { - enable: true, - textAllowOverlap: false, - field: 'NAME_CHN' - }, - popup: { - enable: false, - Html: props => { - return `${props.NAME_CHN}`; - } - } - }); -}); diff --git a/examples/district/basic/index.en.md b/examples/district/basic/index.en.md deleted file mode 100644 index c8af4d906c..0000000000 --- a/examples/district/basic/index.en.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: L7 District -order: 0 ---- diff --git a/examples/district/basic/index.zh.md b/examples/district/basic/index.zh.md deleted file mode 100644 index afba1bfa88..0000000000 --- a/examples/district/basic/index.zh.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: 填充图 -order: 1 ---- diff --git a/examples/district/bubble/API.en.md b/examples/district/bubble/API.en.md deleted file mode 100644 index 3e8b07eff2..0000000000 --- a/examples/district/bubble/API.en.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: API ---- -`markdown:docs/api/district/baselayer.zh.md` diff --git a/examples/district/bubble/API.zh.md b/examples/district/bubble/API.zh.md deleted file mode 100644 index 3e8b07eff2..0000000000 --- a/examples/district/bubble/API.zh.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: API ---- -`markdown:docs/api/district/baselayer.zh.md` diff --git a/examples/district/bubble/demo/china_bubble.js b/examples/district/bubble/demo/china_bubble.js deleted file mode 100644 index f0195bc8ae..0000000000 --- a/examples/district/bubble/demo/china_bubble.js +++ /dev/null @@ -1,210 +0,0 @@ -import { Scene } from '@antv/l7'; -import { CountryLayer } from '@antv/l7-district'; -import { Mapbox } from '@antv/l7-maps'; -const ProvinceData = [ - { - name: '云南省', - code: 530000, - value: 17881.12 - }, - { - name: '黑龙江省', - code: 230000, - value: 16361.62 - }, - { - name: '贵州省', - code: 520000, - value: 14806.45 - }, - { - name: '北京市', - code: 110000, - value: 30319.98 - }, - { - name: '河北省', - code: 130000, - value: 36010.27 - }, - { - name: '山西省', - code: 140000, - value: 16818.11 - }, - { - name: '吉林省', - code: 220000, - value: 15074 - }, - { - name: '宁夏回族自治区', - code: 640000, - value: 3705.18 - }, - { - name: '辽宁省', - code: 210000, - value: 25315.35 - }, - { - name: '海南省', - code: 460000, - value: 4832.05 - }, - { - name: '内蒙古自治区', - code: 150000, - value: 17289.22 - }, - { - name: '天津市', - code: 120000, - value: 18809.64 - }, - { - name: '新疆维吾尔自治区', - code: 650000, - value: 12199.08 - }, - { - name: '上海市', - code: 310000, - value: 32679.87 - }, - { - name: '陕西省', - code: 610000, - value: 24438.32 - }, - { - name: '甘肃省', - code: 620000, - value: 8246.07 - }, - { - name: '安徽省', - code: 340000, - value: 30006.82 - }, - { - name: '香港特别行政区', - code: 810000, - value: 0 - }, - { - name: '广东省', - code: 440000, - value: 97277.77 - }, - { - name: '河南省', - code: 410000, - value: 48055.86 - }, - { - name: '湖南省', - code: 430000, - value: 36425.78 - }, - { - name: '江西省', - code: 360000, - value: 21984.78 - }, - { - name: '四川省', - code: 510000, - value: 40678.13 - }, - { - name: '广西壮族自治区', - code: 450000, - value: 20353.51 - }, - { - name: '江苏省', - code: 320000, - value: 92595.4 - }, - { - name: '澳门特别行政区', - code: 820000, - value: null - }, - { - name: '浙江省', - code: 330000, - value: 56197.15 - }, - { - name: '山东省', - code: 370000, - value: 76469.67 - }, - { - name: '青海省', - code: 630000, - value: 2865.23 - }, - { - name: '重庆市', - code: 500000, - value: 20363.19 - }, - { - name: '福建省', - code: 350000, - value: 35804.04 - }, - { - name: '湖北省', - code: 420000, - value: 39366.55 - }, - { - name: '西藏自治区', - code: 540000, - value: 1477.63 - }, - { - name: '台湾省', - code: 710000, - value: null - } -]; -const scene = new Scene({ - id: 'map', - map: new Mapbox({ - center: [ 116.2825, 39.9 ], - pitch: 0, - style: 'blank', - zoom: 3, - minZoom: 0, - maxZoom: 10 - }) -}); - -scene.on('loaded', () => { - new CountryLayer(scene, { - data: ProvinceData, - joinBy: [ 'NAME_CHN', 'name' ], - depth: 1, - fill: { - color: '#ccc' - }, - bubble: { - enable: true, - size: { - field: 'value', - values: [ 3, 20 ] - } - }, - popup: { - enable: true, - Html: props => { - return `${props.NAME_CHN}:${props.value}`; - } - } - }); -}); diff --git a/examples/district/bubble/demo/city.js b/examples/district/bubble/demo/city.js deleted file mode 100644 index c76210997a..0000000000 --- a/examples/district/bubble/demo/city.js +++ /dev/null @@ -1,57 +0,0 @@ -import { Scene } from '@antv/l7'; -import { CityLayer } from '@antv/l7-district'; -import { Mapbox } from '@antv/l7-maps'; - -async function initMap() { - const response = await fetch( - 'https://gw.alipayobjects.com/os/bmw-prod/149b599d-21ef-4c24-812c-20deaee90e20.json' - ); - const provinceData = await response.json(); - const data = Object.keys(provinceData).map(key => { - return { - code: key, - name: provinceData[key][0], - pop: provinceData[key][2] * 1 - }; - }); - - const scene = new Scene({ - id: 'map', - map: new Mapbox({ - center: [ 116.2825, 39.9 ], - pitch: 0, - style: 'blank', - zoom: 3, - minZoom: 3, - maxZoom: 10 - }) - }); - scene.on('loaded', () => { - new CityLayer(scene, { - data, - joinBy: [ 'adcode', 'code' ], - adcode: [ '330000', '330100' ], - depth: 3, - label: { - field: 'NAME_CHN', - textAllowOverlap: false - }, - bubble: { - enable: true, - size: { - field: 'pop', - values: [ 3, 20 ] - } - }, - popup: { - enable: true, - Html: props => { - return `${props.NAME_CHN}:${props.pop}`; - } - } - }); - }); - -} - -initMap(); diff --git a/examples/district/bubble/demo/county.js b/examples/district/bubble/demo/county.js deleted file mode 100644 index 12a5f05f03..0000000000 --- a/examples/district/bubble/demo/county.js +++ /dev/null @@ -1,44 +0,0 @@ -import { Scene } from '@antv/l7'; -import { CountyLayer } from '@antv/l7-district'; -import { Mapbox } from '@antv/l7-maps'; -const scene = new Scene({ - id: 'map', - map: new Mapbox({ - center: [ 116.2825, 39.9 ], - pitch: 0, - style: 'blank', - zoom: 3, - minZoom: 3, - maxZoom: 10 - }) -}); -scene.on('loaded', () => { - new CountyLayer(scene, { - data: [], - adcode: [ '110101', '110102', '110106' ], - depth: 3, - label: { - field: 'NAME_CHN' - }, - bubble: { - enable: true, - color: { - field: 'NAME_CHN', - values: [ - '#feedde', - '#fdd0a2', - '#fdae6b', - '#fd8d3c', - '#e6550d', - '#a63603' - ] - } - }, - popup: { - enable: true, - Html: props => { - return `${props.NAME_CHN}`; - } - } - }); -}); diff --git a/examples/district/bubble/demo/meta.json b/examples/district/bubble/demo/meta.json deleted file mode 100644 index 3182e5e9c5..0000000000 --- a/examples/district/bubble/demo/meta.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "title": { - "zh": "行政区划", - "en": "District" - }, - "demos": [ - { - "filename": "china_bubble.js", - "title": "中国地图气泡图", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_b82228/afts/img/A*U86gSZpLV54AAAAAAAAAAABkARQnAQ" - }, - { - "filename": "world_map.js", - "title": "世界地图气泡", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_b82228/afts/img/A*jljdRbDWNIgAAAAAAAAAAABkARQnAQ" - }, - { - "filename": "province.js", - "title": "中国省级地图气泡", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_b82228/afts/img/A*wS2QRa4kPTAAAAAAAAAAAABkARQnAQ" - }, - { - "filename": "city.js", - "title": "中国市地图气泡", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_b82228/afts/img/A*usBDQ4cHxtsAAAAAAAAAAABkARQnAQ" - }, - { - "filename": "county.js", - "title": "中国县地图气泡", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_b82228/afts/img/A*0p7aSJ8AXoMAAAAAAAAAAABkARQnAQ" - } - ] -} diff --git a/examples/district/bubble/demo/province.js b/examples/district/bubble/demo/province.js deleted file mode 100644 index 5768e7af73..0000000000 --- a/examples/district/bubble/demo/province.js +++ /dev/null @@ -1,62 +0,0 @@ -import { Scene } from '@antv/l7'; -import { ProvinceLayer } from '@antv/l7-district'; -import { Mapbox } from '@antv/l7-maps'; -async function initMap() { - const response = await fetch( - 'https://gw.alipayobjects.com/os/bmw-prod/149b599d-21ef-4c24-812c-20deaee90e20.json' - ); - const provinceData = await response.json(); - const data = Object.keys(provinceData).map(key => { - return { - code: key, - name: provinceData[key][0], - pop: provinceData[key][2] * 1 - }; - }); - - const scene = new Scene({ - id: 'map', - map: new Mapbox({ - center: [ 116.2825, 39.9 ], - pitch: 0, - style: 'blank', - zoom: 3, - minZoom: 3, - maxZoom: 10 - }) - }); - - scene.on('loaded', () => { - new ProvinceLayer(scene, { - data, - joinBy: [ 'adcode', 'code' ], - adcode: [ '330000' ], - depth: 3, - label: { - field: 'NAME_CHN', - textAllowOverlap: false - }, - bubble: { - enable: true, - color: { - field: 'pop', - values: [ - '#feedde', - '#fdd0a2', - '#fdae6b', - '#fd8d3c', - '#e6550d', - '#a63603' - ] - } - }, - popup: { - enable: true, - Html: props => { - return `${props.NAME_CHN}:${props.pop}`; - } - } - }); - }); -} -initMap(); diff --git a/examples/district/bubble/demo/world_map.js b/examples/district/bubble/demo/world_map.js deleted file mode 100644 index 6e011f10d6..0000000000 --- a/examples/district/bubble/demo/world_map.js +++ /dev/null @@ -1,45 +0,0 @@ -import { Scene } from '@antv/l7'; -import { WorldLayer } from '@antv/l7-district'; -import { Mapbox } from '@antv/l7-maps'; -const scene = new Scene({ - id: 'map', - map: new Mapbox({ - center: [ 116.2825, 39.9 ], - pitch: 0, - style: 'blank', - zoom: 0, - minZoom: 0, - maxZoom: 10 - }) -}); -scene.on('loaded', () => { - new WorldLayer(scene, { - data: [], - bubble: { - enable: true, - color: { - field: 'NAME_CHN', - values: [ - '#feedde', - '#fdd0a2', - '#fdae6b', - '#fd8d3c', - '#e6550d', - '#a63603' - ] - } - }, - stroke: '#ccc', - label: { - enable: true, - textAllowOverlap: false, - field: 'NAME_CHN' - }, - popup: { - enable: false, - Html: props => { - return `${props.NAME_CHN}`; - } - } - }); -}); diff --git a/examples/district/bubble/index.en.md b/examples/district/bubble/index.en.md deleted file mode 100644 index 73773b7d51..0000000000 --- a/examples/district/bubble/index.en.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Bubbled -order: 0 ---- diff --git a/examples/district/bubble/index.zh.md b/examples/district/bubble/index.zh.md deleted file mode 100644 index 094f8ed0e0..0000000000 --- a/examples/district/bubble/index.zh.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: 气泡图 -order: 2 ---- diff --git a/examples/district/drill/API.en.md b/examples/district/drill/API.en.md deleted file mode 100644 index d53551f9b8..0000000000 --- a/examples/district/drill/API.en.md +++ /dev/null @@ -1 +0,0 @@ -`markdown:docs/api/district/drilldown.en.md` diff --git a/examples/district/drill/API.zh.md b/examples/district/drill/API.zh.md deleted file mode 100644 index f1b61107e8..0000000000 --- a/examples/district/drill/API.zh.md +++ /dev/null @@ -1,3 +0,0 @@ -`markdown:docs/common/style.md` - -`markdown:docs/api/district/drilldown.zh.md` diff --git a/examples/district/drill/demo/drill_down.js b/examples/district/drill/demo/drill_down.js deleted file mode 100644 index 1782c26eed..0000000000 --- a/examples/district/drill/demo/drill_down.js +++ /dev/null @@ -1,34 +0,0 @@ -import { Scene } from '@antv/l7'; -import { DrillDownLayer } from '@antv/l7-district'; -import { Mapbox } from '@antv/l7-maps'; -const colors = [ '#B8E1FF', '#7DAAFF', '#3D76DD', '#0047A5', '#001D70' ]; -const scene = new Scene({ - id: 'map', - map: new Mapbox({ - center: [ 116.2825, 39.9 ], - pitch: 0, - style: 'blank', - zoom: 3, - minZoom: 3, - maxZoom: 10 - }) -}); -scene.on('loaded', () => { - new DrillDownLayer(scene, { - data: [], - viewStart: 'Country', - viewEnd: 'City', - fill: { - color: { - field: 'NAME_CHN', - values: colors - } - }, - popup: { - enable: true, - Html: props => { - return `${props.NAME_CHN}`; - } - } - }); -}); diff --git a/examples/district/drill/demo/drill_down_bubble.js b/examples/district/drill/demo/drill_down_bubble.js deleted file mode 100644 index e50674d91c..0000000000 --- a/examples/district/drill/demo/drill_down_bubble.js +++ /dev/null @@ -1,34 +0,0 @@ -import { Scene } from '@antv/l7'; -import { DrillDownLayer } from '@antv/l7-district'; -import { Mapbox } from '@antv/l7-maps'; -const colors = [ '#B8E1FF', '#7DAAFF', '#3D76DD', '#0047A5', '#001D70' ]; -const scene = new Scene({ - id: 'map', - map: new Mapbox({ - center: [ 116.2825, 39.9 ], - pitch: 0, - style: 'blank', - zoom: 3, - minZoom: 3, - maxZoom: 10 - }) -}); -scene.on('loaded', () => { - new DrillDownLayer(scene, { - data: [], - depth: 1, - bubble: { - enable: true, - color: { - field: 'NAME_CHN', - values: colors - } - }, - popup: { - enable: true, - Html: props => { - return `${props.NAME_CHN}`; - } - } - }); -}); diff --git a/examples/district/drill/demo/drill_down_province.js b/examples/district/drill/demo/drill_down_province.js deleted file mode 100644 index 27d1e40792..0000000000 --- a/examples/district/drill/demo/drill_down_province.js +++ /dev/null @@ -1,37 +0,0 @@ -import { Scene } from '@antv/l7'; -import { DrillDownLayer } from '@antv/l7-district'; -import { Mapbox } from '@antv/l7-maps'; -const colors = [ '#B8E1FF', '#7DAAFF', '#3D76DD', '#0047A5', '#001D70' ]; -const scene = new Scene({ - id: 'map', - map: new Mapbox({ - center: [ 116.2825, 39.9 ], - pitch: 0, - style: 'blank', - zoom: 3, - minZoom: 3, - maxZoom: 10 - }) -}); -scene.on('loaded', () => { - new DrillDownLayer(scene, { - data: [], - viewStart: 'Province', - viewEnd: 'County', - fill: { - color: { - field: 'NAME_CHN', - values: colors - } - }, - city: { - adcode: [ 330000 ] - }, - popup: { - enable: true, - Html: props => { - return `${props.NAME_CHN}`; - } - } - }); -}); diff --git a/examples/district/drill/demo/drill_down_view.js b/examples/district/drill/demo/drill_down_view.js deleted file mode 100644 index a65c91dde3..0000000000 --- a/examples/district/drill/demo/drill_down_view.js +++ /dev/null @@ -1,34 +0,0 @@ -import { Scene } from '@antv/l7'; -import { DrillDownLayer } from '@antv/l7-district'; -import { GaodeMap } from '@antv/l7-maps'; -const colors = [ '#B8E1FF', '#7DAAFF', '#3D76DD', '#0047A5', '#001D70' ]; -const scene = new Scene({ - id: 'map', - map: new GaodeMap({ - center: [ 116.2825, 39.9 ], - pitch: 0, - style: 'blank', - zoom: 3, - minZoom: 3, - maxZoom: 10 - }) -}); -scene.on('loaded', () => { - new DrillDownLayer(scene, { - data: [], - viewStart: 'Country', - viewEnd: 'Province', - fill: { - color: { - field: 'NAME_CHN', - values: colors - } - }, - popup: { - enable: true, - Html: props => { - return `${props.NAME_CHN}`; - } - } - }); -}); diff --git a/examples/district/drill/demo/meta.json b/examples/district/drill/demo/meta.json deleted file mode 100644 index 3c10c08c63..0000000000 --- a/examples/district/drill/demo/meta.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "title": { - "zh": "行政区划", - "en": "District" - }, - "demos": [ - { - "filename": "drill_down.js", - "title": "中国地图钻取", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_8e1672/afts/img/A*xjjARqU70xoAAAAAAAAAAABkARQnAQ" - }, - { - "filename": "drill_down_view.js", - "title": "中国地图钻取", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_23a451/afts/img/A*KphnSq_0C6sAAAAAAAAAAAAAARQnAQ" - }, - { - "filename": "drill_down_province.js", - "title": "省级地图钻取", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_23a451/afts/img/A*fVHISrzrz44AAAAAAAAAAAAAARQnAQ" - }, - { - "filename": "drill_down_bubble.js", - "title": "中国地图钻取气泡图", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_b82228/afts/img/A*opUFTqjO9YgAAAAAAAAAAABkARQnAQ" - } - ] -} diff --git a/examples/district/drill/index.en.md b/examples/district/drill/index.en.md deleted file mode 100644 index 89168e977b..0000000000 --- a/examples/district/drill/index.en.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Drill Down -order: 0 ---- diff --git a/examples/district/drill/index.zh.md b/examples/district/drill/index.zh.md deleted file mode 100644 index 9b4649075f..0000000000 --- a/examples/district/drill/index.zh.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: 钻取地图 -order: 3 ---- diff --git a/examples/district/react/demo/city.tsx b/examples/district/react/demo/city.tsx deleted file mode 100644 index c9c7e98a47..0000000000 --- a/examples/district/react/demo/city.tsx +++ /dev/null @@ -1,117 +0,0 @@ -import { Scene } from '@antv/l7'; -import { CityLayer } from '@antv/l7-district'; -import { GaodeMap, Mapbox } from '@antv/l7-maps'; -import { Cascader } from 'antd'; -import * as React from 'react'; -import ReactDOM from 'react-dom'; - -class City extends React.Component { - public state = { - options: [], - }; - // @ts-ignore - private scene: Scene; - private cityLayer: CityLayer; - - public componentWillUnmount() { - this.scene.destroy(); - } - - public async componentDidMount() { - const res = await fetch( - 'https://gw.alipayobjects.com/os/bmw-prod/551e3ca6-6dad-421b-a8b4-b225e47f73ca.json', - ); - const options = await res.json(); - this.setState({ - options, - }); - const response = await fetch( - 'https://gw.alipayobjects.com/os/bmw-prod/149b599d-21ef-4c24-812c-20deaee90e20.json', - ); - const provinceData = await response.json(); - const data = Object.keys(provinceData).map((key: string) => { - return { - code: key, - name: provinceData[key][0], - pop: provinceData[key][2] * 1, - }; - }); - const scene = new Scene({ - id: 'map', - map: new Mapbox({ - center: [116.2825, 39.9], - pitch: 0, - style: 'blank', - zoom: 3, - minZoom: 3, - maxZoom: 10, - }), - }); - scene.on('loaded', () => { - this.cityLayer = new CityLayer(scene, { - data, - joinBy: ['adcode', 'code'], - adcode: ['330000', '330100'], - depth: 3, - label: { - field: 'NAME_CHN', - textAllowOverlap: false, - }, - fill: { - color: { - field: 'NAME_CHN', - values: [ - '#feedde', - '#fdd0a2', - '#fdae6b', - '#fd8d3c', - '#e6550d', - '#a63603', - ], - }, - }, - popup: { - enable: true, - Html: (props) => { - return `${props.NAME_CHN}:`; - }, - }, - }); - }); - this.scene = scene; - } - - public render() { - return ( - <> - -
- - ); - } - private handleProvinceChange = (value: string[]) => { - this.cityLayer.updateDistrict([value[1]]); - }; -} -ReactDOM.render(, document.getElementById('map')); diff --git a/examples/district/react/demo/county.tsx b/examples/district/react/demo/county.tsx deleted file mode 100644 index 03a8b3f045..0000000000 --- a/examples/district/react/demo/county.tsx +++ /dev/null @@ -1,105 +0,0 @@ -import { Scene } from '@antv/l7'; -import { CountyLayer } from '@antv/l7-district'; -import { GaodeMap, Mapbox } from '@antv/l7-maps'; -import { Cascader } from 'antd'; -import ReactDOM from 'react-dom'; -import * as React from 'react'; -export default class County extends React.Component { - public state = { - options: [], - }; - // @ts-ignore - private scene: Scene; - private countyLayer: CountyLayer; - - public componentWillUnmount() { - this.scene.destroy(); - } - - public async componentDidMount() { - const res = await fetch( - 'https://gw.alipayobjects.com/os/bmw-prod/04de56cc-5998-4f7e-9ad3-e87e9ac5fd39.json', - ); - const options = await res.json(); - this.setState({ - options, - }); - const scene = new Scene({ - id: 'map', - map: new Mapbox({ - center: [116.2825, 39.9], - pitch: 0, - style: 'blank', - zoom: 3, - minZoom: 3, - maxZoom: 10, - }), - }); - scene.on('loaded', () => { - this.countyLayer = new CountyLayer(scene, { - data: [], - adcode: ['110101'], - depth: 3, - label: { - field: 'NAME_CHN', - }, - fill: { - color: { - field: 'NAME_CHN', - values: [ - '#feedde', - '#fdd0a2', - '#fdae6b', - '#fd8d3c', - '#e6550d', - '#a63603' - ] - } - }, - popup: { - enable: true, - Html: (props) => { - return `${props.NAME_CHN}`; - }, - }, - }); - }); - this.scene = scene; - } - - public render() { - return ( - <> - -
- - ); - } - - private handleProvinceChange = (value: string[]) => { - this.countyLayer.updateDistrict([value[2]]); - }; -} - -ReactDOM.render(, document.getElementById('map')); diff --git a/examples/district/react/demo/meta.json b/examples/district/react/demo/meta.json deleted file mode 100644 index 06ad3b3e06..0000000000 --- a/examples/district/react/demo/meta.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "title": { - "zh": "行政区划", - "en": "District" - }, - "demos": [ - - { - "filename": "province.tsx", - "title": "省级地图切换", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_8e1672/afts/img/A*LZAZSYFf0-MAAAAAAAAAAABkARQnAQ" - }, - { - "filename": "city.tsx", - "title": "市级地图切换", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_8e1672/afts/img/A*Q7-tSpvgHjcAAAAAAAAAAABkARQnAQ" - }, - { - "filename": "county.tsx", - "title": "县地图切换", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_8e1672/afts/img/A*pBaIQo9D50YAAAAAAAAAAABkARQnAQ" - } - ] -} diff --git a/examples/district/react/demo/province.tsx b/examples/district/react/demo/province.tsx deleted file mode 100644 index d41202f8f5..0000000000 --- a/examples/district/react/demo/province.tsx +++ /dev/null @@ -1,292 +0,0 @@ -import { Scene } from '@antv/l7'; -import { ProvinceLayer } from '@antv/l7-district'; -import { GaodeMap, Mapbox } from '@antv/l7-maps'; -import { Select } from 'antd'; -import * as React from 'react'; -import ReactDOM from 'react-dom'; -const { Option } = Select; - -const ProvinceData = [ - { - NAME_CHN: '云南省', - adcode: 530000, - value: 17881.12, - }, - { - NAME_CHN: '黑龙江省', - adcode: 230000, - value: 16361.62, - }, - { - NAME_CHN: '贵州省', - adcode: 520000, - value: 14806.45, - }, - { - NAME_CHN: '北京市', - adcode: 110000, - value: 30319.98, - }, - { - NAME_CHN: '河北省', - adcode: 130000, - value: 36010.27, - }, - { - NAME_CHN: '山西省', - adcode: 140000, - value: 16818.11, - }, - { - NAME_CHN: '吉林省', - adcode: 220000, - value: 15074, - }, - { - NAME_CHN: '宁夏回族自治区', - adcode: 640000, - value: 3705.18, - }, - { - NAME_CHN: '辽宁省', - adcode: 210000, - value: 25315.35, - }, - { - NAME_CHN: '海南省', - adcode: 460000, - value: 4832.05, - }, - { - NAME_CHN: '内蒙古自治区', - adcode: 150000, - value: 17289.22, - }, - { - NAME_CHN: '天津市', - adcode: 120000, - value: 18809.64, - }, - { - NAME_CHN: '新疆维吾尔自治区', - adcode: 650000, - value: 12199.08, - }, - { - NAME_CHN: '上海市', - adcode: 310000, - value: 32679.87, - }, - { - NAME_CHN: '陕西省', - adcode: 610000, - value: 24438.32, - }, - { - NAME_CHN: '甘肃省', - adcode: 620000, - value: 8246.07, - }, - { - NAME_CHN: '安徽省', - adcode: 340000, - value: 30006.82, - }, - { - NAME_CHN: '香港特别行政区', - adcode: 810000, - value: 0, - }, - { - NAME_CHN: '广东省', - adcode: 440000, - value: 97277.77, - }, - { - NAME_CHN: '河南省', - adcode: 410000, - value: 48055.86, - }, - { - NAME_CHN: '湖南省', - adcode: 430000, - value: 36425.78, - }, - { - NAME_CHN: '江西省', - adcode: 360000, - value: 21984.78, - }, - { - NAME_CHN: '四川省', - adcode: 510000, - value: 40678.13, - }, - { - NAME_CHN: '广西壮族自治区', - adcode: 450000, - value: 20353.51, - }, - { - NAME_CHN: '江苏省', - adcode: 320000, - value: 92595.4, - }, - { - NAME_CHN: '澳门特别行政区', - adcode: 820000, - value: null, - }, - { - NAME_CHN: '浙江省', - adcode: 330000, - value: 56197.15, - }, - { - NAME_CHN: '山东省', - adcode: 370000, - value: 76469.67, - }, - { - NAME_CHN: '青海省', - adcode: 630000, - value: 2865.23, - }, - { - NAME_CHN: '重庆市', - adcode: 500000, - value: 20363.19, - }, - { - NAME_CHN: '福建省', - adcode: 350000, - value: 35804.04, - }, - { - NAME_CHN: '湖北省', - adcode: 420000, - value: 39366.55, - }, - { - NAME_CHN: '西藏自治区', - adcode: 540000, - value: 1477.63, - }, - { - NAME_CHN: '台湾省', - adcode: 710000, - value: null, - }, -]; -class Province extends React.Component { - public state = { - province: '110000', - }; - // @ts-ignore - private scene: Scene; - private provinceLayer: ProvinceLayer; - public componentWillUnmount() { - this.scene.destroy(); - } - - public async componentDidMount() { - const response = await fetch( - 'https://gw.alipayobjects.com/os/bmw-prod/149b599d-21ef-4c24-812c-20deaee90e20.json', - ); - const provinceData = await response.json(); - const data = Object.keys(provinceData).map((key: string) => { - return { - code: key, - name: provinceData[key][0], - pop: provinceData[key][3], - }; - }); - const scene = new Scene({ - id: 'map', - map: new GaodeMap({ - center: [116.2825, 39.9], - pitch: 0, - style: 'blank', - zoom: 3, - minZoom: 3, - maxZoom: 10, - }), - }); - - scene.on('loaded', () => { - const { province } = this.state; - this.provinceLayer = new ProvinceLayer(scene, { - adcode: ['230000'], - depth: 1, - label: { - field: 'NAME_CHN', - textAllowOverlap: false, - }, - fill: { - color: { - field: 'NAME_CHN', - values: [ - '#feedde', - '#fdd0a2', - '#fdae6b', - '#fd8d3c', - '#e6550d', - '#a63603', - ], - }, - }, - popup: { - enable: true, - Html: (props) => { - return `${props.NAME_CHN}`; - }, - }, - }); - }); - this.scene = scene; - } - - public render() { - return ( - <> - -
- - ); - } - - private handleProvinceChange = (value: string) => { - this.setState({ - province: value, - }); - this.provinceLayer.updateDistrict([value]); - }; -} -ReactDOM.render(, document.getElementById('map')); diff --git a/examples/district/react/index.en.md b/examples/district/react/index.en.md deleted file mode 100644 index 663dac6a78..0000000000 --- a/examples/district/react/index.en.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: React -order: 3 ---- diff --git a/examples/district/react/index.zh.md b/examples/district/react/index.zh.md deleted file mode 100644 index 241f08b6d5..0000000000 --- a/examples/district/react/index.zh.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: React 组件 -order: 4 ---- diff --git a/gatsby-config.js b/gatsby-config.js index cdf00b6a03..af80fe97e5 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -362,15 +362,6 @@ module.exports = { }, order: 10, }, - { - slug: 'district', - icon: 'map', - title: { - zh: '行政区划', - en: 'L7 District', - }, - order: 11, - }, { slug: 'choropleth', icon: 'map',