1
This commit is contained in:
Vendored
-38
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Pointly-Tel - 高德POI商户查询</title>
|
||||
<script type="module" crossorigin src="/assets/index-CB8CRFzz.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-Bb-YnKrp.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-C3fajWoH.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -341,6 +341,15 @@ function onSuggestArrow(dir) {
|
||||
function selectSuggestion(item) {
|
||||
keywords.value = item.name
|
||||
hideSuggestions()
|
||||
// 联想位置有坐标则设为搜索中心点
|
||||
if (item.longitude && item.latitude) {
|
||||
const lat = parseFloat(item.latitude)
|
||||
const lng = parseFloat(item.longitude)
|
||||
if (!isNaN(lat) && !isNaN(lng)) {
|
||||
centerLat.value = lat
|
||||
centerLng.value = lng
|
||||
}
|
||||
}
|
||||
doSearch()
|
||||
}
|
||||
|
||||
@@ -356,6 +365,16 @@ async function doSearch() {
|
||||
return
|
||||
}
|
||||
|
||||
// 搜索前跳转地图到目标区域
|
||||
if (mapRef.value) {
|
||||
if (hasCoord) {
|
||||
mapRef.value.flyTo(centerLat.value, centerLng.value, 14)
|
||||
} else if (city.value && cityCoords[city.value]) {
|
||||
const coord = cityCoords[city.value]
|
||||
mapRef.value.flyTo(coord[0], coord[1], 12)
|
||||
}
|
||||
}
|
||||
|
||||
loading.value = true
|
||||
searched.value = true
|
||||
activePoi.value = null
|
||||
|
||||
Reference in New Issue
Block a user