From 44b954bc8d77203bd79d40d29e029804e15e3c72 Mon Sep 17 00:00:00 2001 From: syb01094648 Date: Thu, 7 Mar 2024 17:03:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9ts=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/docs/index.md | 8 ++++---- src/recoil/atomState.ts | 15 ++++----------- src/types/l7editor.ts | 16 +++++++++------- 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/docs/docs/index.md b/docs/docs/index.md index 060d923..4ee44de 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -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}'], }, ]; } diff --git a/src/recoil/atomState.ts b/src/recoil/atomState.ts index 0c983b1..fa20650 100644 --- a/src/recoil/atomState.ts +++ b/src/recoil/atomState.ts @@ -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) => @@ -172,15 +173,7 @@ const textLayerFieldsState = atom({ effects: [localStorageEffect(LocalStorageKey.textLayerFields)], }); -const customTilesState = atom< - { - [x: string]: any; - id: string; - image: string; - title: string; - layers: string[]; - }[] ->({ +const customTilesState = atom({ key: 'customTiles', default: [], effects: [localStorageEffect(LocalStorageKey.customTiles)], @@ -199,13 +192,11 @@ const wasmPathState = atom({ export { activeTabState, - showDrawAreaState, autoFitBoundsState, baseMapState, cityHistoryState, convertState, customTilesState, - showDrawDistanceState, editorTextState, featureState, filterState, @@ -221,6 +212,8 @@ export { rightWidthState, savedTextState, sceneState, + showDrawAreaState, + showDrawDistanceState, showTextLayerState, textLayerFieldsState, themeState, diff --git a/src/types/l7editor.ts b/src/types/l7editor.ts index 57a4728..f3789dc 100644 --- a/src/types/l7editor.ts +++ b/src/types/l7editor.ts @@ -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; @@ -150,11 +158,5 @@ export interface L7EditorProps { /** * 自定义瓦片底图图层 */ - customTiles?: { - [x: string]: any; - id: string; - image: string; - title: string; - layers: string[]; - }[]; + customTiles?: customTilesProps; }