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