From 322f85036b9ae6f1810a91450f9c27e9139b8f1e Mon Sep 17 00:00:00 2001 From: 2912401452 <2912401452@qq.com> Date: Mon, 26 Jul 2021 14:13:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E5=AE=98=E7=BD=91?= =?UTF-8?q?=E6=B8=90=E5=8F=98=E5=BC=A7=E7=BA=BF=E6=A1=88=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/line/arc/demo/meta.json | 6 ++- .../line/arc/demo/trip_arc_dark_linear.js | 38 +++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 examples/line/arc/demo/trip_arc_dark_linear.js diff --git a/examples/line/arc/demo/meta.json b/examples/line/arc/demo/meta.json index fe382753ee..1a97c2fa8e 100644 --- a/examples/line/arc/demo/meta.json +++ b/examples/line/arc/demo/meta.json @@ -15,11 +15,15 @@ "screenshot": "https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*JjUcTZ8-PC8AAAAAAAAAAABkARQnAQ" }, + { + "filename": "trip_arc_dark_linear.js", + "title": "3D 弧线(渐变)", + "screenshot": "https://gw.alipayobjects.com/mdn/rms_23a451/afts/img/A*RZEgSYZLeJIAAAAAAAAAAAAAARQnAQ" + }, { "filename": "trip_arc.js", "title": "3D 弧线", "screenshot": "https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*xvaaQo2c0gMAAAAAAAAAAABkARQnAQ" - } ] } diff --git a/examples/line/arc/demo/trip_arc_dark_linear.js b/examples/line/arc/demo/trip_arc_dark_linear.js new file mode 100644 index 0000000000..f57b288d76 --- /dev/null +++ b/examples/line/arc/demo/trip_arc_dark_linear.js @@ -0,0 +1,38 @@ +import { Scene, LineLayer } from '@antv/l7'; +import { Mapbox } from '@antv/l7-maps'; + +const scene = new Scene({ + id: 'map', + map: new Mapbox({ + pitch: 60, + style: 'dark', + center: [ 104.34278, 41.12554 ], + zoom: 2.94888, + rotation: 42.3999 + }) +}); +scene.on('loaded', () => { + fetch('https://gw.alipayobjects.com/os/rmsportal/UEXQMifxtkQlYfChpPwT.txt') + .then(res => res.text()) + .then(data => { + const layer = new LineLayer({}) + .source(data, { + parser: { + type: 'csv', + x: 'lng1', + y: 'lat1', + x1: 'lng2', + y1: 'lat2' + } + }) + .size(1) + .shape('arc3d') + .color('#FF7C6A') + .style({ + opacity: 0.8, + sourceColor: '#f00', + targetColor: '#0f0', + }); + scene.addLayer(layer); + }); +});