mirror of https://gitee.com/antv-l7/antv-l7
chore: add demo (#1319)
* fix: 修复 featureScale 错误 * style: lint style * fix: remove featureScalePlugin async * chore: add demo * style: lint style Co-authored-by: shihui <yiqianyao.yqy@alibaba-inc.com>
This commit is contained in:
parent
16b6abc01f
commit
ecdaeef538
|
@ -0,0 +1,2 @@
|
|||
### Line Blur
|
||||
<code src="./lineblur.tsx"></code>
|
|
@ -0,0 +1,42 @@
|
|||
import { LineLayer, Scene } from '@antv/l7';
|
||||
import { GaodeMap } from '@antv/l7-maps';
|
||||
import React, { useEffect } from 'react';
|
||||
|
||||
export default () => {
|
||||
useEffect(() => {
|
||||
const scene = new Scene({
|
||||
id: 'map',
|
||||
map: new GaodeMap({
|
||||
center: [122, 28],
|
||||
zoom: 5,
|
||||
style: 'dark',
|
||||
}),
|
||||
});
|
||||
|
||||
fetch(
|
||||
'https://gw.alipayobjects.com/os/bmw-prod/55304d8d-4cb0-49e0-9d95-9eeacbe1c80a.json',
|
||||
)
|
||||
.then((res) => res.json())
|
||||
.then((data) => {
|
||||
const blurLine = new LineLayer()
|
||||
.source(data)
|
||||
.size(5)
|
||||
.style({
|
||||
opacity: 0.8,
|
||||
sourceColor: '#f00',
|
||||
targetColor: '#ff0',
|
||||
linearDir: 'horizontal',
|
||||
});
|
||||
scene.addLayer(blurLine);
|
||||
});
|
||||
}, []);
|
||||
return (
|
||||
<div
|
||||
id="map"
|
||||
style={{
|
||||
height: '500px',
|
||||
position: 'relative',
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
Loading…
Reference in New Issue