This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch gh-pages in repository https://gitbox.apache.org/repos/asf/echarts-examples.git
commit dad2b5227f2504b54bf46002e3adbd8112613bc6 Author: Ovilia <zwl.s...@gmail.com> AuthorDate: Wed Jul 20 16:11:12 2022 +0800 remove an example containing map --- public/examples/ts/map-projection-globe.ts | 119 ----------------------------- src/data/chart-list-data.js | 11 --- 2 files changed, 130 deletions(-) diff --git a/public/examples/ts/map-projection-globe.ts b/public/examples/ts/map-projection-globe.ts deleted file mode 100644 index 12f062e9..00000000 --- a/public/examples/ts/map-projection-globe.ts +++ /dev/null @@ -1,119 +0,0 @@ -/* -title: Map with Orthographic Projection -category: map -titleCN: 正交投影地图 -*/ - -myChart.showLoading(); - -let projection: any; - -$.when( - $.get(ROOT_PATH + '/data/asset/geo/world.json'), - $.getScript('https://fastly.jsdelivr.net/npm/d3-array'), - $.getScript('https://fastly.jsdelivr.net/npm/d3-geo') -).done(function (res) { - myChart.hideLoading(); - // Add graticule - const graticuleLineStrings = []; - for (let lat = -80; lat <= 80; lat += 10) { - graticuleLineStrings.push(createLineString([-180, lat], [180, lat])); - } - for (let lng = -180; lng <= 180; lng += 10) { - graticuleLineStrings.push(createLineString([lng, -80], [lng, 80])); - } - - res[0].features.unshift({ - geometry: { - type: 'MultiLineString', - coordinates: graticuleLineStrings - }, - properties: { - name: 'graticule' - } - }); - - echarts.registerMap('world', res[0]); - - projection = d3.geoOrthographic(); - - option = { - geo: { - map: 'world', - - projection: { - project: (pt) => projection(pt), - unproject: (pt) => projection.invert(pt), - stream: projection.stream - }, - - itemStyle: { - borderColor: '#333', - borderWidth: 1, - borderJoin: 'round', - color: '#000' - }, - - emphasis: { - label: { - show: false - }, - - itemStyle: { - color: 'skyblue' - } - }, - - regions: [ - { - name: 'graticule', - itemStyle: { - borderColor: '#bbb' - }, - emphasis: { - disabled: true - } - } - ] - } - }; - - myChart.setOption(option); -}); - -app.config = { - rotateX: 0, - rotateY: 0, - - onChange() { - projection && projection.rotate([app.config.rotateX, app.config.rotateY]); - myChart.setOption({ - geo: {} - }); - } -}; - -app.configParameters = { - rotateX: { - min: -180, - max: 180 - }, - rotateY: { - min: -80, - max: 80 - } -}; - -function createLineString(start: number[], end: number[]) { - const dx = end[0] - start[0]; - const dy = end[1] - start[1]; - const segs = 50; - const stepX = dx / segs; - const stepY = dy / segs; - const points = []; - // TODO needs adaptive sampling on the -180 / 180 of azimuthal projections. - for (let i = 0; i <= segs; i++) { - points.push([start[0] + i * stepX, start[1] + i * stepY]); - } - return points; -} diff --git a/src/data/chart-list-data.js b/src/data/chart-list-data.js index 74198d17..d6e35dd1 100644 --- a/src/data/chart-list-data.js +++ b/src/data/chart-list-data.js @@ -2566,17 +2566,6 @@ export default [ "titleCN": "在地图上绘制多边形", "difficulty": 10 }, - { - "category": [ - "map" - ], - "id": "map-projection-globe", - "ts": true, - "tags": [], - "title": "Map with Orthographic Projection", - "titleCN": "正交投影地图", - "difficulty": 10 - }, { "category": [ "map" --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org