简体   繁体   中英

bing maps routes in iphone

how can i use bing maps to draw a route line between two points. i can do that by calling url like: http://www.bing.com/maps/default.aspx?v=2&lvl=10&dir=0&sty=r&rtp=pos.16.955542_54.73933~pos.17.002046_54.049973

but those urls are not accessible from iphone uiwebview. bing is showing its main page instead.

i tried the bing ios sdk but could not find the way to do this.

If you're still going down the webview route - I'd suggest trying it again, as support for redirecting desktop URLs to mobile equivalents might have been added since.

As long as the right user agent is associated with the request to identify the device as an iPhone, the URL above should get rewritten to something like:

http://m.bing.com/maps/default.aspx?v=2&lvl=10&dir=0&sty=r&rtp=pos.16.955542_54.73933~pos.17.002046_54.049973&mid=10006

and load the mobile directions experience.

Alternatively, go to m.bing.com and follow the directions link and retrieve the mobile-specific URL pattern you're interested in, which doesn't rely on redirecting desktop URLs... example:

http://m.bing.com/directions#/Maps?w=a.seattle~a.san%20francisco&ul=47.60336588,-122.02145731&mode=1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM