⚡ 统一地图选址搜索为高德 place/text 并展示分页候选

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-28 00:19:17 +08:00
parent b5043575e4
commit 8b9c908237
10 changed files with 166 additions and 158 deletions
+5 -2
View File
@@ -1,12 +1,15 @@
/** 地点搜索 v5/place/text 使用的「Web 服务」类型 Key */
export const AMAP_WEB_SERVICE_KEY = 'b43016a0d1f5b0c32211560392059708';
/**
* 高德地点关键词搜索(Web 服务 v5)。
* @see https://restapi.amap.com/v5/place/text
* @param {string} keyword 地点关键字
* @param {{ key: string, pageSize?: number, pageNum?: number, region?: string, cityLimit?: boolean }} options
* @param {{ key?: string, pageSize?: number, pageNum?: number, region?: string, cityLimit?: boolean }} options
* @returns {Promise<Array>}
*/
export function searchAmapPlaceText(keyword, options = {}) {
const key = options.key;
const key = options.key || AMAP_WEB_SERVICE_KEY;
const pageSize = options.pageSize || 20;
const pageNum = options.pageNum || 1;
if (!key) {