How to make a route from current location to the nearest markers saved in the Firebase?

时间:2019-01-07 13:10:05

标签: android firebase-realtime-database google-maps-markers

I'm building an application that automatically draws a route from my device' exact location to the latitude and longitude saved from my firebase realtime database. It's something like a marker(my current location) to the nearest saved markers in my database. Thanks in Advance masters!

1 个答案:

答案 0 :(得分:0)

您需要使用Google Directions API。

这基本上是您将要使用的调用(显然是使用您自己的参数和坐标):

http://maps.googleapis.com/maps/api/directions/outputFormat?parameters

这将返回您的航点和路线,您可以在地图视图上使用它们来绘制路线。

您可以在此处找到更多详细信息: https://developers.google.com/maps/documentation/directions/intro