Skip to content

Commit

Permalink
fix: add style props for map
Browse files Browse the repository at this point in the history
  • Loading branch information
lvisei committed Dec 25, 2024
1 parent fce8197 commit a5154e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Map/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<BaseMapProps<any>, 'data'>;

const Map: FC<MapProps> = (props) => {
const { className, containerStyle, children } = props;
const { className, containerStyle, style, children } = props;
const mapConfig = useMemo(() => formatMapStyle(props), [props]);
const onSceneLoaded = async () => {
if (props.onInitComplete) {
Expand All @@ -18,7 +18,7 @@ const Map: FC<MapProps> = (props) => {
return (
<LarkMap
className={className}
style={{ height: 300, ...containerStyle }}
style={{ height: 300, ...containerStyle, ...style }}
{...mapConfig}
onSceneLoaded={onSceneLoaded}
>
Expand Down
1 change: 1 addition & 0 deletions src/types/chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export interface BasePlotProps<T> extends BaseChartProps {
}

export interface BaseMapProps<T> extends BaseChartProps, Map {
style?: CSSProperties;
data: T[];
// 高德地图密钥
token?: string;
Expand Down

0 comments on commit a5154e5

Please sign in to comment.