Enum Mode
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
모드
경로를 찾을 때 사용할 이동 수단을 나타내는 열거형입니다.
enum을 호출하려면 상위 클래스, 이름, 속성을 호출합니다. 예를 들면
Maps.Mode.DRIVING
입니다.
속성
속성 | 유형 | 설명 |
DRIVING | Enum | 도로를 경유하는 운전경로 |
WALKING | Enum | 보행경로와 인도를 경유하는 도보 경로 (지원되는 경우) |
BICYCLING | Enum | 자전거 전용 도로 및 선호하는 거리를 경유하는 자전거 경로 (제공되는 경우) |
TRANSIT | Enum | 대중교통 경로를 경유하는 대중교통 경로 (지원되는 경우) 이 모드를 사용하려면
출발 또는 도착 시간을 나타냅니다
// Log all available data for a public-transit trip.
const directions = Maps.newDirectionFinder()
.setOrigin('The Cloisters, New York, NY')
.setDestination('JFK airport, New York, NY')
.setMode(Maps.DirectionFinder.Mode.TRANSIT)
.setDepart(new Date())
.getDirections();
const route = directions.routes[0];
Logger.log(route);
|
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[[["\u003cp\u003e\u003ccode\u003eMaps.Mode\u003c/code\u003e is an enum used to specify the mode of transportation for directions.\u003c/p\u003e\n"],["\u003cp\u003eThe available modes are \u003ccode\u003eDRIVING\u003c/code\u003e, \u003ccode\u003eWALKING\u003c/code\u003e, \u003ccode\u003eBICYCLING\u003c/code\u003e, and \u003ccode\u003eTRANSIT\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eTRANSIT\u003c/code\u003e mode requires specifying either departure or arrival time.\u003c/p\u003e\n"],["\u003cp\u003eEach mode utilizes specific routes like roads, pedestrian paths, bicycle paths, or public transit routes as appropriate.\u003c/p\u003e\n"]]],["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"],null,["# Enum Mode\n\nMode\n\nAn enum representing the mode of travel to use when finding directions.\n\nTo call an enum, you call its parent class, name, and property. For example, `\nMaps.Mode.DRIVING`. \n\n### Properties\n\n| Property | Type | Description |\n|-------------|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `DRIVING` | `Enum` | Driving directions via roads. |\n| `WALKING` | `Enum` | Walking directions via pedestrian paths and sidewalks (where available). |\n| `BICYCLING` | `Enum` | Bicycling directions via bicycle paths and preferred streets (where available). |\n| `TRANSIT` | `Enum` | Transit directions via public transit routes (where available). This mode requires that you set either the departure or arrival time. ```javascript // Log all available data for a public-transit trip. const directions = Maps.newDirectionFinder() .setOrigin('The Cloisters, New York, NY') .setDestination('JFK airport, New York, NY') .setMode(Maps.DirectionFinder.Mode.TRANSIT) .setDepart(new Date()) .getDirections(); const route = directions.routes[0]; Logger.log(route); ``` |"]]