From 5bea040fcd9102793e9fcbdb45e1d1a8450f201f Mon Sep 17 00:00:00 2001 From: lvisei Date: Wed, 25 Dec 2024 14:36:01 +0800 Subject: [PATCH] fix: add style props for map (#64) * fix: add style props for map * chore: chngeset --- .changeset/eighty-dingos-sing.md | 5 +++++ src/Map/index.tsx | 6 +++--- src/types/chart.ts | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 .changeset/eighty-dingos-sing.md diff --git a/.changeset/eighty-dingos-sing.md b/.changeset/eighty-dingos-sing.md new file mode 100644 index 0000000..f522a9e --- /dev/null +++ b/.changeset/eighty-dingos-sing.md @@ -0,0 +1,5 @@ +--- +'@antv/gpt-vis': patch +--- + +fix: add style props for map 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;