Browse Source

1.隐藏图层;2.判断坐标是否缺失

da-xian 1 week ago
parent
commit
2d132f608a

+ 13 - 2
src/main/resources/static/a4gis/index.html

@@ -1,4 +1,4 @@
-<!DOCTYPE html>
+<!DOCTYPE html>
 <html lang="zh-cn">
 <head>
   <meta charset="utf-8" />
@@ -306,7 +306,7 @@
         // 图层初始化完成事件
         on(map, "AGSLayerInited", function (agsLayer) {
           locateByDepName(depName);
-          hideLayers();
+          hideAllLayers();
           // 创建空间引用
           app.sr = new SpatialReference(4326);
 
@@ -581,6 +581,17 @@
       var layerNames = ["矿权"];
       setLayerVisible(layerNames, false);
     }
+    // 隐藏所有图层
+    function hideAllLayers() {
+      var all = ["井", "煤层气井",
+        "变电所", "联合站", "处理厂", "接转站", "脱水站", "增压站", "卸油站", "计量站(间)", "集油阀组间", "采油站",
+        "井网管道-油", "站间管道-油", "外输管线-油", "掺稀油管道",
+        "站库面", "配电线",
+        "厂边界", "矿边界",
+        "矿权"
+      ];
+      setLayerVisible(all, false);
+    }
     // 设置图层显示
     function setLayerVisible(layerNames, flag) {
       console.log('layerNames', layerNames);

+ 1 - 1
vue/src/components/basic/chart/chart-map.vue

@@ -16,7 +16,7 @@
             </div>
             <div class="chart-map-item-text">
               <div class="chart-map-item-wellname">井名:{{ item.well_common_name }}
-              <span title="x轴或y轴坐标缺失" style="color: red" v-if="item.x=='' || item.y==''">!</span>
+              <span title="x轴或y轴坐标缺失" style="color: red" v-if="(!item.x || !item.y)">!</span>
               </div>
               <div>地址:{{ item.geo_description }}</div>
             </div>