南昌市物联网技防平台-前端
jxdnsong
2021-02-27 1a161393ef707272bcd534c7cfffd7ea0e60b866
实时报警定位功能完善
4 files modified
52 ■■■■■ changed files
public/map/index.html 38 ●●●●● patch | view | raw | blame | history
public/map/widgets/clientManagement/ClientManagement.js 9 ●●●● patch | view | raw | blame | history
public/map/widgets/map/MapWidget.js 3 ●●●● patch | view | raw | blame | history
src/views/realTimePolice/real.vue 2 ●●● patch | view | raw | blame | history
public/map/index.html
@@ -34,13 +34,12 @@
  <script>
    var _framework = null;
    var _AppEvent = null;
    var locationObj = null
    function init(openId) {
      if (openId && _AppEvent != null) {
        showFun(openId);
        return;
      }
    function getQueryStringByKey(key) {
      return (document.location.search.match(new RegExp("(?:^\\?|&)" + key + "=(.*?)(?=&|$)")) || ['', null])[1];
    }
    function init(openId,locationObj) {
      $.divselect("#divselect", "#inputselect");
      require(["base/framework", "base/AppEvent"],
        function (framework, AppEvent) {
@@ -48,7 +47,14 @@
          _framework.onSiderContainerShow();
          _framework.resize();
          _AppEvent = AppEvent;
          _AppEvent.addAppEventListener("mapLoad", mapLoad);
          _AppEvent.addAppEventListener("mapLoad", function(map){
            if (locationObj && locationObj != null) {
              map.centerAndZoom(new esri.geometry.Point(locationObj.x,locationObj.y, new esri.SpatialReference({ wkid: 4326 })), 14);
            }
          });
          var openId = getQueryStringByKey('openid');
          if (openId) showFun(openId);
        }
      );
@@ -58,16 +64,11 @@
      _AppEvent.dispatchAppEvent(_AppEvent.RUN_WIDGET, id);
    }
    function mapLoad(map) {
      // if(locationObj) {
      //   map.centerAndZoom(new esri.geometry.Point(locationObj.x,locationObj.y, new esri.SpatialReference({ wkid: 4326 })), 14);
      // }
    }
  </script>
</head>
<body onload="init()">
<body>
  <div class="map_content">
@@ -99,16 +100,5 @@
</body>
<script src="./js/monitor.js"></script>
<script src="./js/forestry-map.js"></script>
<script>
  var openId = getQueryStringByKey('openid');
  if (openId && openId != '') {
    init(openId)
  }
  function getQueryStringByKey(key) {
    return (document.location.search.match(new RegExp("(?:^\\?|&)" + key + "=(.*?)(?=&|$)")) || ['', null])[1];
  }
</script>
</html>
public/map/widgets/clientManagement/ClientManagement.js
@@ -3,8 +3,8 @@
 * @Version: 1.0
 * @Author: yangsx
 * @Date: 2019-12-09 19:01:40
 * @LastEditors: yangsx
 * @LastEditTime: 2019-12-14 14:44:57
 * @LastEditors: song
 * @LastEditTime: 2021-02-25 13:59:29
 */
define([
  "dojo",
@@ -248,11 +248,6 @@
      //var data = DataManager.getData();
      that.clusterLayer.addData(datas);
      if(window.locationObj) {
        that._map.centerAndZoom(new esri.geometry.Point(window.locationObj.x,window.locationObj.y, new esri.SpatialReference({ wkid: 4326 })), 14);
      }
    }
    , clearLayer: function () {
public/map/widgets/map/MapWidget.js
@@ -121,6 +121,7 @@
            AppEvent.addAppEventListener(AppEvent.ADD_TOP_MOST_LAYER, lang.hitch(this, this.onAddTopMostLayer));
        },
        onload: function () {
            AppEvent.dispatchAppEvent("mapLoad",this.map);
            //var listNode = this.map.attribution.listNode;
            var listNode = this.domNode;
            var scalebar = new Scalebar({
@@ -236,7 +237,7 @@
                    }
                }
            }))
            AppEvent.dispatchAppEvent("mapLoad", this.map);
            return this.map
        },
        appendToolHandler: function (data) {
src/views/realTimePolice/real.vue
@@ -804,7 +804,7 @@
        this.showMap = true;
        this.$nextTick(() => {
          this.$refs.mapDiv.onload = () => {
            window.frames[0].locationObj = {x: row.jd, y: row.wd};
            window.frames[0].init(null,{x: row.jd, y: row.wd});
          };
        })
      },