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

36 lines
733 B
JavaScript
Raw Normal View History

import { LineLayer } from '@l7/layers';
2019-11-10 21:20:26 +08:00
import { Scene } from '@l7/scene';
const scene = new Scene({
id: 'map',
2019-11-18 16:13:15 +08:00
pitch: 0,
type: 'mapbox',
2019-11-10 21:20:26 +08:00
style: 'dark',
2019-11-18 16:13:15 +08:00
center: [107.77791556935472, 35.443286920228644],
zoom: 2.9142882493605033,
2019-11-10 21:20:26 +08:00
});
2019-11-18 16:13:15 +08:00
window.mapScene = scene;
2019-11-10 21:20:26 +08:00
fetch('https://gw.alipayobjects.com/os/rmsportal/UEXQMifxtkQlYfChpPwT.txt')
.then((res) => res.text())
.then((data) => {
const layer =
new LineLayer({})
2019-11-10 21:20:26 +08:00
.source(data, {
parser: {
type: 'csv',
x: 'lng1',
y: 'lat1',
x1: 'lng2',
y1: 'lat2',
},
})
.size(1)
.shape('arc')
2019-11-18 16:13:15 +08:00
.color('#8C1EB2')
2019-11-10 21:20:26 +08:00
.style({
opacity: 0.8,
2019-11-18 16:13:15 +08:00
blur: 0.99
2019-11-10 21:20:26 +08:00
})
;
scene.addLayer(layer);
})