Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Just want to verify this. I have checked Google Maps API, couldn't seem to find this one.

Bascially if I use Google Maps to calculate a route from point A to point B. I wonder if there is an API that Google provides to calculate what's the location/coordinate if you travel x meters following the route from point A?

Or I have to break down the routes returned by Google and calculate them one by one. I assume it would be something like:

var travelledDistance   
var routeDistanceTotal  
for route x in routes  
var routeDistanceTotal = routeDistanceTotal + (route x end - route x start)   
if( routeDistanceTotal >= travelledDistance) {  
    final location = point end - routeDistanceTotal - travelled distance 
}    
else{  
    continue to next route  
}

Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
236 views
Welcome To Ask or Share your Answers For Others

1 Answer

Found it!

GetPointAtDistance from http://www.geocodezip.com/scripts/v3_epoly.js.

From latLng from polyLine Percentage and thanks to @geocodezip


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...