gpt4 book ai didi

android - 在 MapView 中放置图钉

转载 作者:太空狗 更新时间:2023-10-29 16:10:24 25 4
gpt4 key购买 nike

我读过这个: Drop Pin on Default Google Maps from My App in Android?并做同样的事情。但是在我打电话之后, map 上没有掉针:startActivity(new Intent(Intent.ACTION_VIEW, uri));

map 以该 uri 位置为中心,但没有任何图钉落在 map 上。

那么,有一个问题:如何在 map 上放置图钉?

最佳答案

您还需要添加要搜索的内容(q 参数)。如果您只有经/纬度,请按以下方式指定两次:

Uri uri = Uri.parse("geo:36.4248,-5.14495?z=14&q=36.4248,-5.14495"); 
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);

请注意,z 参数是可选的。

您还可以通过在 q 的 lon 之后将其添加到括号中来标记引脚,即

Uri uri = Uri.parse("geo:36.4248,-5.14495?z=14&q=36.4248,-5.14495(My+pin+label)"); 
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);

关于android - 在 MapView 中放置图钉,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2696753/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com