|

楼主 |
发表于 2016-12-13 12:06:49
|
显示全部楼层
本帖最后由 yfx521521 于 2016-12-13 12:07 编辑
var gpsDtd = $.Deferred();
if (this.wxApi) {
this.wxApi.exec().done(function(wx) {
wx.getLocation({
type : "gcj02",
success : function(data) {
gpsDtd.resolve({
coorType : data.coorType,
address : data.address,
longitude : data.longitude,
latitude : data.latitude
});
},
cancel : function(res) {
gpsDtd.resolve({
longitude : 116.45764191999997,
latitude : 39.8622934399999
});
}
});
}).fail(function() {
gpsDtd.resolve({
longitude : 116.45764191999997,
latitude : 39.8622934399999
});
});
}
这是通过微信api实现的?那我只要地址,用什么方法取出来,直接data.address这样取? |
|