docs: update react demo

This commit is contained in:
thinkinggis 2020-09-07 15:26:16 +08:00
parent 8bd89c97fb
commit a8b2ebd4fd
1 changed files with 9 additions and 7 deletions

View File

@ -2,6 +2,8 @@ import {
AMapScene,
LayerContext,
LineLayer,
PolygonLayer,
MapboxScene,
Marker,
Popup,
SceneContext,
@ -45,14 +47,14 @@ export default React.memo(function Map() {
option={{
closeOnClick: false,
}}
lnglat={[110.1938, 50.25] as number[]}
lnglat={[110.1938, 30.25] as number[]}
>
<p onClick={popupClick}>122222</p>
<p onClick={popupClick}>122224</p>
</Popup>
<Marker lnglat={[110.1938, 30.25] as number[]}>
<p onClick={popupClick}>122222</p>
<Marker lnglat={[100.1938, 30.25] as number[]}>
<p onClick={popupClick}>tes</p>
</Marker>
<LineLayer
<PolygonLayer
key={'2'}
source={{
data,
@ -64,7 +66,7 @@ export default React.memo(function Map() {
values: '#fff',
}}
shape={{
values: 'line',
values: 'fill',
}}
style={{
opacity: 1,
@ -76,7 +78,7 @@ export default React.memo(function Map() {
return null;
}}
</LayerContext.Consumer>
</LineLayer>
</PolygonLayer>
</AMapScene>
</>
);