|
|
@@ -13,6 +13,10 @@ function hidInputView(){
|
|
|
// citys.style.display = "none"; //设置样式为不显示(隐藏)
|
|
|
}
|
|
|
|
|
|
+function driverLocateCH(obj){//外部传入新的定位信息
|
|
|
+ //处理地图更新
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
document.addEventListener('UniAppJSBridgeReady', function() {
|
|
|
var lats = getQueryVariable('lat') * 1;
|
|
|
@@ -30,6 +34,7 @@ var mpcenter = "";
|
|
|
var searchmarker = "";
|
|
|
|
|
|
|
|
|
+
|
|
|
var showinput=false;
|
|
|
|
|
|
|
|
|
@@ -103,6 +108,7 @@ function initMap() {
|
|
|
if(lg==3){
|
|
|
box.placeholder='請輸入目的地...';
|
|
|
}
|
|
|
+
|
|
|
Repositioning();
|
|
|
ListeningInputBox();
|
|
|
}
|
|
|
@@ -184,7 +190,7 @@ function getAddress(latlng,name,mark) {
|
|
|
name:name//地址名称
|
|
|
}
|
|
|
geocoder.geocode({
|
|
|
- location: latlng
|
|
|
+ location: latlng,
|
|
|
}, function(results, status) {
|
|
|
if (status === 'OK') {
|
|
|
if (results[0]) {
|
|
|
@@ -195,22 +201,22 @@ function getAddress(latlng,name,mark) {
|
|
|
var component = components[j];
|
|
|
if (component.types.includes("country")) {
|
|
|
console.log("国家: ====>" + component.long_name);
|
|
|
- cityInfo.country = component.long_name || '暂无';
|
|
|
+ cityInfo.country = component.long_name || '';
|
|
|
} else if (component.types.includes("administrative_area_level_1")) {
|
|
|
console.log("省/州: ====>" + component.long_name);
|
|
|
- cityInfo.province = component.long_name || '暂无';
|
|
|
+ cityInfo.province = component.long_name || '';
|
|
|
} else if (component.types.includes("locality")) {
|
|
|
console.log("城市: ====> " + component.long_name);
|
|
|
- cityInfo.city = component.long_name || '暂无';
|
|
|
+ cityInfo.city = component.long_name || '';
|
|
|
} else if (component.types.includes("sublocality_level_1")) {
|
|
|
console.log("区/县: ====>" + component.long_name);
|
|
|
- cityInfo.district = component.long_name || '暂无';
|
|
|
+ cityInfo.district = component.long_name || '';
|
|
|
} else if (component.types.includes("route")) {
|
|
|
console.log("路/街道名: ====> " + component.long_name);
|
|
|
- cityInfo.street = component.long_name || '暂无';
|
|
|
+ cityInfo.street = component.long_name || '';
|
|
|
} else if (component.types.includes("street_number")) {
|
|
|
console.log("门牌号: ====> " + component.long_name);
|
|
|
- cityInfo.door = component.long_name || '暂无';
|
|
|
+ cityInfo.door = component.long_name || '';
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -377,6 +383,7 @@ function startDrawRoute(directionsService, travelMode) {
|
|
|
scaledSize: new google.maps.Size(50, 50),
|
|
|
},
|
|
|
});
|
|
|
+
|
|
|
drawRouteMarker.push(startMarker)
|
|
|
var endMarker = new google.maps.Marker({
|
|
|
position: result.routes[0].legs[0].end_location,
|