如何显示标记在地图由GEO URI意向推出? [英] How to show marker in Maps launched by geo uri Intent?

查看:130
本文介绍了如何显示标记在地图由GEO URI意向推出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过推出谷歌地图有其特定的地理COORDS,我想表现的不同位置(一个在时间,通过用户输入采摘)一个应用程序。

I have a application where I want to show different locations (one at the time, picked by user input) by launching Google Maps with their specific geo-coords.

我目前使用的:(与真正的纬度和长期价值,当然。)

I'm currently using this: (with real lat. and long. values of course)

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:<lat>,<long>?z=17"));
startActivity(intent);

这是相当正是我想要的,但它不显示的指定点的任何指示或标记。它仅在中心的位置,。

It's quite exactly what I want, except that it doesn't show any indicator or marker for the specified point. It only centers at it's location.

有一些方法来获取标记或其他东西包括不使用MapView的?

Is there some way to get the marker or something else included without using a MapView?

推荐答案

试试这个:

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:<lat>,<long>?q=<lat>,<long>(Label+Name)"));
startActivity(intent);

您可以省略(标签+姓名),如果你不想要一个标签,它会根据最近的街道或其他东西选一个随机认为相关。

You can omit (Label+Name) if you don't want a label, and it will choose one randomly based on the nearest street or other thing it thinks relevant.

这篇关于如何显示标记在地图由GEO URI意向推出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆