Skip to content

Commit 5bea040

Browse files
authored
fix: add style props for map (#64)
* fix: add style props for map * chore: chngeset
1 parent fce8197 commit 5bea040

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.changeset/eighty-dingos-sing.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@antv/gpt-vis': patch
3+
---
4+
5+
fix: add style props for map

src/Map/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import { LarkMap } from '@antv/larkmap';
22
import React, { useMemo, type FC } from 'react';
33
import type { BaseMapProps } from '../types';
44
import { formatMapStyle } from '../utils/map';
5-
import { MapView, Marker, Polyline } from './Component/';
5+
import { MapView, Marker, Polyline } from './Component';
66

77
export type MapProps = Omit<BaseMapProps<any>, 'data'>;
88

99
const Map: FC<MapProps> = (props) => {
10-
const { className, containerStyle, children } = props;
10+
const { className, containerStyle, style, children } = props;
1111
const mapConfig = useMemo(() => formatMapStyle(props), [props]);
1212
const onSceneLoaded = async () => {
1313
if (props.onInitComplete) {
@@ -18,7 +18,7 @@ const Map: FC<MapProps> = (props) => {
1818
return (
1919
<LarkMap
2020
className={className}
21-
style={{ height: 300, ...containerStyle }}
21+
style={{ height: 300, ...containerStyle, ...style }}
2222
{...mapConfig}
2323
onSceneLoaded={onSceneLoaded}
2424
>

src/types/chart.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export interface BasePlotProps<T> extends BaseChartProps {
4343
}
4444

4545
export interface BaseMapProps<T> extends BaseChartProps, Map {
46+
style?: CSSProperties;
4647
data: T[];
4748
// 高德地图密钥
4849
token?: string;

0 commit comments

Comments
 (0)