我正在开发一个 Google Maps API 来估计送货路线,如果这会使行程更短,默认路线会来回跨越国界。
有没有办法限制国内旅行?
例如,从温哥华到多伦多而不踏足美国?
我检查了文档,没有发现任何相关的东西。
谢谢
我正在开发一个 Google Maps API 来估计送货路线,如果这会使行程更短,默认路线会来回跨越国界。
有没有办法限制国内旅行?
例如,从温哥华到多伦多而不踏足美国?
我检查了文档,没有发现任何相关的东西。
谢谢
From my experience is no way to limit directions to a particular country in the current API, but you could attempt to achieve it by setting waypoints. This will likely not result in an optimal route since you won't necessarily know the ideal location for the waypoint, and it would require iteratively getting driving directions until the entire route is within one country. You can see an example here: