antv-l7/examples/point/column/demo/column_light.js

34 lines
768 B
JavaScript
Raw Normal View History

2019-11-14 11:50:12 +08:00
import { Scene } from '@l7/scene';
2019-11-20 17:26:24 +08:00
import { PointLayer } from '@l7/layers';
2019-11-14 11:50:12 +08:00
const scene = new Scene({
id: 'map',
2019-11-20 17:26:24 +08:00
pitch: 48.62562,
2019-11-14 11:50:12 +08:00
type: 'amap',
style: 'light',
2019-11-20 17:26:24 +08:00
center: [ 104.026043, 31.847 ],
rotation: -0.76,
zoom: 4.48
2019-11-14 11:50:12 +08:00
});
window.mapScene = scene;
fetch('https://gw.alipayobjects.com/os/rmsportal/oVTMqfzuuRFKiDwhPSFL.json')
2019-11-20 17:26:24 +08:00
.then(res => res.json())
.then(data => {
const pointLayer = new PointLayer({})
.source(data.list, {
parser: {
type: 'json',
x: 'j',
y: 'w'
}
2019-11-14 11:50:12 +08:00
})
2019-11-20 17:26:24 +08:00
.shape('cylinder')
.size('t', function(level) {
return [ 1, 2, level * 2 + 20 ];
})
.color('#006CFF')
.style({
opacity: 1.0
});
scene.addLayer(pointLayer);
2019-11-20 17:26:24 +08:00
});