uni.getLocation({
type: 'wgs84',
geocode: true,
success: function (res) {
console.log( res);
}
});
- 发布:2022-03-01 17:50
- 更新:2023-02-15 15:19
- 阅读:358
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: Windows11
HBuilderX类型: 正式
HBuilderX版本号: 3.3.11
手机系统: Android
手机系统版本号: Android 11
手机厂商: IQOO
手机机型: IQOO Neo5
页面类型: vue
vue版本: vue2
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
操作步骤:
在首页直接调用定位api
在首页直接调用定位api
预期结果:
{
"type": "wgs84",
"altitude": 0,
"address": {
"country":"",
"province": "",
"city": ""
},
"speed": 0,
"accuracy": 40,
"errMsg": "getLocation:ok"
}
{
"type": "wgs84",
"altitude": 0,
"address": {
"country":"",
"province": "",
"city": ""
},
"speed": 0,
"accuracy": 40,
"errMsg": "getLocation:ok"
}
实际结果:
{
"type": "wgs84",
"altitude": 0,
"**," * ,
"speed": 0,
"accuracy": 40,
"errMsg": "getLocation:ok"
}
{
"type": "wgs84",
"altitude": 0,
"**," * ,
"speed": 0,
"accuracy": 40,
"errMsg": "getLocation:ok"
}
2***@qq.com (作者)
重新建了项目依然是这样,然后用了同事的电脑新建了项目也是这样乱码。
2022-03-03 10:41