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:
YiQianYao 2022-08-30 19:18:33 +08:00 committed by GitHub
parent 16b6abc01f
commit ecdaeef538
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,2 @@
### Line Blur
<code src="./lineblur.tsx"></code>

View File

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