wesmiler 6 anos atrás
pai
commit
8cd5ba38a1
1 arquivos alterados com 3 adições e 1 exclusões
  1. 3 1
      public/static/weixin/js/shop-map.js

+ 3 - 1
public/static/weixin/js/shop-map.js

@@ -98,6 +98,7 @@ var app = new Vue({
                                     sessionStorage.setItem('point_lng', res.longitude)
                                     sessionStorage.setItem('point_lat', res.latitude)
 
+                                    // var point = new BMap.Point('108.8795', '22.6548');
                                     var point = new BMap.Point(res.longitude, res.latitude);
                                     var gc = new BMap.Geocoder();
                                     gc.getLocation(point, function (rs) {
@@ -109,13 +110,14 @@ var app = new Vue({
                                     });
 
                                    // alert(JSON.stringify(res));
-                                    point = {lng: res.longitude, lat: res.latitude};
+
                                     var mk = new BMap.Marker(point);
                                     _this.map.addOverlay(mk);
                                     _this.map.centerAndZoom(point, _this.mapParams.level);
                                     _this.map.enableScrollWheelZoom();   //启用滚轮放大缩小,默认禁用
                                     _this.map.enableContinuousZoom();    //启用地图惯性拖拽,默认禁用
 
+                                    point = {lng: res.longitude, lat: res.latitude};
                                     _this.loadMark(point);
                                     //alert('当前定位:'+JSON.stringify(r.point));
                                    // _this.loadMark(point);