南昌市物联网技防平台-前端
shuishen
2021-02-04 a7a86324ae4e519b8ee0a3fa3038f3afa2e14dec
public/map/index.html
@@ -1,11 +1,3 @@
<!--
 * @Description: 地图
 * @Version: 1.0
 * @Author: yangsx
 * @Date: 2019-11-28 09:50:16
 * @LastEditors: song
 * @LastEditTime: 2021-02-01 17:14:21
 -->
<!DOCTYPE html>
<html lang="zh">
@@ -42,6 +34,7 @@
  <script>
    var _framework = null;
    var _AppEvent = null;
    var locationObj = null
    function init(openId) {
      if (openId && _AppEvent != null) {
@@ -55,6 +48,7 @@
          _framework.onSiderContainerShow();
          _framework.resize();
          _AppEvent = AppEvent;
          _AppEvent.addAppEventListener("mapLoad", mapLoad);
          if (openId) showFun(openId);
        }
      );
@@ -64,9 +58,12 @@
      _AppEvent.dispatchAppEvent(_AppEvent.RUN_WIDGET, id);
    }
    function dw(x,y) {
      _AppEvent.dispatchAppEvent("goto", {x:x,y:y});
    function mapLoad(map) {
      if(locationObj) {
        map.centerAndZoom(new esri.geometry.Point(locationObj.x,locationObj.y, new esri.SpatialReference({ wkid: 4326 })), 14);
      }
    }
  </script>
</head>