Merge branch 'master' of github.com:antvis/L7

This commit is contained in:
thinkinggis 2021-07-26 16:21:35 +08:00
commit dc3ffed6b7
2 changed files with 43 additions and 1 deletions

View File

@ -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"
}
]
}

View File

@ -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);
});
});