| 
														
															@@ -12,7 +12,20 @@ import {unByKey} from 'ol/Observable'; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import ImageLayer from 'ol/layer/Image'; 
														 | 
														
														 | 
														
															 import ImageLayer from 'ol/layer/Image'; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import ImageStatic from 'ol/source/ImageStatic'; 
														 | 
														
														 | 
														
															 import ImageStatic from 'ol/source/ImageStatic'; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import XYZLayer from "../../utils/ol-map/XYZLayer"; 
														 | 
														
														 | 
														
															 import XYZLayer from "../../utils/ol-map/XYZLayer"; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import GeoJsonLayer from "../../utils/ol-map/GeoJsonLayer"; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import eventBus from "@/api/eventBus"; 
														 | 
														
														 | 
														
															 import eventBus from "@/api/eventBus"; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import {VectorStyle} from "../../utils/ol-map/KMap"; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import StaticImgLayer from "../../utils/ol-map/StaticImgLayer"; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+function getColorByVal(val, legendData) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    for (let i = 0; i < legendData.level.length; i++) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        let [min, max] = legendData.level[i]; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if (val >= min && val <= max) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            return legendData.colors[i]; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    return undefined; // 如果 val 不在任何区间内,返回 undefined 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 /** 
														 | 
														
														 | 
														
															 /** 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  * @description 全景化地图层对象 
														 | 
														
														 | 
														
															  * @description 全景化地图层对象 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -20,7 +33,9 @@ import eventBus from "@/api/eventBus"; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 class StaticMapLayers { 
														 | 
														
														 | 
														
															 class StaticMapLayers { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     constructor(map){ 
														 | 
														
														 | 
														
															     constructor(map){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         this.initStaticMapLayers(map) 
														 | 
														
														 | 
														
															         this.initStaticMapLayers(map) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        this.vectorStyle = new VectorStyle() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         this.layerData = {} 
														 | 
														
														 | 
														
															         this.layerData = {} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        this.cacheStyle = {} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     initStaticMapLayers(map){ 
														 | 
														
														 | 
														
															     initStaticMapLayers(map){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         let that = this 
														 | 
														
														 | 
														
															         let that = this 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -32,6 +47,10 @@ class StaticMapLayers { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 let item = data[key] 
														 | 
														
														 | 
														
															                 let item = data[key] 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 if(item.type === "xyz"){ 
														 | 
														
														 | 
														
															                 if(item.type === "xyz"){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     that.layerData[key] = {legend:item.legend, layer:that.addXyzLayer(map, item)} 
														 | 
														
														 | 
														
															                     that.layerData[key] = {legend:item.legend, layer:that.addXyzLayer(map, item)} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                }else if(item.type === "geojson"){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    that.layerData[key] = {legend:item.legend, legendData:item.legendData, layer:that.addGeoJsonLayer(map, item, key)} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                }else if(item.type === "img"){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    that.layerData[key] = {legend:item.legend, layer:that.addStaticImgLayer(map, item)} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 } 
														 | 
														
														 | 
														
															                 } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             // that.autoTest() 
														 | 
														
														 | 
														
															             // that.autoTest() 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -50,12 +69,40 @@ class StaticMapLayers { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    addStaticImgLayer(map, item){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        let imgLayer = new StaticImgLayer(item.url, item, 3, map); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        imgLayer.hide() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        return imgLayer 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     addXyzLayer(map, item){ 
														 | 
														
														 | 
														
															     addXyzLayer(map, item){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         let xyz = new XYZLayer(item.url, item, 3, map); 
														 | 
														
														 | 
														
															         let xyz = new XYZLayer(item.url, item, 3, map); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         xyz.hide() 
														 | 
														
														 | 
														
															         xyz.hide() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         return xyz 
														 | 
														
														 | 
														
															         return xyz 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    addGeoJsonLayer(map, item, key){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        let that = this 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        item["style"] = function(feature){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            let val = feature.get(item.legendData.paramKey) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            let cacheKey = `${key}_${item.legendData.paramKey}_${val}` 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            let style = that.cacheStyle[cacheKey] 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            if(!style){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                let color = getColorByVal(val, item.legendData) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                let fillColor = color 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                let strokeColor = color 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                style = that.vectorStyle.getPolygonStyle(fillColor, strokeColor, 1) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                that.cacheStyle[cacheKey] = style 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            return style 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        let geoJsonLayer = new GeoJsonLayer(item.url, item, 3, map); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        geoJsonLayer.hide() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        return geoJsonLayer 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     autoTest(){ 
														 | 
														
														 | 
														
															     autoTest(){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         let that = this 
														 | 
														
														 | 
														
															         let that = this 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         let keys = [] 
														 | 
														
														 | 
														
															         let keys = [] 
														 |