From c10b1e130ccbc94e6481a43e8e2d35cfc8fcf83b Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期五, 26 十二月 2025 18:05:06 +0800
Subject: [PATCH] feat:显示问题

---
 app/api/map.js |   30 +++++++++++++++++++++++++-----
 1 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/app/api/map.js b/app/api/map.js
index 03b2060..e8502b3 100644
--- a/app/api/map.js
+++ b/app/api/map.js
@@ -1,17 +1,18 @@
 import request from '@/utils/request'
 
 // 鍦板浘鍦板潃鎼滅储API
-export function searchAddress(keyword, region) {
+export function searchTianDiTuAddress(keyword, region) {
   // 鍙傛暟楠岃瘉
   if (!keyword) {
     return Promise.reject(new Error('鍙傛暟涓嶅畬鏁达紝缂哄皯鍏抽敭璇�'))
   }
   
   return request({
-    url: '/system/gps/address/search',
+//    url: '/system/gps/address/search',
+    url: '/system/gps/tianditu/place/suggestion',
     method: 'get',
     params: {
-      keyword: keyword,
+      keyWord: keyword,
       region: region || '骞垮窞'
     }
   })
@@ -28,9 +29,12 @@
   if (isNaN(lat) || isNaN(lng)) {
     return Promise.reject(new Error('鍙傛暟鏃犳晥锛岀粡绾害鍧愭爣鏍煎紡閿欒'))
   }
-  
+  /**
+   * 杩欓噷鐢ㄥ埌澶╁湴鍥�
+   */
   return request({
-    url: '/system/gps/address/geocoder',
+    // url: '/system/gps/address/geocoder',
+    url: '/system/gps/tianditu/reverseGeocoding',
     method: 'get',
     params: {
       lat: lat,
@@ -39,6 +43,21 @@
   })
 }
 
+export function calculateTianDiTuDistance(fromAddress, toAddress) {
+  // 鍙傛暟楠岃瘉
+  if (!fromAddress || !toAddress) {
+    return Promise.reject(new Error('鍙傛暟涓嶅畬鏁达紝缂哄皯鍦板潃'))
+  }
+
+  return request({
+    url: '/system/gps/tianditu/distance/byAddress',
+    method: 'get',
+    params: {
+      fromAddress: fromAddress,
+      toAddress: toAddress
+    }
+  })
+}
 // 鍦板浘璺嚎瑙勫垝API锛堣绠椾袱鐐归棿璺濈锛�
 export function calculateDistance(fromLat, fromLng, toLat, toLng) {
   // 鍙傛暟楠岃瘉
@@ -56,6 +75,7 @@
   
   return request({
     url: '/system/gps/route/distance',
+    // url: '/system/gps/tianditu/byAddress',
     method: 'get',
     params: {
       fromLat: fromLat,

--
Gitblit v1.9.1