Search code examples
androidgoogle-mapsgoogle-roads-api

Interpolate google maps android roads


I'm doing an Android application that get from server LatLng points of a route and write a polyline snapped to road. To get roads points I'm using the Google API Roads., but in the response I only get the same points that I send in the request.

The request: https://roads.googleapis.com/v1/snapToRoads?interpolate=true&key=AIzaSyCcorJdwrFQp5HpR0she_r3PEVOj1TrUTI&path=43.342592253801136%2C-1.7633818398462608%7C43.333786678427664%2C-1.8170163652393967%7C43.31891938155728%2C-1.9850535434670746

What I'm doing wrong?

Thanks.


Solution

  • it took me 10min to figure out the issue actually your api is working well but the data you are sending is wrong means to say there is no path available between those points.

    check this out https://roads.googleapis.com/v1/snapToRoads?interpolate=true&key=AIzaSyCcorJdwrFQp5HpR0she_r3PEVOj1TrUTI&path=43.323579%2C1.960141%7C43.317866%2C1.967716%7C43.318974%2C1.976428