Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
466 views
in Technique[技术] by (71.8m points)

browser - Android - launch google map via web url

On the iPhone, a maps.google.com URL is intercepted and loaded by the native google maps application. I would like do the same on Android, but Google Maps is being loaded in the browser.

So, in a web page, is it possible to have this url http://maps.google.com/maps?saddr=brighton&daddr=timbuktu open in the Android Google Map application ?

I see from this question that you can do it from another app via an Intent. Can you trigger these Intent's from the browser ?

Edit - On further testing, I've found that the user will be prompted to open the link in browser or map app for standard html links to maps.google.maps :

<a href="http://maps.google.com/maps?saddr=brighton&daddr=timbuktu">show route</a>

I'm having the problem because I'm using javascript to set the window.location.href via a Location API callback (so I can get the user's location and then open the map). I've opened a bug report for this.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Typing geo:0,0?q=google into the address bar opens the maps activity and searches for google nearby.

I assume this will work from a link in a page, but haven't checked.

a full list of accessible intents here: http://developer.android.com/guide/appendix/g-app-intents.html


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...