从Android WebView中启动地图 [英] Launch maps from within Android WebView

查看:100
本文介绍了从Android WebView中启动地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Android应用程序,可以在WebView中显示内容,其中包含应打开地图的链接。我有我想链接的位置的经纬度和街道地址,但我不确定链接的正确格式。

方案

没有收到任何社区关于这个问题的答案或评论大约一周的时间......最后,我刚刚去了:

  http://maps.google.com/?ll= {lat},{lon} q = {address} 

这款手机足够智能,可以检测到这是指向地图的链接,并打开地图活动以显示它。

我也尝试使用地理位置:{lat},{lon}?{address} 链接格式,确实在正确的位置打开了地图,但缩放距离太近,没有提及实际地址。



理想情况下,我仍在寻找这个答案允许我捕获从WebView打开的链接,并打开一个新的MapView,我可以放置自己的针脚和气球,并将用户保存在我自己的应用程序中。


I have an Android app that displays content in a WebView which includes a link which should open up a map. I have the latitude, longitude and the street address of the location I want to link to, but I'm not sure of the correct format for the link.

解决方案

Haven't received any answers or comments from the community on this one for about a week... In the end I've just gone with:

http://maps.google.com/?ll={lat},{lon}q={address}

The phone was smart enough to detect this was a link to a map and open up the Maps activity to display it.

I also tried using the geo:{lat},{lon}?{address} link format, which did open up the map at the correct location, but the zoom was way too close and there was no mention of the actual address.

Ideally, I'm still looking for an answer that allows me to catch the link being opened from the WebView and open up a new MapView where I can drop my own pins and balloons and keep the user within my own application.

这篇关于从Android WebView中启动地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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