antv-l7/examples/gallery/basic/demo/arcCircle.js

37 lines
829 B
JavaScript
Raw Normal View History

2019-11-21 17:52:18 +08:00
import { Scene, LineLayer } from '@antv/l7';
import { Mapbox } from '@antv/l7-maps';
2019-11-10 21:20:26 +08:00
const scene = new Scene({
id: 'map',
map: new Mapbox({
style: 'dark',
pitch: 0,
center: [ 107.77791556935472, 35.443286920228644 ],
zoom: 2.9142882493605033
2019-11-26 19:17:39 +08:00
})
2019-11-10 21:20:26 +08:00
});
2020-03-15 20:09:16 +08:00
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('arc')
.color('#8C1EB2')
.style({
opacity: 0.8,
blur: 0.99
});
scene.addLayer(layer);
});
});