Skip to content

Commit

Permalink
fix: 修改 LocationSearch 高德 key 值
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoqianci committed May 6, 2024
1 parent 56f1328 commit f9fb23c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/components/LocationSearch/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@
export const CLS_PREFIX = 'larkmap-location-search';

export const GAO_DE_API_URL = 'https://restapi.amap.com/v3/assistant/inputtips';

export const AMAP_KEY_LIST = [
'b93400c020206bd6865a075036e7f423',
'20a5ed5ecb2756a0361e83e794b4aa0a',
'fdd01f9a9dd6846239b9523d7923339b',
'053b838db2f7b6a871b6ec5dbf62ab62',
];
3 changes: 2 additions & 1 deletion src/components/LocationSearch/demos/default.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { LocationSearchOption } from '@antv/larkmap';
import { CustomControl, LarkMap, LocationSearch } from '@antv/larkmap';
import { message } from 'antd';
import React, { useCallback, useEffect, useState } from 'react';
import { AMAP_KEY_LIST } from '../constant';

export default () => {
const [location, setLocation] = useState('');
Expand Down Expand Up @@ -44,7 +45,7 @@ export default () => {
<CustomControl position="topleft">
<LocationSearch
searchParams={{
key: '4892acc9f825e343bcf1e25a56199826',
key: AMAP_KEY_LIST[Math.floor(Math.random() * AMAP_KEY_LIST.length)],
location,
}}
autoFocus
Expand Down

0 comments on commit f9fb23c

Please sign in to comment.