|
|
|
@ -149,11 +149,6 @@ export class GisLabelingComponent implements OnInit {
|
|
|
|
|
this.http.get("/api/Companies",{params:paramsdata}).subscribe((data:any) => { |
|
|
|
|
this.createUnitMarker(data.items) |
|
|
|
|
}) |
|
|
|
|
}else if(!this.mapPattern){ |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('请切换2D模式使用此功能','确定',config); |
|
|
|
|
}else{ |
|
|
|
|
this.circle.setRadius(Number(this.unitAreaDefault)) |
|
|
|
|
this.circle.setCenter(this.markers[0]._position) |
|
|
|
@ -355,7 +350,6 @@ export class GisLabelingComponent implements OnInit {
|
|
|
|
|
WaterSourceTypes : this.selectedWaterList |
|
|
|
|
} |
|
|
|
|
this.http.get("/api/WaterSources",{params:paramsdata}).subscribe((data:any) => { |
|
|
|
|
console.log('所有水源',data) |
|
|
|
|
this.createwaterMarker(data.items) |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
@ -364,11 +358,6 @@ export class GisLabelingComponent implements OnInit {
|
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('请勾选想要显示的水源类型','确定',config); |
|
|
|
|
}
|
|
|
|
|
}else if(!this.mapPattern){ |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('请切换2D模式使用此功能','确定',config); |
|
|
|
|
}else{ |
|
|
|
|
this.circleofwater.setRadius(Number(this.waterAreaDefault)) |
|
|
|
|
this.circleofwater.setCenter(this.markers[0]._position) |
|
|
|
@ -391,7 +380,6 @@ export class GisLabelingComponent implements OnInit {
|
|
|
|
|
WaterSourceTypes : this.selectedWaterList |
|
|
|
|
} |
|
|
|
|
this.http.get("/api/WaterSources",{params:paramsdata}).subscribe((data:any) => { |
|
|
|
|
console.log('所有水源',data) |
|
|
|
|
this.createwaterMarker(data.items) |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
@ -411,7 +399,6 @@ export class GisLabelingComponent implements OnInit {
|
|
|
|
|
WaterSourceTypes :this.selectedWaterList |
|
|
|
|
} |
|
|
|
|
this.http.get("/api/WaterSources",{params:paramsdata}).subscribe((data:any) => { |
|
|
|
|
console.log('所有水源',data) |
|
|
|
|
this.createwaterMarker(data.items) |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
@ -426,9 +413,7 @@ export class GisLabelingComponent implements OnInit {
|
|
|
|
|
//取消显示水源
|
|
|
|
|
resetWater(){ |
|
|
|
|
this.watertForm.reset() |
|
|
|
|
|
|
|
|
|
this.watertForm.controls.areaWater.setValue('-1') |
|
|
|
|
|
|
|
|
|
this.map.remove(this.circleofwater) |
|
|
|
|
this.waterCluster.setData([]) |
|
|
|
|
} |
|
|
|
@ -574,6 +559,8 @@ export class GisLabelingComponent implements OnInit {
|
|
|
|
|
//地图2D 3D切换
|
|
|
|
|
mapPattern:boolean = true//默认是2D
|
|
|
|
|
mapPatternChange(type){ |
|
|
|
|
this.unitCluster = null |
|
|
|
|
this.waterCluster = null |
|
|
|
|
if(type == '2D'){ |
|
|
|
|
this.mapPattern = true |
|
|
|
|
var layer = new AMap.createDefaultLayer({ |
|
|
|
@ -586,7 +573,9 @@ export class GisLabelingComponent implements OnInit {
|
|
|
|
|
this.map = new AMap.Map('map',{ |
|
|
|
|
layers:[layer], //当只想显示标准图层时layers属性可缺省,
|
|
|
|
|
}); |
|
|
|
|
this.map.setCity('上海市'); |
|
|
|
|
}else{ |
|
|
|
|
this.unitCluster ? this.unitCluster.setData([]) : null |
|
|
|
|
this.mapPattern = false |
|
|
|
|
this.map = new AMap.Map('map',{ |
|
|
|
|
viewMode: '3D', |
|
|
|
@ -595,6 +584,7 @@ export class GisLabelingComponent implements OnInit {
|
|
|
|
|
features: ['bg', 'road', 'point','building'], |
|
|
|
|
mapStyle: 'amap://styles/light', |
|
|
|
|
}); |
|
|
|
|
this.map.setCity('上海市'); |
|
|
|
|
} |
|
|
|
|
this.satelliteModel = false |
|
|
|
|
this.loadModel = false |
|
|
|
@ -738,6 +728,8 @@ export class GisLabelingComponent implements OnInit {
|
|
|
|
|
clear () { |
|
|
|
|
this.allCompany = [] |
|
|
|
|
this.searchText = '' |
|
|
|
|
this.markers ? this.markers.forEach((element,index) => { this.map.remove(element);}) : null |
|
|
|
|
this.infoWindow ? this.map.remove(this.infoWindow) : null |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
selectedUnit:any//当前打开的单位
|
|
|
|
|