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 03acf52 commit 02800cb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
7 changes: 5 additions & 2 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,12 @@ LngLat 文本编辑器,可以通过输入 LngLat 数据实现数据展示(目
customTiles: [
{
id: 'GaodeSatellite',
image: 'https://mdn.alipayobjects.com/huamei_k6sfo0/afts/img/A*zi2jSqqZ2-8AAAAAAAAAAAAADjWqAQ/original',
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}'],
layers: [
'https://webst01.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}',
],
},
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
OfficeLayerEnum,
} from '../../../constants';
import { useGlobal } from '../../../recoil';
import type { CustomTilesProps } from '../../../types/l7editor';
import type { CustomTiles } from '../../../types/l7editor';
import useStyle from './styles';

const layout = {
Expand Down Expand Up @@ -92,7 +92,7 @@ export function OfficialLayerControl() {
return false; // 阻止antd组件自动上传
};

const onItemClick = (item: CustomTilesProps) => {
const onItemClick = (item: CustomTiles) => {
setRadioValue(item.id);
setLayerType(
item.id === OfficeLayerEnum.VectorMap ? [] : ([item.id] as string[]),
Expand Down Expand Up @@ -138,7 +138,7 @@ export function OfficialLayerControl() {

const onConfirm = (
e: React.MouseEvent<HTMLElement> | undefined,
item: CustomTilesProps,
item: CustomTiles,
) => {
e?.stopPropagation();
const newCustomTiles = customTiles.filter((val) => {
Expand Down
4 changes: 2 additions & 2 deletions src/recoil/atomState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +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';
import type { CustomTiles } from '../types/l7editor';

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

const customTilesState = atom<CustomTilesProps[]>({
const customTilesState = atom<CustomTiles[]>({
key: 'customTiles',
default: [],
effects: [localStorageEffect(LocalStorageKey.customTiles)],
Expand Down
4 changes: 2 additions & 2 deletions src/types/l7editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { LarkMapProps } from '@antv/larkmap';
import type { Feature } from '@turf/turf';
import type { TabsProps } from 'antd';

export interface CustomTilesProps {
export interface CustomTiles {
[key: string]: any;
id: string;
image: string;
Expand Down Expand Up @@ -158,5 +158,5 @@ export interface L7EditorProps {
/**
* 自定义瓦片底图图层
*/
customTiles?: CustomTilesProps[];
customTiles?: CustomTiles[];
}

0 comments on commit 02800cb

Please sign in to comment.