antv-l7/examples/line/arc/demo/trip_arc.js

36 lines
819 B
JavaScript
Raw Normal View History

2019-11-16 22:22:13 +08:00
import { Arc3DLineLayer } from '@l7/layers';
import { Scene } from '@l7/scene';
const scene = new Scene({
id: 'map',
2019-11-17 17:31:01 +08:00
pitch: 60,
2019-11-16 22:22:13 +08:00
type: 'mapbox',
style: 'light',
2019-11-17 17:31:01 +08:00
center: [-74.06355155037261,40.73507179789368],
zoom: 11.8623,
2019-11-16 22:22:13 +08:00
});
window.mapScene = scene;
fetch('https://gw.alipayobjects.com/os/basement_prod/bd33a685-a17e-4686-bc79-b0e6a89fd950.csv')
.then((res) => res.text())
.then((data) => {
const layer =
new Arc3DLineLayer({})
.source(data, {
parser: {
type: 'csv',
x: 'start station longitude',
y: 'start station latitude',
x1: 'end station longitude',
y1: 'end station latitude',
},
})
.size(1)
.shape('arc')
2019-11-17 17:31:01 +08:00
.color('#0C47BF')
2019-11-16 22:22:13 +08:00
.style({
2019-11-17 17:31:01 +08:00
opacity: 1,
blur: 0.9
2019-11-16 22:22:13 +08:00
})
;
scene.addLayer(layer);
})