|
|
|
@ -712,7 +712,7 @@ export class GisLabelingComponent implements OnInit {
|
|
|
|
|
let markerContent = `<div style="font-size: 14px" id="gispopupbox">
|
|
|
|
|
<div style="color: #0080FF;"><span style="margin-left:8px">${e.name}</span><label style="font-size: 12px; color: #999; margin-left: 10px">${e.address}</label> </div> |
|
|
|
|
<div style="display: flex; margin-top: 10px;margin-left:8px"> |
|
|
|
|
<div style="width:240px; overflow: hidden;">单位性质: <label style="margin-left: 10px;font-size: 12px;">${e.buildingTypes[0].name || "暂无数据"}</label></div> |
|
|
|
|
<div style="width:240px; overflow: hidden;">单位性质: <label style="margin-left: 10px;font-size: 12px;">${e.buildingTypes.length? e.buildingTypes[0].name : "暂无数据"}</label></div> |
|
|
|
|
<div style="flex: 1; margin-left: 25px;">消防负责人: <label style="margin-left: 10px;font-size: 12px;">${e.contacts || "暂无数据"}</label></div> |
|
|
|
|
</div> |
|
|
|
|
<div style="display: flex; margin-top: 10px;margin-left:8px""> |
|
|
|
@ -793,7 +793,6 @@ export class GisLabelingComponent implements OnInit {
|
|
|
|
|
this.leftDivState = false |
|
|
|
|
this.showLeftDiv = false |
|
|
|
|
this.isShowRouteGIS = true |
|
|
|
|
// console.log(1,e)
|
|
|
|
|
this.routeEnd = e.name |
|
|
|
|
this.endCoordinate = new AMap.LngLat(e.location.x, e.location.y) |
|
|
|
|
} |
|
|
|
@ -868,20 +867,18 @@ export class GisLabelingComponent implements OnInit {
|
|
|
|
|
var autoComplete = new AMap.Autocomplete(autoOptions); |
|
|
|
|
autoComplete.search(keywords, function(status, result) { |
|
|
|
|
if (result && result.tips && result.tips.length) { //搜索到数据时
|
|
|
|
|
|
|
|
|
|
that._ngZone.run(()=>{
|
|
|
|
|
if(e == 0){ |
|
|
|
|
that.routeStartList = result.tips |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
that.startCoordinate = new AMap.LngLat(result.tips[0].location.lng, result.tips[0].location.lat) |
|
|
|
|
// console.log(666,result)
|
|
|
|
|
}else{ |
|
|
|
|
that.routeEndList = result.tips
|
|
|
|
|
that.endCoordinate = new AMap.LngLat(result.tips[0].location.lng, result.tips[0].location.lat) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} //if
|
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}); //获取当前 city
|
|
|
|
@ -912,7 +909,6 @@ export class GisLabelingComponent implements OnInit {
|
|
|
|
|
this.endCoordinate = null |
|
|
|
|
this.routeGIS? this.routeGIS.clear() : null |
|
|
|
|
this.routes = { distance: 0, time: 0, steps: [], } |
|
|
|
|
// console.log(this.selectedUnit)
|
|
|
|
|
this.map.setZoomAndCenter(13,[this.selectedUnit.location.x,this.selectedUnit.location.y]); //设置地图中心点
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -941,10 +937,7 @@ export class GisLabelingComponent implements OnInit {
|
|
|
|
|
this.routeGIS? this.routeGIS.clear() : null |
|
|
|
|
this.routeGIS = new AMap.Driving({ |
|
|
|
|
map: this.map, |
|
|
|
|
});
|
|
|
|
|
// console.log(1,this.startCoordinate)
|
|
|
|
|
// console.log(2,this.endCoordinate)
|
|
|
|
|
// 根据起终点名称规划驾车导航路线
|
|
|
|
|
}); |
|
|
|
|
this.routeGIS.search(this.startCoordinate,this.endCoordinate, |
|
|
|
|
function(status, result) { |
|
|
|
|
if (status === 'complete') { |
|
|
|
|