Skip to content

Commit

Permalink
fix: 修改ts类型
Browse files Browse the repository at this point in the history
  • Loading branch information
syb01094648 committed Mar 7, 2024
1 parent 875d49d commit 44b954b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 22 deletions.
8 changes: 4 additions & 4 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ LngLat 文本编辑器,可以通过输入 LngLat 数据实现数据展示(目
{
customTiles: [
{
id: 'id',
image: 'img',
title: 'title',
layers: ['layerUrl'],
id: 'GaodeSatellite',
image: 'https://mdn.alipayobjects.com/huamei_k6sfo0/afts/img/A*zi2jSqqZ2-8AAAAAAAAAAAAADjWqAQ/original',
title: '高德卫星底图',
layers: [' https://webst01.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}'],
},
];
}
Expand Down
15 changes: 4 additions & 11 deletions src/recoil/atomState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { atom, DefaultValue } from 'recoil';
import { LocalStorageKey } from '../constants';
import type { IFeatures, LngLatImportType } from '../types';
import type { FilterNode } from '../types/filter';
import type { customTilesProps } from '../types/l7editor';

const localStorageEffect =
(key: string) =>
Expand Down Expand Up @@ -172,15 +173,7 @@ const textLayerFieldsState = atom<string[] | undefined>({
effects: [localStorageEffect(LocalStorageKey.textLayerFields)],
});

const customTilesState = atom<
{
[x: string]: any;
id: string;
image: string;
title: string;
layers: string[];
}[]
>({
const customTilesState = atom<customTilesProps>({
key: 'customTiles',
default: [],
effects: [localStorageEffect(LocalStorageKey.customTiles)],
Expand All @@ -199,13 +192,11 @@ const wasmPathState = atom<string>({

export {
activeTabState,
showDrawAreaState,
autoFitBoundsState,
baseMapState,
cityHistoryState,
convertState,
customTilesState,
showDrawDistanceState,
editorTextState,
featureState,
filterState,
Expand All @@ -221,6 +212,8 @@ export {
rightWidthState,
savedTextState,
sceneState,
showDrawAreaState,
showDrawDistanceState,
showTextLayerState,
textLayerFieldsState,
themeState,
Expand Down
16 changes: 9 additions & 7 deletions src/types/l7editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ import type { LarkMapProps } from '@antv/larkmap';
import type { Feature } from '@turf/turf';
import type { TabsProps } from 'antd';

export type customTilesProps = {
[key: string]: any;
id: string;
image: string;
title: string;
layers: string[];
}[];

export interface MapControlProps {
logoControl?: boolean;
drawControl?: boolean;
Expand Down Expand Up @@ -150,11 +158,5 @@ export interface L7EditorProps {
/**
* 自定义瓦片底图图层
*/
customTiles?: {
[x: string]: any;
id: string;
image: string;
title: string;
layers: string[];
}[];
customTiles?: customTilesProps;
}

0 comments on commit 44b954b

Please sign in to comment.