wesmiler 6 lat temu
rodzic
commit
9039bafcdf
1 zmienionych plików z 5 dodań i 1 usunięć
  1. 5 1
      public/static/weixin/js/index.js

+ 5 - 1
public/static/weixin/js/index.js

@@ -115,11 +115,15 @@ var app = new Vue({
                         type: 'BD09', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
                         // type: 'wgs84', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
                         success: function (res) {
+
                             var geocoder = new qq.maps.Geocoder({
                                 complete: function (result) {
                                     $(".index-navs").append(JSON.stringify(result))
                                 }
-                            })
+                            });
+
+                            var coord=new qq.maps.LatLng(res.latitude, res.longitude);
+                            geocoder.getAddress(coord)
 
                             $(".index-navs").append(JSON.stringify(res))
                             $.toast(JSON.stringify(res),'text');