Commit 151f57e5 authored by zhangjianqian's avatar zhangjianqian

点击中心点

parent 2f8c698d
......@@ -734,6 +734,9 @@ export class EditorMap {
});
}
}
setZoomAndCenter(longitude,latitude){
this.map.setZoomAndCenter(14, [longitude,latitude]);
}
// 普通调用方法
// 设备报警
deviceAlarm(obj) {
......
......@@ -484,8 +484,9 @@ export default {
this.map = new EditorMap(
"map",
{
center: path,
//center: path,
//mapStyle: "amap://styles/f71d3a3d73e14f5b2bf5508bf1411758",
center: [114.208007, 38.260288],
zoom: 14.5,
},
this
......@@ -610,8 +611,8 @@ export default {
this.dialogTableVisible = false;
},
getPath(res){
console.log("res", res);
console.log(this.form.longitude, this.form.latitude);
//console.log("res", res);
//console.log(this.form.longitude, this.form.latitude);
//确认选择经纬度
this.form.longitude = res[0];
this.form.latitude = res[1];
......@@ -757,12 +758,30 @@ export default {
this.selarr1.splice(ind, 1);
} else {
this.selarr1.push(item.val);
//找中心点
console.log(item.val);
if(item.val>=10){
for(var i=0;i<this.deviceList.length;i++){
if(this.deviceList[i].iconType==item.val){
console.log(this.deviceList[i])
this.map.setZoomAndCenter(this.deviceList[i].longitude,this.deviceList[i].latitude);
break;
}
}
// this.deviceList.forEach((item2) => (
// if(item2.iconType==item.val){
//
// }
//
// ));
}
}
this.map.allfilter(this.selarr, this.selarr1);
//this.map.setZoomAndCenter(14, [116.326655,39.899438]);
},
//用户的设备center
getDetectorInfoList(httpFunc, queryParams, title) {
console.log(queryParams);
//console.log(queryParams);
return httpFunc(queryParams).then((res) => {
// console.log("queryParams", res);
if (res.code == 200) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment