⚡ 统一地图选址搜索为高德 place/text 并展示分页候选
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -27,8 +27,6 @@
|
||||
import { normalizeMapSearchResults, searchAmapPlaceText } from '@/utils/map-search';
|
||||
|
||||
const AMAP_KEY = '13dcb15bc29bfe9c432d17ecd808b812';
|
||||
/** 地点搜索 v5/place/text 使用「Web 服务」类型 Key,由业务自行填写 */
|
||||
const AMAP_WEB_KEY = 'b43016a0d1f5b0c32211560392059708';
|
||||
const AMAP_SECURITY_CODE = 'f9d036ef29e376e15d309e0de5c0f7ab';
|
||||
let amapLoader;
|
||||
|
||||
@@ -222,15 +220,11 @@ export default {
|
||||
this.$message.warning('请输入地址关键词');
|
||||
return;
|
||||
}
|
||||
if (!AMAP_WEB_KEY) {
|
||||
this.$message.warning('请先配置高德 Web 服务 Key');
|
||||
return;
|
||||
}
|
||||
if (this.searching) return;
|
||||
this.searchResults = [];
|
||||
this.searching = true;
|
||||
this.initMap()
|
||||
.then(map => (map ? searchAmapPlaceText(keyword, { key: AMAP_WEB_KEY }) : null))
|
||||
.then(map => (map ? searchAmapPlaceText(keyword) : null))
|
||||
.then(pois => {
|
||||
if (!pois) return;
|
||||
this.searchResults = normalizeMapSearchResults(pois, keyword);
|
||||
|
||||
Reference in New Issue
Block a user