|
@@ -27,15 +27,18 @@ class AlarmLayer {
|
|
|
this.warningLayers = {}
|
|
|
this.plantLayer = null
|
|
|
this.warningLayer = null
|
|
|
+ this.nameStr = ''
|
|
|
// 底图数据
|
|
|
eventBus.on("alarmList:warningLayers", (data) => {
|
|
|
this.warningLayers = data
|
|
|
})
|
|
|
|
|
|
// 预警底图
|
|
|
- eventBus.on("alarmList:changeMapLayer", function ({url, type}) {
|
|
|
+ eventBus.on("alarmList:changeMapLayer", function ({url, type,name}) {
|
|
|
that.plantLayer && that.kmap.map.removeLayer(that.plantLayer.layer)
|
|
|
- that.initWarningLayer(url, type)
|
|
|
+ that.nameStr = name
|
|
|
+ console.log('sdadas',url);
|
|
|
+ that.initWarningLayer(url, type,name)
|
|
|
})
|
|
|
// 种植面积,预估产量,底图切换
|
|
|
eventBus.on("warningHome:toggleMapLayer", function (name) {
|
|
@@ -52,16 +55,30 @@ class AlarmLayer {
|
|
|
})
|
|
|
// 时间轴
|
|
|
eventBus.on("weatherTime:changeTime", ({index}) => {
|
|
|
- console.log('vvv',index);
|
|
|
that.toggleSmallLayer(index)
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- initWarningLayer(layerUrl, type) {
|
|
|
+ initWarningLayer(layerUrl, type,name) {
|
|
|
this.warningLayer && this.kmap.map.removeLayer(this.warningLayer.layer)
|
|
|
// 104.3017367175,30.329292136
|
|
|
+ let path = null
|
|
|
+ let text = ''
|
|
|
+ if(name==='日间温度'){
|
|
|
+ text = '从化地块日温'
|
|
|
+ path = this.warningLayers[text]
|
|
|
+ }else if(name==='夜间温度'){
|
|
|
+ text = '从化地块夜温'
|
|
|
+ path = this.warningLayers[text]
|
|
|
+ }else if(name==='土壤水分'){
|
|
|
+ text = '从化地块水分'
|
|
|
+ path = this.warningLayers[text]
|
|
|
+ }else{
|
|
|
+ path = layerUrl
|
|
|
+ }
|
|
|
+ console.log('path',path);
|
|
|
this.warningLayer = this.kmap.addXYZLayer(
|
|
|
- layerUrl,
|
|
|
+ path,
|
|
|
{ minZoom: 5, maxZoom: 22 },
|
|
|
99,
|
|
|
0.4
|
|
@@ -138,7 +155,16 @@ class AlarmLayer {
|
|
|
// 虚拟果园会播放物候变化
|
|
|
}
|
|
|
if (this.areaId === "3186") {
|
|
|
- let url = "https://birdseye-img.sysuimars.com/map/risk/lby_rjwd/{z}/{x}/{y}.png"
|
|
|
+ let text = '荔博园地块日温'
|
|
|
+ if(this.nameStr === '夜间温度'){
|
|
|
+ text = '荔博园地块夜温'
|
|
|
+ }
|
|
|
+ let path = this.warningLayers[text + index]
|
|
|
+ if(this.nameStr === '土壤水分'){
|
|
|
+ text = '荔博园地块水分0'
|
|
|
+ path = this.warningLayers[text]
|
|
|
+ }
|
|
|
+ let url = path
|
|
|
// if (index === 0) {
|
|
|
// url = "https://birdseye-img.sysuimars.com/map/risk/lby_ghqs/{z}/{x}/{y}.png"
|
|
|
// } else if (index === 1) {
|