使用更多参数启动 Google 地图
我读过很多关于在 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
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
看来正确的答案是否定的,而且我目前没有解决方法......
Seem that the correct answer is no, and I have currently no workaround...