Google Maps API 版本差异 [英] Google Maps API Version difference
问题描述
我正在尝试显示两个地方之间的路线,我想使用
我们如何解决上述问题?
请参考这三个答案链接,以解决您的问题:
- Android - 绘制两个之间的路线图地理点
- https://stackoverflow.com/a/10268114/1472665
- https://stackoverflow.com/a/11357351/1494309
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
- Decoding polylines from google maps direction api with java
- Encoding polylines for Google Maps
- The encoding algorithm for the levels string
How we can resolve problem in above question?
Please refer these three answer links, that solves your problem :
- Android - Draw route map between two geopoints
- https://stackoverflow.com/a/10268114/1472665
- https://stackoverflow.com/a/11357351/1494309
这篇关于Google Maps API 版本差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!