增加参数

This commit is contained in:
2026-01-30 13:01:50 +08:00
parent aa52a56bcf
commit bc99ffd691

View File

@@ -250,7 +250,7 @@ body.panel-active .amap-scalecontrol {
/**
* 核心功能 1: 接收 Flutter 传来的定位数据
* Flutter 端调用: webViewController.evaluateJavascript("updateMyLocation(...)")
*
*
*/
function updateMyLocation(lat, lng, angle) {
var rawLat = parseFloat(lat);
@@ -297,7 +297,7 @@ body.panel-active .amap-scalecontrol {
console.log("地理:" + JSON.stringify(result));
fetchStationInfo(addressComponent.province, addressComponent.city,
addressComponent.district);
addressComponent.district,lat,lng);
// 策略1: 优先使用最近的、类型合适的POI的名称
if (pois && pois.length > 0) {
@@ -351,7 +351,7 @@ body.panel-active .amap-scalecontrol {
/**
* 调用后端接口获取站点
*/
function fetchStationInfo(province, city, district) {
function fetchStationInfo(province, city, district,lat,lng) {
// 注意:某些直辖市在高德中 city 字段可能为空,需做兼容处理
console.log("JS->: 开始请求." + province + city + district);
var cityName = (typeof city === 'string' && city.length > 0) ? city : province;
@@ -365,7 +365,9 @@ body.panel-active .amap-scalecontrol {
body: JSON.stringify({
province: province,
city: cityName,
district: district
district: district,
longitude: lng,
latitude: lat,
})
})
.then(response => {