TransitPreferences
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ค่ากำหนดสำหรับเส้นทางที่ใช้ TRANSIT
ซึ่งมีผลกับเส้นทางที่แสดงผล
ช่อง |
allowedTravelModes[] |
enum (TransitTravelMode )
ชุดรูปแบบการเดินทางที่จะใช้เมื่อรับเส้นทางTRANSIT ค่าเริ่มต้นคือรูปแบบการเดินทางทั้งหมดที่รองรับ
|
routingPreference |
enum (TransitRoutingPreference )
การตั้งค่าการกำหนดเส้นทางที่เมื่อระบุแล้วจะส่งผลต่อเส้นทาง TRANSIT ที่แสดงผล
|
TransitTravelMode
ชุดค่าที่ใช้เพื่อระบุรูปแบบการเดินทาง
Enum |
TRANSIT_TRAVEL_MODE_UNSPECIFIED |
ไม่ได้ระบุวิธีการเดินทางด้วยขนส่งสาธารณะ |
BUS |
เดินทางโดยรถประจำทาง |
SUBWAY |
เดินทางโดยรถไฟใต้ดิน |
TRAIN |
เดินทางโดยรถไฟ |
LIGHT_RAIL |
เดินทางโดยรถไฟฟ้าหรือรถราง |
RAIL |
เดินทางโดยรถไฟ ซึ่งเทียบเท่ากับการรวมกันของ SUBWAY , TRAIN และ LIGHT_RAIL |
TransitRoutingPreference
ระบุค่ากำหนดการกำหนดเส้นทางสำหรับเส้นทางขนส่งสาธารณะ
Enum |
TRANSIT_ROUTING_PREFERENCE_UNSPECIFIED |
ไม่ได้ระบุค่ากำหนด |
LESS_WALKING |
ระบุว่าเส้นทางที่คำนวณควรมีการจำกัดระยะเวลาการเดิน |
FEWER_TRANSFERS |
ระบุว่าเส้นทางที่คำนวณควรที่จะโอนได้ในจำนวนจำกัด |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-31 UTC
[null,null,["อัปเดตล่าสุด 2025-08-31 UTC"],[[["\u003cp\u003e\u003ccode\u003eTransitPreferences\u003c/code\u003e influence the \u003ccode\u003eTRANSIT\u003c/code\u003e based routes that are returned.\u003c/p\u003e\n"],["\u003cp\u003eYou can specify transit travel modes such as \u003ccode\u003eBUS\u003c/code\u003e, \u003ccode\u003eSUBWAY\u003c/code\u003e, \u003ccode\u003eTRAIN\u003c/code\u003e, \u003ccode\u003eLIGHT_RAIL\u003c/code\u003e, and \u003ccode\u003eRAIL\u003c/code\u003e or use the default of all supported modes.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eTransitPreferences\u003c/code\u003e also allow you to indicate preferences for \u003ccode\u003eLESS_WALKING\u003c/code\u003e or \u003ccode\u003eFEWER_TRANSFERS\u003c/code\u003e when calculating a route.\u003c/p\u003e\n"]]],["The content outlines preferences for `TRANSIT` routes, using a JSON structure with `allowedTravelModes` and `routingPreference`. `allowedTravelModes` specifies transit modes like `BUS`, `SUBWAY`, `TRAIN`, `LIGHT_RAIL`, or `RAIL`. `routingPreference` allows choosing between `LESS_WALKING` or `FEWER_TRANSFERS`, to influence the transit route, and it allows for selecting no preferences. All available preferences have a corresponding unspecified value. The default `allowedTravelModes` is all available options.\n"],null,["# TransitPreferences\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n- [TransitTravelMode](#TransitTravelMode)\n- [TransitRoutingPreference](#TransitRoutingPreference)\n\nPreferences for `TRANSIT` based routes that influence the route that is returned.\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"allowedTravelModes\": [ enum (/maps/documentation/routes/reference/rest/v2/TransitPreferences#TransitTravelMode) ], \"routingPreference\": enum (/maps/documentation/routes/reference/rest/v2/TransitPreferences#TransitRoutingPreference) } ``` |\n\n| Fields ||\n|------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `allowedTravelModes[]` | `enum (`[TransitTravelMode](/maps/documentation/routes/reference/rest/v2/TransitPreferences#TransitTravelMode)`)` A set of travel modes to use when getting a `TRANSIT` route. Defaults to all supported modes of travel. |\n| `routingPreference` | `enum (`[TransitRoutingPreference](/maps/documentation/routes/reference/rest/v2/TransitPreferences#TransitRoutingPreference)`)` A routing preference that, when specified, influences the `TRANSIT` route returned. |\n\nTransitTravelMode\n-----------------\n\nA set of values used to specify the mode of transit.\n\n| Enums ||\n|-----------------------------------|---------------------------------------------------------------------------------------------|\n| `TRANSIT_TRAVEL_MODE_UNSPECIFIED` | No transit travel mode specified. |\n| `BUS` | Travel by bus. |\n| `SUBWAY` | Travel by subway. |\n| `TRAIN` | Travel by train. |\n| `LIGHT_RAIL` | Travel by light rail or tram. |\n| `RAIL` | Travel by rail. This is equivalent to a combination of `SUBWAY`, `TRAIN`, and `LIGHT_RAIL`. |\n\nTransitRoutingPreference\n------------------------\n\nSpecifies routing preferences for transit routes.\n\n| Enums ||\n|------------------------------------------|----------------------------------------------------------------------------------|\n| `TRANSIT_ROUTING_PREFERENCE_UNSPECIFIED` | No preference specified. |\n| `LESS_WALKING` | Indicates that the calculated route should prefer limited amounts of walking. |\n| `FEWER_TRANSFERS` | Indicates that the calculated route should prefer a limited number of transfers. |"]]