Skip to content

Commit

Permalink
fix: 代码优化
Browse files Browse the repository at this point in the history
  • Loading branch information
syb01094648 committed Mar 11, 2024
1 parent f6fb92f commit 2c5b674
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions src/components/app-map/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,16 @@ export const AppMap: React.FC<AppMapProps> = ({ children }) => {
});

const mapOptions = useMemo(() => {
if (baseMap === 'Mapbox') {
return {
...MapBoxConfig,
...baseMapOptions,
};
}
if (baseMap === 'Baidu') {
return {
...BaiduConfig,
// ...baseMapOptions,
};
}
if (baseMap === 'Tencent') {
return {
...baseMapOptions,
};
}
const mapConfigMapping = {
Mapbox: MapBoxConfig,
Baidu: BaiduConfig,
Tencent: {},
} as any;

const config = mapConfigMapping[baseMap] || GaodeConfig;

return {
...GaodeConfig,
...config,
...baseMapOptions,
};
}, [baseMap, baseMapOptions]);
Expand Down

0 comments on commit 2c5b674

Please sign in to comment.