| 
					
				 | 
			
			
				@@ -22,22 +22,15 @@ class RegionLayer { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     this.farmId = farm.id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     this.vectorStyle  = new KMap.VectorStyle(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    this.regionLayer = new KMap.VectorLayer("regionLayer",999,{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    this.regionLayer = new KMap.VectorLayer("regionLayer",99,{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       minZoom:15, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      source:new VectorSource(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      style:(f)=> this.getStyle(f)}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      style:this.vectorStyle.getPolygonStyle("#fba50410", "#eee5e5", 2) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     map.addLayer(this.regionLayer.layer) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     this.initData(this.farmId) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  getIconStyle(feature){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    let style = new Style({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      image: new Icon({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        src: feature.get('icon'), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        scale:1, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    return style 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   //得到点样式 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   getStyle(feature){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     return this.getIconStyle(feature) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -45,22 +38,21 @@ class RegionLayer { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   initData(farmId){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     let that = this 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    VE_API.sample.list({farmId}).then(({data})=>{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    VE_API.region.list({farmId}).then(({data})=>{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       let features = [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       for(let item of data){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        that.getIcon(item) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        let f = newRegionFeature(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        let f = newRegionFeature(item,"wkt"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         features.push(f) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       const source = new VectorSource({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         features: features, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      that.regionLayer.setSource(source) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      that.regionLayer.layer.setSource(source) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   reset(farm, region){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    this.clearCluster() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    this.clearLayer() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     this.initData(farm.id, region.id) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 |