|
|
|
@ -81,6 +81,7 @@ export class LinkageForcesComponent implements OnInit {
|
|
|
|
|
createMarker(list){ |
|
|
|
|
let markerArrcluster = [] |
|
|
|
|
this.cluster ? this.cluster.setData([]) : null |
|
|
|
|
console.log(678,list) |
|
|
|
|
list.forEach((item) => { |
|
|
|
|
let image |
|
|
|
|
if(item.linkageForceType == 0){//消火栓
|
|
|
|
@ -115,11 +116,13 @@ export class LinkageForcesComponent implements OnInit {
|
|
|
|
|
image = '/assets/linkageForcesMarkers/住建.png' |
|
|
|
|
} |
|
|
|
|
// 用于点集合的数组
|
|
|
|
|
if(item.location && item.location.x){ |
|
|
|
|
markerArrcluster.push({ |
|
|
|
|
lnglat : [item.location.x,item.location.y], |
|
|
|
|
image : image, |
|
|
|
|
data : item |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.map.plugin(["AMap.MarkerClusterer"],() => { |
|
|
|
|
var gridSize = 60 |
|
|
|
@ -172,8 +175,15 @@ export class LinkageForcesComponent implements OnInit {
|
|
|
|
|
ngOnInit(): void {
|
|
|
|
|
this.getAllFireForce() |
|
|
|
|
setTimeout(() => { |
|
|
|
|
console.log(document.documentElement.clientWidth) |
|
|
|
|
let slidesPerView |
|
|
|
|
if(document.documentElement.clientWidth < 1400){ |
|
|
|
|
slidesPerView = 5 |
|
|
|
|
}else{ |
|
|
|
|
slidesPerView = 10 |
|
|
|
|
} |
|
|
|
|
var mySwiper = new Swiper('.swiper-container', { |
|
|
|
|
slidesPerView: 10,//每页显示的个数
|
|
|
|
|
slidesPerView: slidesPerView,//每页显示的个数
|
|
|
|
|
slidesPerGroup: 3,//点击一次需要跳多少次
|
|
|
|
|
// 如果需要前进后退按钮
|
|
|
|
|
navigation: { |
|
|
|
@ -597,6 +607,37 @@ export class LinkageForcesComponent implements OnInit {
|
|
|
|
|
this.positionLngLat = this.atLastPositionLngLat |
|
|
|
|
} |
|
|
|
|
})//取消
|
|
|
|
|
//点击确定
|
|
|
|
|
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionOk'),'touchstart',(event)=>{
|
|
|
|
|
this.isGisTopBox = false |
|
|
|
|
this.map.remove(this.newPositionMarker) |
|
|
|
|
this.newPositionMarker = new AMap.Marker({ |
|
|
|
|
position: [this.positionLngLat.x,this.positionLngLat.y], |
|
|
|
|
content: this.newPositionMarkerContent, |
|
|
|
|
offset: new AMap.Pixel(-15, -18) |
|
|
|
|
}); |
|
|
|
|
this.atLastPositionLngLat = JSON.parse(JSON.stringify(this.positionLngLat)) |
|
|
|
|
this.map.add(this.newPositionMarker); |
|
|
|
|
this.positionLngLat = this.atLastPositionLngLat |
|
|
|
|
}) |
|
|
|
|
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionClose'),'touchstart',(event)=>{
|
|
|
|
|
this.isGisTopBox = false |
|
|
|
|
this.map.remove(this.newPositionMarker) |
|
|
|
|
if(this.positionLngLat.x && this.positionLngLat.x != 0 && !this.atLastPositionLngLat.x){//直接取消
|
|
|
|
|
this.map.remove(this.newPositionMarker) |
|
|
|
|
this.positionLngLat = {} |
|
|
|
|
this.atLastPositionLngLat = {} |
|
|
|
|
}else{ |
|
|
|
|
this.newPositionMarker = new AMap.Marker({ |
|
|
|
|
position: [this.atLastPositionLngLat.x,this.atLastPositionLngLat.y], |
|
|
|
|
content: this.newPositionMarkerContent, |
|
|
|
|
offset: new AMap.Pixel(-15, -18) |
|
|
|
|
}); |
|
|
|
|
this.map.setCenter([this.atLastPositionLngLat.x,this.atLastPositionLngLat.y]); //设置地图中心点
|
|
|
|
|
this.map.add(this.newPositionMarker); |
|
|
|
|
this.positionLngLat = this.atLastPositionLngLat |
|
|
|
|
} |
|
|
|
|
})//取消
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|