Skip to content

Commit

Permalink
fix: types
Browse files Browse the repository at this point in the history
  • Loading branch information
lvisei committed Sep 14, 2024
1 parent c72d710 commit e3d9aad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
11 changes: 4 additions & 7 deletions src/components/LarkMap/helper.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { IMapConfig } from '@antv/l7';
import { GaodeMap, GaodeMapV1, GaodeMapV2, Map } from '@antv/l7';
import { BaiduMap, GaodeMap, GaodeMapV1, GaodeMapV2, Map, TencentMap } from '@antv/l7';
import type { LarkMapProps } from './types';

export const createMap = async (mapType: LarkMapProps['mapType'], mapOptions: Partial<IMapConfig>) => {
Expand All @@ -16,14 +16,11 @@ export const createMap = async (mapType: LarkMapProps['mapType'], mapOptions: Pa
}

if (mapType === 'Tencent') {
return Promise.resolve(import('@antv/l7')).then(({ TencentMap }) => {
return new TencentMap(mapOptions);
});
return new TencentMap(mapOptions);
}

if (mapType === 'Baidu') {
return Promise.resolve(import('@antv/l7')).then(({ BaiduMap }) => {
return new BaiduMap(mapOptions);
});
return new BaiduMap(mapOptions);
}

return Promise.resolve(import('@antv/l7')).then(({ Mapbox }) => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Marker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useDeepCompareEffect } from 'ahooks';
import React, { memo, useEffect, useMemo, useRef } from 'react';
import { createPortal } from 'react-dom';
import { useScene } from '../LarkMap/hooks';
import type { MarkerProps } from './types';
import type { MarkerEventType, MarkerProps } from './types';

export const Marker = memo<MarkerProps>(function Marker(props): React.ReactPortal {
const scene = useScene();
Expand All @@ -24,7 +24,7 @@ export const Marker = memo<MarkerProps>(function Marker(props): React.ReactPorta
// @ts-ignore
const l7marker = new L7Marker(options);

l7marker.on('click', (e: MouseEvent) => {
l7marker.on('click', (e: MarkerEventType) => {
thisRef.current.props.onClick?.(e);
});

Expand Down

0 comments on commit e3d9aad

Please sign in to comment.