2019-11-21 17:52:18 +08:00
|
|
|
import { Scene, PointLayer } from '@antv/l7';
|
2019-11-26 17:51:29 +08:00
|
|
|
import { Mapbox } from '@antv/l7-maps';
|
|
|
|
|
2019-11-10 21:20:26 +08:00
|
|
|
const scene = new Scene({
|
|
|
|
id: 'map',
|
2019-11-26 17:51:29 +08:00
|
|
|
map: new Mapbox({
|
|
|
|
pitch: 0,
|
|
|
|
style: 'dark',
|
|
|
|
center: [ 96.99215001469588, 29.281597225674773 ],
|
|
|
|
zoom: 2.194613775109773,
|
2019-11-26 19:17:39 +08:00
|
|
|
maxZoom: 10
|
|
|
|
})
|
2019-11-10 21:20:26 +08:00
|
|
|
});
|
2019-11-20 17:26:24 +08:00
|
|
|
fetch(
|
|
|
|
'https://gw.alipayobjects.com/os/basement_prod/337ddbb7-aa3f-4679-ab60-d64359241955.json'
|
|
|
|
)
|
|
|
|
.then(res => res.json())
|
|
|
|
.then(data => {
|
|
|
|
data.features = data.features.filter(item => {
|
|
|
|
return item.properties.capacity > 800;
|
|
|
|
});
|
|
|
|
const pointLayer = new PointLayer({})
|
|
|
|
.source(data)
|
|
|
|
.shape('circle')
|
|
|
|
.size('capacity', [ 0, 16 ])
|
|
|
|
.color('capacity', [
|
|
|
|
'#34B6B7',
|
|
|
|
'#4AC5AF',
|
|
|
|
'#5FD3A6',
|
|
|
|
'#7BE39E',
|
|
|
|
'#A1EDB8',
|
|
|
|
'#CEF8D6'
|
|
|
|
])
|
2020-01-07 21:15:23 +08:00
|
|
|
.active(true)
|
2019-11-20 17:26:24 +08:00
|
|
|
.style({
|
|
|
|
opacity: 0.5,
|
|
|
|
strokeWidth: 0
|
|
|
|
});
|
2019-11-10 21:20:26 +08:00
|
|
|
|
2019-11-20 17:26:24 +08:00
|
|
|
scene.addLayer(pointLayer);
|
2019-11-10 21:20:26 +08:00
|
|
|
});
|