提交 ba12d482 authored 作者: quanlili's avatar quanlili

Merge branch 'qll' into dev

......@@ -592,30 +592,18 @@ export default {
this.entityForm.resourceId=this.$route.query.id;
this.getDetail();
this.getPerson();
//this.handleMap();
},
methods: {
//window.open(`${this.domain}${requestPath.file}?fileName=${val}&isOnLine=true`)
handleMap({BMap, map}){
//var myGeo = new BMap.Geocoder();
// 将地址解析结果显示在地图上,并调整地图视野
//myGeo.getPoint("昆明市", function(point){
//console.log(point,'ppppppp')
//if (point) {
// map.centerAndZoom(point, 16);
// map.addOverlay(new BMap.Marker(point));
//}
//});
//console.log(BMap, map)
let _this=this;
let myMap=map;
// var map = new BMap.Map('myMap');
map.addEventListener("click",function(e){
map.addEventListener("click",function(e){//添加地图点击事件
let target=e;
_this.remove(target)
//this.positionForm.longitude=target.point.lng;
//this.positionForm.latitude=target.point.lat;
console.log(e,"测试一下")
});
},
getDetail(){
......@@ -792,8 +780,23 @@ export default {
}else if(this.backForm.state==3){
if(res.data.data){
this.positionForm=res.data.data;
if(!this.positionForm.longitude){
this.city="北京";//地图的显示中心
if(!this.positionForm.longitude){//没有爬到数据时;
let _this=this;
var myGeo = new BMap.Geocoder();
//根据keyword将地址解析结果显示在地图上,并调整地图视野
myGeo.getPoint(this.backForm.keyword, function(point){
if (point) {
_this.positionForm.longitude=point.lng;
_this.positionForm.latitude=point.lat;
// 根据坐标得到地址描述
myGeo.getLocation(new BMap.Point(point.lng, point.lat), function(result){
if (result){
_this.positionForm.detailedaddress=result.address;
}
});
_this.city=_this.backForm.keyword;//地图的显示中心
}
});
}
}else{
this.city="北京";//地图的显示中心
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论