From d03f87c702dbe7456b5e7bedca0fdcae041f16f4 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Sat, 13 Mar 2021 18:10:26 +0800
Subject: [PATCH] mainMapWidget

---
 public/map/widgets/alertSecurity/AlertSecurity.js |   46 +++++++++++++++++++++++++++++++++-------------
 1 files changed, 33 insertions(+), 13 deletions(-)

diff --git a/public/map/widgets/alertSecurity/AlertSecurity.js b/public/map/widgets/alertSecurity/AlertSecurity.js
index 662b2c2..4123c68 100644
--- a/public/map/widgets/alertSecurity/AlertSecurity.js
+++ b/public/map/widgets/alertSecurity/AlertSecurity.js
@@ -184,19 +184,9 @@
     startup: function () {
 
       objThis._map.addLayer(objThis._siteLayer);
-      var that = this;
-
-      var openid = that.getQueryStringByKey('id');
 
 
-      $.ajax({
-          url: "http://web.byisf.com/api/blade-jfpts/jingdan/jingdan/detail?id=" + openid,
-          type: 'get',
-          dataType: 'JSON',
-          success: function (data) {
-            that.addPoint(that.addEntitys, data.data.jd, data.data.wd)
-          }
-      })
+
 
     },
 
@@ -205,7 +195,37 @@
     },
 
     open: function () {
+
       var that = this;
+
+      var openid = that.getQueryStringByKey('id');
+      var lgtd = that.getQueryStringByKey('jd');
+      var lttd = that.getQueryStringByKey('wd');
+
+      $.ajax({
+        url: "https://web.byisf.com/api/blade-jfpts/jingdan/jingdan/detail?id=" + openid,
+        type: 'get',
+        dataType: 'JSON',
+        success: function (data) {
+          that.addPoint(that.addEntitys, data.data.jd, data.data.wd, './images/jingbaored.png')
+        }
+      })
+
+      $.ajax({
+        url: "https://web.byisf.com/api/blade-jfpts/position/position/selectfj",
+        type: 'POST',
+        dataType: 'JSON',
+        data: {
+          jd: lgtd,
+          wd: lttd
+        },
+        success: function (data) {
+          console.log(data)
+          data.data.forEach(item => {
+            that.addPoint(that.addEntitys, item.jd, item.wd, './images/security.png')
+          })
+        }
+      })
 
     },
     close: function () {
@@ -262,8 +282,8 @@
       entityContent.push(item);
     },
 
-    addPoint: function (entitys, lgtd, lttd) {
-      var symbol = new esri.symbol.PictureMarkerSymbol('./images/jingbaored.png', 20, 20);
+    addPoint: function (entitys, lgtd, lttd, img) {
+      var symbol = new esri.symbol.PictureMarkerSymbol(img, 20, 20);
       var pt = new Point(lgtd, lttd, new SpatialReference({
         wkid: 4326
       }));

--
Gitblit v1.9.3