您可以在Github上的源代码中轻松找到路标的方法:
从第151行开始:
/**
* Specifies a list of waypoints. Waypoints alter a route by routing it through the specified
* location(s). A waypoint is specified as either a latitude/longitude coordinate or as an address
* which will be geocoded. Waypoints are only supported for driving, walking and bicycling
* directions.
*
*
For more information on waypoints, see
* Using Waypoints in Routes.
*/
public DirectionsApiRequest waypoints(String... waypoints) {
if (waypoints == null || waypoints.length == 0) {
return this;
} else if (waypoints.length == 1) {
return param("waypoints", waypoints[0]);
} else {
return param("waypoints", (optimizeWaypoints ? "optimize:true|" : "") + join('|', waypoints));
}
}