南昌市物联网技防平台-前端
jxdnsong
2021-02-27 1a161393ef707272bcd534c7cfffd7ea0e60b866
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>