2 Комити dc73c064ea ... 056d389eff

Аутор SHA1 Порука Датум
  周壕 056d389eff Merge remote-tracking branch 'origin/master' пре 10 месеци
  周壕 6cdac19640 地图定位sql пре 10 месеци
1 измењених фајлова са 15 додато и 6 уклоњено
  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]);