好你的問題很棘手,但還是讓我從我得到的回答。 使用谷歌地圖API,谷歌Places API的,地方臺或者ID和谷歌地圖的路線和距離JSON API。
let's take an example like you want walk or run 4kms from your places and comeback.
Case 1: if you want to opt for the same route from which you went to come back.
like you went from a-b then again you are coming bak from b-a.
for this case you can use Google maps geofencing and get the place inside a minimum raidus and make an algo to get the distance from your places.
if teh distance is half of the distance from your places then pick the most approximate place.
Use google maps json to get the places distance and google place picker for the location of nearby location object.
Case2: If you donot want to come from the same route through which you went
by, then select the nearest location object and get the longest route and follow
the same algo and procedure to get the distance.
已經有算法生成多段線,這些多段線基本上是從一點到另一點的路線。您可以使用該算法繪製路線。 Google API也可以幫助您計算距離。 – HaroldSer