//Logallavailabledataforapublic-transittrip.vardirections=Maps.newDirectionFinder().setOrigin('The Cloisters, New York, NY').setDestination('JFK airport, New York, NY').setMode(Maps.DirectionFinder.Mode.TRANSIT).setDepart(newDate()).getDirections();varroute=directions.routes[0];Logger.log(route);
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-08-21。"],[[["`Maps.Mode` is an enum used to specify the mode of transportation for directions."],["The available modes are `DRIVING`, `WALKING`, `BICYCLING`, and `TRANSIT`."],["`TRANSIT` mode requires specifying either departure or arrival time."],["Each mode utilizes specific routes like roads, pedestrian paths, bicycle paths, or public transit routes as appropriate."]]],["The `Mode` enum defines travel methods for finding directions. It includes `DRIVING`, `WALKING`, and `BICYCLING`, for road, pedestrian, and cycling routes respectively. `TRANSIT` offers public transit routes, requiring departure or arrival time specification. To use, reference as `Maps.Mode.PROPERTY`. An example is provided for setting a public transit route, by using `.setMode(Maps.DirectionFinder.Mode.TRANSIT)` and calling the `getDirections()` function.\n"]]