manifest一定要这么设置 H5才能获取经纬度:(,key需要到官网申请,用https的方式访问才行。
调取代码
// #ifdef H5
uni.getLocation({
type: 'gcj02',
success: (res) => {
this.latitude=res.latitude;
this.longitude=res.longitude;
console.log(this.latitude);
console.log(this.longitude);
console.log(res);
// console.log('当前位置的经度:' + res.longitude);
// console.log('当前位置的纬度:' + res.latitude);
}
});
原文地址:https://www.cnblogs.com/appdesign/p/13428282.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。