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