1

I have used native google maps in my application just for navigation purpose. But i need to get those navigation data (lattitude and longitude) of my route or else is there any other way to get so?

Rahul Verma
  • 514
  • 2
  • 8
  • 16

1 Answers1

0

More than anything else, I would suggest that you please go through Google Maps/Google Earth APIs Terms of Service. There are restrictions given for the Maps API Implementations such as this:

No navigation. You will not use the Service or Content for or in connection with (a) real-time navigation or route guidance; or (b) automatic or autonomous vehicle control.

Please also note on this:

No use of Content without a Google map. Unless the Maps APIs Documentation expressly permits you to do so, you will not use the Content in a Maps API Implementation without a corresponding Google map. For example, you may display Street View imagery without a corresponding Google map because the Maps APIs Documentation expressly permits this use.

For your question, "is there any other way to get so?"

Supported with documentation, you may want to try using Geolocation: Displaying User or Device Position on Maps. As shown in the documentation's sample code, this determines the user's location through the W3C navigator.geolocation property. It may only provide a rough estimate of a user's location but this approach is also considered as the easiest and most fully-supported so it should be prioritized over other geolocation methods.

W3C Geolocation standard mentioned about turn-by-turn route navigation in one of its use cases.

Turn-by-turn route navigation

A mapping application can help the user navigate along a route by providing detailed turn-by-turn directions. The application does this by registering with the Geolocation API to receive repeated location updates of the user's position. These updates are delivered as soon as the implementing user agent determines that the position of the user has changed, which allows the application to anticipate any changes of direction that the user might need to do.

Please try going further through the given documentations for more detailed information.

Lastly, you may want to try the solutions given in this related SO post and hope it helps too.

Community
  • 1
  • 1
Teyam
  • 7,686
  • 3
  • 15
  • 22