使用更多参数启动 Google 地图

发布于 2024-09-15 12:32:09 字数 702 浏览 1 评论 0原文

我读过很多关于在 Android 中启动 Google 地图的内容。

这很简单:

 Uri uri = Uri.parse("geo:38.899533,-77.036476");
Intent it = new Intent(Intent.ACTION_VIEW, uri);
startActivity(it);

问题是地图以高缩放级别显示,并且地图上没有标记。 因此,如果用户移动了一点或者发生了一些事情,那么该点就会丢失。

是否可以添加这样的标记:

http://img.skitch.com/20100820- da3n4r7h5xbsu6bsx4p4ujjghc.jpg

或像这样:

http://img.skitch.com/20100820 -qg7k2m5wtwm3j5phhrgc8tb53.jpg

所以我可以确定,即使用户移动地图,他也能够再次找到这个地方。

非常感谢您的帮助。

I have read a lot of stuff about launching Google Maps in Android.

That's pretty easy:

 Uri uri = Uri.parse("geo:38.899533,-77.036476");
Intent it = new Intent(Intent.ACTION_VIEW, uri);
startActivity(it);

The problem is that the map is shown at a high zoom level and there is no marker on the map.
So, if the user move a little bit or something happen, the point is lost.

Is that possible to add a marker like this:

http://img.skitch.com/20100820-da3n4r7h5xbsu6bsx4p4ujjghc.jpg

or like this:

http://img.skitch.com/20100820-qg7k2m5wtwm3j5phphrgc8tb53.jpg

So i can be sure that even if the user move the map, he will be able to find this place again.

Thank a lot for any help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

◇流星雨 2024-09-22 12:32:09

geo: 方案可以采用缩放级别:

geo:latitude,longitude?z=zoom

但据我所知,您无法在意图中指定标记。

如果您使用这种模式的 geo: 方案,它可能会给您您想要的:

geo:0,0?q=my+street+address
geo:0,0?q=商业+附近+城市

The geo: scheme can take a zoom level:

geo:latitude,longitude?z=zoom

but as far as I know, you can't specify a marker in the intent.

If you use this mode of the geo: scheme, it might give you what you want:

geo:0,0?q=my+street+address
geo:0,0?q=business+near+city

终陌 2024-09-22 12:32:09

看来正确的答案是否定的,而且我目前没有解决方法......

Seem that the correct answer is no, and I have currently no workaround...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文