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