|
|
|
@ -165,9 +165,6 @@ export class BasicinfoComponent implements OnInit {
|
|
|
|
|
this.map.on('complete', () => { |
|
|
|
|
this.isGisTopBox = true |
|
|
|
|
}); |
|
|
|
|
this.map.on('click', (e) => { |
|
|
|
|
console.log(e.lnglat) |
|
|
|
|
}); |
|
|
|
|
//输入提示
|
|
|
|
|
var autoOptions = { |
|
|
|
|
input: "tipinput" |
|
|
|
@ -227,10 +224,14 @@ export class BasicinfoComponent implements OnInit {
|
|
|
|
|
this.markerPosition2 = { x: this.map.getCenter().lng, y: this.map.getCenter().lat } //获取当前地图中心位置
|
|
|
|
|
} |
|
|
|
|
this.newPositionMarker.on('dragend', (e) => { |
|
|
|
|
this.markerPosition2 = { x: e.lnglat.KL, y: e.lnglat.kT } |
|
|
|
|
let lnglat = this.map.containerToLngLat(e.pixel) |
|
|
|
|
this.markerPosition2 = { x: lnglat.KL, y: lnglat.kT } |
|
|
|
|
// console.log(`${lnglat.KL},${lnglat.kT}`);
|
|
|
|
|
}) |
|
|
|
|
this.newPositionMarker.on('dragging', (e) => { |
|
|
|
|
this.newPositionMarker.setPosition(new AMap.LngLat(e.lnglat.lng, e.lnglat.lat)); |
|
|
|
|
//console.log('dragging',e)
|
|
|
|
|
let lnglat = this.map.containerToLngLat(e.pixel) |
|
|
|
|
this.newPositionMarker.setPosition(lnglat); |
|
|
|
|
}) |
|
|
|
|
//点击确定
|
|
|
|
|
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionOk'), 'click', (event) => { |
|
|
|
@ -270,7 +271,7 @@ export class BasicinfoComponent implements OnInit {
|
|
|
|
|
center = [this.markerPosition.x, this.markerPosition.y] |
|
|
|
|
} else { |
|
|
|
|
center = this.map.getCenter(); //获取当前地图中心位置
|
|
|
|
|
console.log('获取当前地图中心位置', center) |
|
|
|
|
// console.log('获取当前地图中心位置', center)
|
|
|
|
|
this.map.setCenter(center); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -290,7 +291,7 @@ export class BasicinfoComponent implements OnInit {
|
|
|
|
|
this.newPositionMarker.on('dragend', (e) => { |
|
|
|
|
let lnglat = this.map.containerToLngLat(e.pixel) |
|
|
|
|
this.markerPosition2 = { x: lnglat.KL, y: lnglat.kT } |
|
|
|
|
console.log(`${lnglat.KL},${lnglat.kT}`); |
|
|
|
|
// console.log(`${lnglat.KL},${lnglat.kT}`);
|
|
|
|
|
}) |
|
|
|
|
this.newPositionMarker.on('dragging', (e) => { |
|
|
|
|
//console.log('dragging',e)
|
|
|
|
@ -861,7 +862,7 @@ export class BasicinfoComponent implements OnInit {
|
|
|
|
|
name: this.unitinfo.name, |
|
|
|
|
usci: value.creditcode, |
|
|
|
|
contacts: value.linkman, |
|
|
|
|
phone: value.linkphone, |
|
|
|
|
phone: String(value.linkphone), |
|
|
|
|
address: value.unitaddress, |
|
|
|
|
imageUrl: this.imgsrc, |
|
|
|
|
location: this.markerPosition, |
|
|
|
|