|
@@ -277,12 +277,16 @@
|
|
|
}
|
|
|
this.imgUrl = imgurl;
|
|
|
},
|
|
|
- loadMap(points, currPoints) {
|
|
|
+ loadMap(points, namePoint, centerPoint) {
|
|
|
let map = new BMap.Map("mapcontainer");
|
|
|
map.enableScrollWheelZoom();// 启用滚轮缩放
|
|
|
map.enableDragging(); // 启用拖拽功能
|
|
|
// 设定中心点和地图级别
|
|
|
- map.centerAndZoom(new BMap.Point(106.651444, 29.48682), 15);
|
|
|
+ if (!centerPoint) { map.centerAndZoom(new BMap.Point(106.64100001869987, 29.479255312672327), 17); } else {
|
|
|
+ let centerarr = centerPoint.split(',');
|
|
|
+ map.centerAndZoom(new BMap.Point(centerarr[0], centerarr[1]), 17);
|
|
|
+ }
|
|
|
+ // map.centerAndZoom(new BMap.Point(106.64100001869987, 29.479255312672327), 17);
|
|
|
map.setMapType(BMAP_SATELLITE_MAP);
|
|
|
if (!points) return;
|
|
|
let pointList = points.split('@');
|
|
@@ -303,10 +307,16 @@
|
|
|
// 将多边形添加到地图中
|
|
|
map.addOverlay(polygon);
|
|
|
// 创建文本标签
|
|
|
+ if (!namePoint) return;
|
|
|
+ let namearr = namePoint.split(',');
|
|
|
var opts = {
|
|
|
- position: new BMap.Point(106.644876, 29.491868), // 指定文本标签所在的地理位置
|
|
|
+ position: new BMap.Point(namearr[0], namearr[1]), // 指定文本标签所在的地理位置
|
|
|
offset: new BMap.Size(10, 10) // 设置文本偏移量
|
|
|
};
|
|
|
+ // var opts = {
|
|
|
+ // position: new BMap.Point(106.64000001869987, 29.481385312672327), // 指定文本标签所在的地理位置
|
|
|
+ // offset: new BMap.Size(10, 10) // 设置文本偏移量
|
|
|
+ // };
|
|
|
// 创建文本标签对象,并添加到地图
|
|
|
var label = new BMap.Label(this.tdcrDetail.landName, opts);
|
|
|
// 自定义文本标签样式
|
|
@@ -325,15 +335,15 @@
|
|
|
});
|
|
|
map.addOverlay(label);
|
|
|
|
|
|
- // 添加选择地址
|
|
|
- if (!currPoints) return;
|
|
|
- let pList = currPoints.split('@');
|
|
|
- pList.forEach(function (point) {
|
|
|
- let arr = point.split(',');
|
|
|
- let p = new BMap.Point(arr[0], arr[1]);
|
|
|
- let marker = new BMap.Marker(p);
|
|
|
- map.addOverlay(marker);
|
|
|
- });
|
|
|
+ // // 添加选择地址
|
|
|
+ // if (!currPoints) return;
|
|
|
+ // let pList = currPoints.split('@');
|
|
|
+ // pList.forEach(function (point) {
|
|
|
+ // let arr = point.split(',');
|
|
|
+ // let p = new BMap.Point(arr[0], arr[1]);
|
|
|
+ // let marker = new BMap.Marker(p);
|
|
|
+ // map.addOverlay(marker);
|
|
|
+ // });
|
|
|
},
|
|
|
getLandDetail(id) {
|
|
|
let that = this;
|
|
@@ -344,6 +354,7 @@
|
|
|
dataType: "json",
|
|
|
success: function (d) {
|
|
|
let data = d.data;
|
|
|
+ console.log(data)
|
|
|
if (!data) return;
|
|
|
that.tdcrDetail = data;
|
|
|
that.swiperList = data.imgUrl ? data.imgUrl.split(",") : [];
|
|
@@ -352,7 +363,8 @@
|
|
|
}
|
|
|
that.imgUrl = that.swiperList[0];
|
|
|
let points = data.parkData.addr;
|
|
|
- that.loadMap(points, data.point);
|
|
|
+ that.loadMap(data.point, data.namePoint, data.centerPoint)
|
|
|
+ // that.loadMap("106.644876,29.494949@106.635821,29.481304@106.638048,29.480675@106.645379,29.481744@106.648397,29.479921@106.65429,29.480675@106.66392,29.481367@106.663057,29.486209@106.662985,29.486901@106.666076,29.48885@106.666507,29.490233@106.665573,29.493817@106.66162,29.49564@106.661692,29.493503@106.659105,29.49344@106.658171,29.491868@106.654721,29.492874@106.65314,29.494383@106.651415,29.496143@106.649475,29.493251");
|
|
|
}
|
|
|
});
|
|
|
}
|