You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Google Maps 10.11.1版本中Geo Intent标签无法正常显示求助

Google Maps 10.11.1版本geo URI标签不显示的解决方案

刚碰到和你一模一样的问题!在把Google Maps更到10.11.1版本后,之前完全符合文档规范的geo URI标签显示逻辑突然失效了,包括官方示例代码也跑不通。这应该是新版本对URI解析规则做了调整,给你几个亲测有效的解决办法:

解决办法1:改用Google Maps专用的gmm://协议

把原来的geo:替换成gmm://maps.google.com/maps,格式调整后对标签的解析更稳定,示例代码如下:

Kotlin版本

val intent = Intent(Intent.ACTION_VIEW, Uri.parse("gmm://maps.google.com/maps?q=38.8951,100.0364(foo)")).setPackage("com.google.android.apps.maps")
if (intent.resolveActivity(packageManager) == null) {
    intent.setPackage(null)
}
startActivity(intent)

Java版本(对应官方示例)

Uri gmmIntentUri = Uri.parse("gmm://maps.google.com/maps?q=-33.8666,151.1957(Google+Sydney)");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
startActivity(mapIntent);

解决办法2:拆分标签为独立的&label=参数

放弃在坐标后直接用括号带标签的写法,改用&label=参数单独指定标签,这种写法在新版本中也能正常识别:

Kotlin版本(geo带具体坐标)

val intent = Intent(Intent.ACTION_VIEW, Uri.parse("geo:38.8951,100.0364?q=38.8951,100.0364&label=foo")).setPackage("com.google.android.apps.maps")
if (intent.resolveActivity(packageManager) == null) {
    intent.setPackage(null)
}
startActivity(intent)

Kotlin版本(geo:0,0的情况)

val intent = Intent(Intent.ACTION_VIEW, Uri.parse("geo:0,0?q=38.8951,100.0364&label=foo")).setPackage("com.google.android.apps.maps")
if (intent.resolveActivity(packageManager) == null) {
    intent.setPackage(null)
}
startActivity(intent)

解决办法3:使用Place ID定位(兼容性最好)

如果上述两种方法都不生效,可以尝试用目标位置的Place ID来定位,这种方式的兼容性最强,不过需要先通过Google Places API获取对应位置的Place ID:

// 替换PLACE_ID为目标位置的实际Place ID
val intent = Intent(Intent.ACTION_VIEW, Uri.parse("gmm://maps.google.com/maps?place_id=PLACE_ID&q=foo")).setPackage("com.google.android.apps.maps")
if (intent.resolveActivity(packageManager) == null) {
    intent.setPackage(null)
}
startActivity(intent)

补充说明

这个问题大概率是Google Maps 10.11.1版本的规则变更或者bug,你可以在Google Maps的内置反馈渠道提交问题,帮助官方修复或者更新文档。

内容的提问来源于stack exchange,提问作者user2297550

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.13 06:27:45