Difference between Google Map Distance and Directions API

后端 未结 2 616
心在旅途
心在旅途 2021-01-12 03:50

Google provides APIs for 1. Distance Matrix and 2. Direction service

I tried to search about difference between 1 and 2

My task is \"When user

相关标签:
2条回答
  • 2021-01-12 03:56

    I got answer to my question.

    Google Maps V2 provides 2 sets of APIs for developers

    1. Distance Matrix APIs : this is useful for computing distance(walking/travelling via bycycle,bus), cost of travel, time of travel

    But this is not useful for this scenario.

    2. Direction Service : this is useful for this scenario.

    Through direction service, we can get the path of User on Google Map in Real Time

    If we get the path through Distance Matrix, then Google Map returns the shortest established path between S Source and D Destination, this is not desirable in this scenario. User may not use shortest path due to some trafic, personal reasons and Diatance Matrix API output fails here.

    So, I should use Direction Service API which give me real time Output for User location on Google Map

    Thank you for your replies

    0 讨论(0)
  • 2021-01-12 04:01

    According to Google Maps API picker

    You use Directions service for getting directions from origin to destination location using various forms of transport: walking, driving, cycling, public transit. Get a route from point A to point B.

    For Distance Matrix it calculate the travel distance and travel time for multiple origins and destinations, optionally specifying various forms of transport: walking, driving, cycling.

    For your case, I will suggest Directions service since you don't need travel time.

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