Android, google maps, polyline, shortest path

自闭症网瘾萝莉.ら 提交于 2019-12-08 09:37:10

问题


I have already read some topics on Stack Overflow but didn't found the exact solution for my problem. I will try to explain my problem. For example let say that I have a grid 9x9. The coordinates are represented by the junctions. Is there a method or did someone already implemented a procedure that draw a line from coordinate A (X, Y) to coordinate B (V, W) where the line represents the shortest path..

In my problem I am using Google Maps and I would like to draw a poly-line between coordinates..

This is similar to my problem, but in my case I would like to use coordinates and not "weights"

Java - Find shortest path between 2 points in a distance weighted map

:)


回答1:


If you are using google map then you can use Google Directions API.I hope these links will help you.

http://javapapers.com/android/draw-path-on-google-maps-android-api

https://developers.google.com/maps/documentation/directions/



来源:https://stackoverflow.com/questions/25663527/android-google-maps-polyline-shortest-path

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!