Commit 8ac366c3 authored by 纪泽龙's avatar 纪泽龙

松原项目,优化了每10秒就缩放的问题,新增阀门井跟调压箱内的工业报警器表格

parent 94583016
......@@ -425,13 +425,15 @@ class gaodeMap {
});
}
// 如果这个值为false说明不是workerpoint,就push进去
// 如果这个值为false说明不是workerpoint,就push进去 或者不是值班人员就让他缩放
if (!marker.workerPoint) {
this.markers.push(marker);
map.setZoom("13");
// 如果是值班人员也不缩放
if (markerType != DEVICE_TYPE.INSPECTOR) {
map.setZoom("13");
}
}
//map.setFitView();
function infoClose(e) {
let options = map.getStatus();
options.scrollWheel = true;
......@@ -443,6 +445,30 @@ class gaodeMap {
return marker;
}
// 删除地图上marker 跟数组里的marker
removeMarker(type) {
// 获取过滤出来的marker
// 如果打开的是档期那type人员,就清空infowindow
if(this.markerType == type){
this.closeInfoWindow()
}
const newOriginMaker = this.markers.filter(item => {
console.log(item.markerType)
return item.markerType == type;
});
newOriginMaker.forEach(item => {
this.myMap.remove(item)
});
console.log(newOriginMaker);
newOriginMaker.forEach(item => {
const index = this.markers.findIndex(
iten => iten.getExtData().deviceType == type
);
if (index < 0) {
this.markers.splice(index, 1);
}
});
}
// 值班人员
wokerManOpen = e => {
this.markerType = e.target.markerType;
......
......@@ -630,6 +630,7 @@ export default {
setInspectorLocationsInterval(){
// 设置定时器,5s执行一次
let timer = setInterval(() => {
this.gaoMap.removeMarker(DEVICE_TYPE.INSPECTOR);
this.getInspectorLocations();
}, 10000);
......
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