story#7074,地图搜索位置改动为后台接口
This commit is contained in:
@ -75,14 +75,13 @@
|
|||||||
}
|
}
|
||||||
let content = '<div class="dest-position"></div>';
|
let content = '<div class="dest-position"></div>';
|
||||||
let activeObj = this.addressList[this.activeIndex];
|
let activeObj = this.addressList[this.activeIndex];
|
||||||
let lanLat = activeObj.location.split(',');
|
|
||||||
this.marker = new AMap.Marker({
|
this.marker = new AMap.Marker({
|
||||||
position: new AMap.LngLat( lanLat[0], lanLat[1] ),
|
position: new AMap.LngLat( activeObj.location.lng, activeObj.location.lat ),
|
||||||
content: content,
|
content: content,
|
||||||
offset: new AMap.Pixel(-13, -30)
|
offset: new AMap.Pixel(-13, -30)
|
||||||
});
|
});
|
||||||
this.map.add(this.marker)
|
this.map.add(this.marker)
|
||||||
this.map.setCenter([lanLat[0], lanLat[1]])
|
this.map.setCenter([activeObj.location.lng, activeObj.location.lat])
|
||||||
},
|
},
|
||||||
successHandler() {
|
successHandler() {
|
||||||
if( this.activeIndex == null ) {
|
if( this.activeIndex == null ) {
|
||||||
@ -90,11 +89,10 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
let activeObj = this.addressList[this.activeIndex];
|
let activeObj = this.addressList[this.activeIndex];
|
||||||
let lanLat = activeObj.location.split(',');
|
|
||||||
let _tempObj = {
|
let _tempObj = {
|
||||||
startPoiAddress: activeObj?.address + activeObj?.name,
|
startPoiAddress: activeObj?.address + activeObj?.name,
|
||||||
startLat: lanLat[0],
|
startLat: activeObj?.location?.lat,
|
||||||
startLng: lanLat[1],
|
startLng: activeObj?.location?.lng,
|
||||||
adCode: activeObj?.adcode,
|
adCode: activeObj?.adcode,
|
||||||
}
|
}
|
||||||
sessionStorage.setItem('reportAddress', JSON.stringify(_tempObj))
|
sessionStorage.setItem('reportAddress', JSON.stringify(_tempObj))
|
||||||
|
Reference in New Issue
Block a user