0

I was trying to add a feature like google map directions kinda navigation from my location to point b, or from point a to point b. The same as on google map

enter image description here

currently i couldn't find anything, i was wondering why google doesn't added this feature.

I found some code but it seems to be weird, a lot of remake, getting bold blue line from url web version, hand made.

And only decision which i have is just not use any directions, which ends app, you get the address from the app, and then copy that address and switch to google maps app to look from there, which sounds a little stupid.

But i still hope that maybe there is any solution, how are you guys dealing with this problem.

How to add directions without writing or understanding own created api, loosing weeks on it.

Does many apps using directions, how they deal with it. There is i think a plenty of apps which can show directions from inside the app, not switching to google maps.

I was wondering how to use google maps direction feature, the same as you add place-markers, easy and cool.

Tologon
  • 83
  • 1
  • 5

1 Answers1

1

Google Maps Platform has Directions API in which you can use to render directions between locations in your map. This API will return the routes given your specific points A and B.

You can use either the encoded polyline (under the overview_polyline field) or the start and end locations of each route leg from the Directions API results. Then you can plot the route into your map using the GoogleMap.addPolyline() method. More information here: Drawing on a Map - Polyline

An example on how to draw polylines using Maps SDK for Android can be found here: PolylineDemoActivity

Hope this helps.

smga08
  • 614
  • 5
  • 12