谷歌地图API版本的差异 [英] Google Maps API Version difference

查看:539
本文介绍了谷歌地图API版本的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想展现两地之间的路径,我想用谷歌的地方API V3 路由两点之间的步骤。


在我使用老谷歌地图API ,并按照要求提供了完美的结果:

<$p$p><$c$c>http://maps.google.com/maps?f=d&hl=en&saddr=19.5217608,-99.2615823&daddr=19.531224,-99.248262&ie=UTF8&0&om=0&output=kml

输出:


现在我尝试用新的谷歌地图API替换此,并按照要求提供了错误的结果,在这两种情况下,我使用相同的源和目的,但结果给了谷歌地图上不同的行为:

<$p$p><$c$c>http://maps.googleapis.com/maps/api/directions/json?origin=19.5217608,-99.2615823&destination=19.531224,-99.248262&sensor=false

我的问题是,新的谷歌地图API返回的源和目标,因此该路径没有显示在谷歌地图完美的步数少。

请帮忙解决这个问题的新的谷歌地图API V3。

在此先感谢。

解决方案

有什么新的谷歌地图API V3?
谷歌地图路线API第3版为Android提供了恩codeD折线算法格式的路线

我们必须要做的?
我们必须得去code这个折线显示精确的地图

我们如何去code此连接由谷歌路线API第3版提供了codeD折线?
请参考这三个环节有连接从谷歌地图路线API第3版codeD折线回报

要更清晰
  • <一个href="http://jeffreysambells.com/posts/2010/05/27/decoding-polylines-from-google-maps-direction-api-with-java/">Decoding从谷歌地图折线方向的API与Jav​​a
  • 为谷歌地图
  • 编码折线
  • 编码算法的水平串

如何我们可以在上面的问题解决问题?
请参考这三个答案的链接,可以解决你的问题:

I'm trying to show route between two places, I want to used Google Places API V3 for route steps between two points.


Before I was using Old Google Maps API, and following request gives perfect result:

http://maps.google.com/maps?f=d&hl=en&saddr=19.5217608,-99.2615823&daddr=19.531224,-99.248262&ie=UTF8&0&om=0&output=kml

Output :


Now I try to replace this with New Google Maps API, and following request gives wrong result, In both case i'm using same source and destination, but result gives different behavior on Google Map:

http://maps.googleapis.com/maps/api/directions/json?origin=19.5217608,-99.2615823&destination=19.531224,-99.248262&sensor=false

My problem is that, New Google Maps API return less number of steps between source and destination therefore the route not showing perfect on Google Map.

Please help to resolve this problem for New Google Maps API v3.

Thanks in advance.

解决方案

What's new in Google Map API v3?
Google Maps Directions API v3 for Android provide routes in the Encoded Polyline Algorithm Format.

What we must have to do?
We must have to decode this Polyline for showing exact Map

How we decode this encoded Polyline provided by Google Directions API v3?
Please Refer these three links to more clear with encoded Polyline returns from the Google Maps Directions API v3

How we can resolve problem in above question?
Please refer these three answer links, that solves your problem :

这篇关于谷歌地图API版本的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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