Explorar el Código

Merge remote-tracking branch 'origin/master'

xiaoqiao hace 10 meses
padre
commit
39655868f9
Se han modificado 1 ficheros con 15 adiciones y 6 borrados
  1. 15 6
      src/main/resources/static/a4gis/index.html

+ 15 - 6
src/main/resources/static/a4gis/index.html

@@ -763,6 +763,13 @@
         app.graLayer.clear();
         pgs = {};
         pointObjects = {};
+        //筛选x,y坐标不能为空
+        console.log("setSymbols", "points length:"+points.length);
+        points = points.filter((it)=>{
+          return it.x != null && it.x != undefined && it.y != null && it.y != undefined;
+        });
+        if(points.length==0) return;
+        console.log("setSymbols", "points filter length:"+points.length);
 
         require(["esri/geometry/Point", "esri/graphic", "esri/Color", "esri/symbols/SimpleMarkerSymbol", "esri/InfoTemplate"],
                 function (Point, Graphic, Color, SimpleMarkerSymbol, InfoTemplate) {
@@ -772,8 +779,7 @@
                   //显示所有标注
                   for (let i = 0; i < points.length; i++) {
                     let obj = points[i];
-                    if (obj.x == null || obj.x == undefined) continue;
-                    if (obj.y == null || obj.y == undefined) continue;
+
                     obj.x = obj.x * 1;
                     obj.y = obj.y * 1;
 
@@ -814,10 +820,13 @@
     }
 
     function zoomToCenter(obj, isCenter){
-      if(obj.x==null || obj.x==undefined) return;
-      if(obj.y==null || obj.y==undefined) return;
-      obj.x = obj.x *1;
-      obj.y = obj.y *1;
+      if(obj.x==null || obj.x==undefined || obj.y==null || obj.y==undefined){
+        console.log("zoomToCenter", " x("+obj.x+") or y("+obj.y+") is null");
+        return;
+      }
+
+      obj.x = obj.x * 1;
+      obj.y = obj.y * 1;
 
       if(pointObjects[obj.well_id]) {
         console.log("zoomToCenter",pointObjects[obj.well_id]);