Google Maps API Version difference

后端 未结 9 1532
野趣味
野趣味 2020-11-28 23:22

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, a

相关标签:
9条回答
  • 2020-11-29 00:07

    The solution above posted by https://stackoverflow.com/users/975959/la-bla-bla works very well with Google Maps API V2 but it needs some minor modifications:
    Replace all the occurrences of GeoPoint with LatLng.
    Replace the line:

    GeoPoint p = new GeoPoint((int) (((double) lat / 1E5) * 1E6), (int) (((double) lng / 1E5) * 1E6));
    

    Which is located just before the end of the method decodePoly, with this line:

    LatLng p = new LatLng(lat / 1E5, lng / 1E5);
    

    Hope this works for Google Maps API v2 users.

    0 讨论(0)
  • 2020-11-29 00:13

    You are not using all the points returned in the result. You haven't provided your code, but here is an example with the v3 API that shows the same path as that returned by your "google maps" example.

    0 讨论(0)
  • 2020-11-29 00:15

    Please check this link..

    And Specify Travel Modes

    -- driving
    -- walking 
    -- bicycling 
    -- transit 
    

    so you get different results.

    please try it.

    0 讨论(0)
提交回复
热议问题