|
|
|
@ -264,7 +264,32 @@ export class BasicinfoComponent implements OnInit {
|
|
|
|
|
this.map.setCenter([this.markerPosition.x,this.markerPosition.y]); //设置地图中心点
|
|
|
|
|
this.map.add(this.newPositionMarker);
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
//点击确定
|
|
|
|
|
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionOk'),'touchstart',(event)=>{
|
|
|
|
|
this.map.clearMap(); |
|
|
|
|
this.isGisTopBox = true |
|
|
|
|
this.isGisTopBoxTwo = false |
|
|
|
|
this.newPositionMarker = new AMap.Marker({ |
|
|
|
|
position: [this.markerPosition2.x,this.markerPosition2.y], |
|
|
|
|
content: this.newPositionMarkerContent, |
|
|
|
|
offset: new AMap.Pixel(-15, -18) |
|
|
|
|
}); |
|
|
|
|
this.markerPosition = this.markerPosition2 |
|
|
|
|
this.map.add(this.newPositionMarker); |
|
|
|
|
}) |
|
|
|
|
//点击取消
|
|
|
|
|
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionClose'),'touchstart',(event)=>{
|
|
|
|
|
this.isGisTopBox = true |
|
|
|
|
this.isGisTopBoxTwo = false |
|
|
|
|
this.map.clearMap(); |
|
|
|
|
this.newPositionMarker = new AMap.Marker({ |
|
|
|
|
position: [this.markerPosition.x,this.markerPosition.y], |
|
|
|
|
content: this.newPositionMarkerContent, |
|
|
|
|
offset: new AMap.Pixel(-15, -18) |
|
|
|
|
}); |
|
|
|
|
this.map.setCenter([this.markerPosition.x,this.markerPosition.y]); //设置地图中心点
|
|
|
|
|
this.map.add(this.newPositionMarker);
|
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
// console.log('未标注单位位置')
|
|
|
|
|
if(this.newPositionMarker){ |
|
|
|
@ -294,6 +319,7 @@ export class BasicinfoComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
this.newPositionMarker.on('dragend', (e)=>{ |
|
|
|
|
this.markerPosition2 = {x: e.lnglat.lng, y: e.lnglat.lat} |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
//点击确定
|
|
|
|
|
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionOk'),'click',(event)=>{
|
|
|
|
@ -308,6 +334,18 @@ export class BasicinfoComponent implements OnInit {
|
|
|
|
|
}); |
|
|
|
|
this.map.add(this.newPositionMarker); |
|
|
|
|
}) |
|
|
|
|
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionOk'),'touchstart',(event)=>{
|
|
|
|
|
this.isGisTopBox = true |
|
|
|
|
this.isGisTopBoxTwo = false |
|
|
|
|
this.markerPosition = this.markerPosition2 |
|
|
|
|
this.map.clearMap(); |
|
|
|
|
this.newPositionMarker = new AMap.Marker({ |
|
|
|
|
position: [this.markerPosition.x,this.markerPosition.y], |
|
|
|
|
content: this.newPositionMarkerContent, |
|
|
|
|
offset: new AMap.Pixel(-15, -18) |
|
|
|
|
}); |
|
|
|
|
this.map.add(this.newPositionMarker); |
|
|
|
|
}) |
|
|
|
|
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionClose'),'click',(event)=>{
|
|
|
|
|
this.map.clearMap(); |
|
|
|
|
this.isGisTopBox = true |
|
|
|
@ -322,6 +360,20 @@ export class BasicinfoComponent implements OnInit {
|
|
|
|
|
this.map.add(this.newPositionMarker); |
|
|
|
|
} |
|
|
|
|
})//取消
|
|
|
|
|
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionClose'),'touchstart',(event)=>{
|
|
|
|
|
this.map.clearMap(); |
|
|
|
|
this.isGisTopBox = true |
|
|
|
|
this.isGisTopBoxTwo = false |
|
|
|
|
if(this.markerPosition.x && this.markerPosition.x != 0){//说明之前标过点
|
|
|
|
|
this.newPositionMarker = new AMap.Marker({ |
|
|
|
|
position: [this.markerPosition.x,this.markerPosition.y], |
|
|
|
|
content: this.newPositionMarkerContent, |
|
|
|
|
offset: new AMap.Pixel(-15, -18) |
|
|
|
|
}); |
|
|
|
|
this.map.setCenter([this.markerPosition.x,this.markerPosition.y]); //设置地图中心点
|
|
|
|
|
this.map.add(this.newPositionMarker); |
|
|
|
|
} |
|
|
|
|
})//取消
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|