Quellcode durchsuchen

fix deafaultCity format bug

git vor 5 Jahren
Ursprung
Commit
3fd7bcc87b
3 geänderte Dateien mit 8 neuen und 0 gelöschten Zeilen
  1. 4 0
      pages/amap/amap.js
  2. 2 0
      pages/amap/fence/fence.js
  3. 2 0
      pages/amap/route/route.js

+ 4 - 0
pages/amap/amap.js

@@ -197,9 +197,13 @@
             //车辆信息初始化
             //地图初始化
             var defaultCity = renlian.storage.get('userinfo').baseinfo.defaultCity;
+            console.log(defaultCity);
             if(!defaultCity){
                 defaultCity = [109.84040,40.658168];
+            }else{
+                defaultCity = [defaultCity.lng, defaultCity.lat];
             }
+            
             if(!mainMap){
                 mainMap = new AMap.Map('amapcontainer', {
                     center: defaultCity,

+ 2 - 0
pages/amap/fence/fence.js

@@ -7,6 +7,8 @@
             var defaultCity = renlian.storage.get('userinfo').baseinfo.defaultCity;
             if(!defaultCity){
                 defaultCity = [109.84040,40.658168];
+            }else{
+                defaultCity = [defaultCity.lng, defaultCity.lat];
             }
 
 

+ 2 - 0
pages/amap/route/route.js

@@ -8,6 +8,8 @@
            var defaultCity = renlian.storage.get('userinfo').baseinfo.defaultCity;
             if(!defaultCity){
                 defaultCity = [109.84040,40.658168];
+            }else{
+                defaultCity = [defaultCity.lng, defaultCity.lat];
             }
             $('#route-gpsNumber').text(userinfo.baseinfo.gpsNumber);
             $('#date-time').text('时间:'+param.textData.lastTime || '0000-00-00 00:00:00');