uni.chooseLocation({
latitude: 30.673844,
longitude: 114.275003,
success: function(res) {
console.log('===' + JSON.stringify(res))
if (res) {
that.address = res.address + res.name
that.site = {
latitude: res.latitude,
longitude: res.longitude
}
console.log(that.site);
}
},
fail(err) {
uni.showToast({
title:err,
icon:'none'
})
}
});

- 发布:2025-09-09 09:39
- 更新:2025-09-09 11:59
- 阅读:92
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: window11
HBuilderX类型: 正式
HBuilderX版本号: 4.66
手机系统: Android
手机系统版本号: Android 15
手机厂商: 小米
手机机型: 小米14
页面类型: vue
vue版本: vue3
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
操作步骤:
uni.chooseLocation({
latitude: 30.673844,
longitude: 114.275003,
success: function(res) {
console.log('===' + JSON.stringify(res))
if (res) {
that.address = res.address + res.name
that.site = {
latitude: res.latitude,
longitude: res.longitude
}
console.log(that.site);
}
},
fail(err) {
uni.showToast({
title:err,
icon:'none'
})
}
});
uni.chooseLocation({
latitude: 30.673844,
longitude: 114.275003,
success: function(res) {
console.log('===' + JSON.stringify(res))
if (res) {
that.address = res.address + res.name
that.site = {
latitude: res.latitude,
longitude: res.longitude
}
console.log(that.site);
}
},
fail(err) {
uni.showToast({
title:err,
icon:'none'
})
}
});
预期结果:
像附件2正常出现标记点和归位图标
像附件2正常出现标记点和归位图标
实际结果:
没有标记点和归位图标
没有标记点和归位图标

DCloud_UNI_OttoJi - 日常回复 uni-app/x 问题,如果艾特我没看到,请主动私信
使用小米 13 运行最新 HBuilderX alpha 运行你提供的代码正常,有定位标志和功能正常。你可以新建一个工程,或者使用 HBuilderX 内置的 hellouniapp 工程来运行,排除你的设置问题
bonnenlt柠檬 (作者)
请问你是使用的腾讯地图吗,我新建了一个工程也没有,但是用高德地图的话就有
2025-09-09 13:37
DCloud_UNI_OttoJi
回复 bonnenlt柠檬: 腾讯地图的确是问题,下个 alpha 会带上。 https://github.com/dcloudio/uni-app/commit/f9b42da871109e146f0eda2774acbc80f0abbe04
2025-09-09 17:11