From 6db8054f58fce2fee353ceaad78cc4ce6da4fb50 Mon Sep 17 00:00:00 2001 From: hbao Date: Wed, 16 Mar 2022 16:01:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=A7=E9=9D=A2=E5=8A=9F=E8=83=BD=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/homesteadSurvey/list.vue | 35 +++++++----------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/src/views/homesteadSurvey/list.vue b/src/views/homesteadSurvey/list.vue index 049ce9a0..4538d39d 100644 --- a/src/views/homesteadSurvey/list.vue +++ b/src/views/homesteadSurvey/list.vue @@ -4066,31 +4066,12 @@ //样式加载定义 var vector_drawing_delete; $("#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); function createLabelStyle() { return new ol.style.Style({ @@ -4121,8 +4102,6 @@ map.addLayer(vector_drawing_delete); newcenterFeature.setStyle(createLabelStyle()); //设置要素样式 sourceMapLook.addFeature(newcenterFeature); - that.clickBbox =""; - that.textMjAll = ""; //map.addLayer(styleFsss); } else if(that.textMjAllNum == "1"){ that.$toast("该图层面积暂无信息"); @@ -4524,6 +4503,8 @@ var zb = evt.coordinate; var url; var url_bbox; + that.clickBbox =""; + that.textMjAll = ""; if(that.drawingClick) { //点击空白删除之前图层 map.removeLayer(hc_land_on);