From 2e6eccd1ed7a24e619b78b9f380f9115bc533169 Mon Sep 17 00:00:00 2001 From: thinkinggis Date: Thu, 27 Feb 2020 09:28:51 +0800 Subject: [PATCH] fix: react mapbox option --- packages/react/src/component/MapboxScene.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/react/src/component/MapboxScene.tsx b/packages/react/src/component/MapboxScene.tsx index d38dddc0eb..c2a81e0d43 100644 --- a/packages/react/src/component/MapboxScene.tsx +++ b/packages/react/src/component/MapboxScene.tsx @@ -1,4 +1,4 @@ -import { IMapConfig, Scene, Zoom } from '@antv/l7'; +import { IMapConfig, ISceneConfig, Scene, Zoom } from '@antv/l7'; // @ts-ignore // tslint:disable-next-line:no-submodule-imports import Mapbox from '@antv/l7-maps/lib/mapbox'; @@ -8,10 +8,11 @@ interface IMapSceneConig { style?: React.CSSProperties; className?: string; map: IMapConfig; + option?: Partial; children?: JSX.Element | JSX.Element[] | Array; } const MapboxScene = React.memo((props: IMapSceneConig) => { - const { style, className, map } = props; + const { style, className, map, option } = props; const container = createRef(); const [scene, setScene] = useState(); @@ -19,6 +20,7 @@ const MapboxScene = React.memo((props: IMapSceneConig) => { useEffect(() => { const sceneInstance = new Scene({ id: container.current as HTMLDivElement, + ...option, map: new Mapbox(map), }); sceneInstance.on('loaded', () => {