From a5154e5bfbb7e1ef87c307a4358e54f551264324 Mon Sep 17 00:00:00 2001 From: yunji Date: Wed, 25 Dec 2024 14:20:18 +0800 Subject: [PATCH] fix: add style props for map --- src/Map/index.tsx | 6 +++--- src/types/chart.ts | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Map/index.tsx b/src/Map/index.tsx index 441e153..3327c85 100644 --- a/src/Map/index.tsx +++ b/src/Map/index.tsx @@ -2,12 +2,12 @@ import { LarkMap } from '@antv/larkmap'; import React, { useMemo, type FC } from 'react'; import type { BaseMapProps } from '../types'; import { formatMapStyle } from '../utils/map'; -import { MapView, Marker, Polyline } from './Component/'; +import { MapView, Marker, Polyline } from './Component'; export type MapProps = Omit, 'data'>; const Map: FC = (props) => { - const { className, containerStyle, children } = props; + const { className, containerStyle, style, children } = props; const mapConfig = useMemo(() => formatMapStyle(props), [props]); const onSceneLoaded = async () => { if (props.onInitComplete) { @@ -18,7 +18,7 @@ const Map: FC = (props) => { return ( diff --git a/src/types/chart.ts b/src/types/chart.ts index 763ba73..32ea655 100644 --- a/src/types/chart.ts +++ b/src/types/chart.ts @@ -43,6 +43,7 @@ export interface BasePlotProps extends BaseChartProps { } export interface BaseMapProps extends BaseChartProps, Map { + style?: CSSProperties; data: T[]; // 高德地图密钥 token?: string;