From 1e7d96a0b08d74328ed7ae56fbd6a2d365eaadb5 Mon Sep 17 00:00:00 2001
From: jxdnsong <592566207@qq.com>
Date: Wed, 03 Feb 2021 16:39:32 +0800
Subject: [PATCH] 地图定位

---
 public/map/index.html |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/public/map/index.html b/public/map/index.html
index 8edea66..d81d150 100644
--- a/public/map/index.html
+++ b/public/map/index.html
@@ -4,7 +4,7 @@
  * @Author: yangsx
  * @Date: 2019-11-28 09:50:16
  * @LastEditors: song
- * @LastEditTime: 2021-02-01 17:14:21
+ * @LastEditTime: 2021-02-03 16:35:18
  -->
 <!DOCTYPE html>
 <html lang="zh">
@@ -42,6 +42,7 @@
   <script>
     var _framework = null;
     var _AppEvent = null;
+    var locationObj = null
 
     function init(openId) {
       if (openId && _AppEvent != null) {
@@ -55,6 +56,7 @@
           _framework.onSiderContainerShow();
           _framework.resize();
           _AppEvent = AppEvent;
+          _AppEvent.addAppEventListener("mapLoad", mapLoad);
           if (openId) showFun(openId);
         }
       );
@@ -64,9 +66,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>
 

--
Gitblit v1.9.3