| @@ -4066,31 +4066,12 @@ | |||||
| //样式加载定义 | //样式加载定义 | ||||
| var vector_drawing_delete; | var vector_drawing_delete; | ||||
| $("#area").click(function () { | $("#area").click(function () { | ||||
| if(that.textMjAll != "" && that.clickBbox !=""){ | |||||
| // var styleFsss = new ol.style.Style({ | |||||
| // text: new ol.style.Text({ | |||||
| // text: that.textMjAll+"㎡", | |||||
| // font: '30px sans-serif', | |||||
| // textAlign: "center", | |||||
| // textBaseline: "middle", | |||||
| // //font: 'verdana', | |||||
| // fill: new ol.style.Fill({ | |||||
| // color: "#ff00ff" | |||||
| // }), | |||||
| // // backgroundFill: new ol.style.Fill({ | |||||
| // // color: "#ff0000" | |||||
| // // }), | |||||
| // font: "30px sans-serif", | |||||
| // stroke: new ol.style.Stroke({ | |||||
| // color: "#ffffff" | |||||
| // // width: 3 | |||||
| // }), | |||||
| // offsetX: parseInt(0, 10), | |||||
| // offsetY: parseInt(0, 10), | |||||
| // placement: "point", //point 则自动计算面的中心k点然后标注 line 则根据面要素的边进行标注 | |||||
| // overflow: false //超出面的部分不显示 | |||||
| // }), | |||||
| // }); | |||||
| console.log(that.textMjAll); | |||||
| console.log(that.clickBbox); | |||||
| if(that.textMjAll ==null){ | |||||
| that.textMjAll =0; | |||||
| } | |||||
| if((that.textMjAll != "" && that.clickBbox !="") || (that.textMjAll == 0 && that.clickBbox !="")){ | |||||
| map.removeLayer(vector_drawing_delete); | map.removeLayer(vector_drawing_delete); | ||||
| function createLabelStyle() { | function createLabelStyle() { | ||||
| return new ol.style.Style({ | return new ol.style.Style({ | ||||
| @@ -4121,8 +4102,6 @@ | |||||
| map.addLayer(vector_drawing_delete); | map.addLayer(vector_drawing_delete); | ||||
| newcenterFeature.setStyle(createLabelStyle()); //设置要素样式 | newcenterFeature.setStyle(createLabelStyle()); //设置要素样式 | ||||
| sourceMapLook.addFeature(newcenterFeature); | sourceMapLook.addFeature(newcenterFeature); | ||||
| that.clickBbox =""; | |||||
| that.textMjAll = ""; | |||||
| //map.addLayer(styleFsss); | //map.addLayer(styleFsss); | ||||
| } else if(that.textMjAllNum == "1"){ | } else if(that.textMjAllNum == "1"){ | ||||
| that.$toast("该图层面积暂无信息"); | that.$toast("该图层面积暂无信息"); | ||||
| @@ -4524,6 +4503,8 @@ | |||||
| var zb = evt.coordinate; | var zb = evt.coordinate; | ||||
| var url; | var url; | ||||
| var url_bbox; | var url_bbox; | ||||
| that.clickBbox =""; | |||||
| that.textMjAll = ""; | |||||
| if(that.drawingClick) { | if(that.drawingClick) { | ||||
| //点击空白删除之前图层 | //点击空白删除之前图层 | ||||
| map.removeLayer(hc_land_on); | map.removeLayer(hc_land_on); | ||||