开发者

Modify the road calculation algorithm in Google Maps API

开发者 https://www.devze.com 2023-01-18 18:04 出处:网络
I would like to know if it is possible to change the way the itinerary calculation algorithm works in the Google Maps API (or Bing Maps). Basically, I\'d like to add options, like for example \"shorte

I would like to know if it is possible to change the way the itinerary calculation algorithm works in the Google Maps API (or Bing Maps). Basically, I'd like to add options, like for example "shortest route" or "avoid highways and national roads".

I haven't found anything in the API that might manage the road's cost, so I think it's n开发者_JS百科ot possible but maybe someone's got an idea of a way to do that?


There is no way to modify the pathfinder algorithm beyond the avoidHighways and avoidTolls options. See here for documentation: http://code.google.com/apis/maps/documentation/javascript/reference.html#DirectionsRequest

Another method would be to specify provideRouteAlternatives and figure out which of these routes is best according to your own heuristic.

0

精彩评论

暂无评论...
验证码 换一张
取 消