【问题标题】:How to change location name in Maps intent如何更改地图意图中的位置名称
【发布时间】:2020-04-23 00:44:42
【问题描述】:

有没有办法在 Google 地图意图中指定位置的名称,而不是显示“未命名的位置”?

val gmmIntentUri = Uri.parse("geo:0,0?q=55.5, -4.3")
val mapIntent = Intent(Intent.ACTION_VIEW, gmmIntentUri)
mapIntent.setPackage("com.google.android.apps.maps")
mCtx.startActivity(mapIntent)

【问题讨论】:

    标签: android google-maps kotlin google-maps-android-api-2 android-maps-v2


    【解决方案1】:

    如果该位置在 Google 地图上没有名称,则没有。你需要addedit 这个地方。

    您还可以使用label 参数来搜索位置。查看来自 documentation 的 Google 示例:

    // Display a label at the location of Google's Sydney office
    Uri gmmIntentUri = Uri.parse("geo:0,0?q=-33.8666,151.1957(Google+Sydney)");
    Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
    mapIntent.setPackage("com.google.android.apps.maps");
    startActivity(mapIntent);
    

    希望这会有所帮助!

    【讨论】:

      猜你喜欢
      • 2012-05-30
      • 1970-01-01
      • 2012-09-18
      • 2018-07-29
      • 2015-09-11
      • 1970-01-01
      • 2018-10-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多