Enum Mode
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Mod
Yol tarifi bulurken kullanılacak ulaşım şeklini temsil eden bir sıralama.
Sıralama çağırmak için üst sınıfı, adını ve özelliğini çağırırsınız. Örneğin,
Maps.Mode.DRIVING
.
Özellikler
Özellik | Tür | Açıklama |
DRIVING | Enum | Yollar üzerinden arabayla yol tarifi. |
WALKING | Enum | Yaya yolları ve kaldırımlar üzerinden (varsa) yaya yol tarifi. |
BICYCLING | Enum | Bisiklet yolları ve tercih edilen sokaklar (varsa) üzerinden bisikletle yol tarifi. |
TRANSIT | Enum | Toplu taşıma rotaları üzerinden toplu taşıma yol tarifi (kullanılabilir olduğunda). Bu mod,
ya kalkış ya da varış saati.
// 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);
|
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-26 UTC.
[null,null,["Son güncelleme tarihi: 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); ``` |"]]