Routes Widget

คลาส Route3DElement

class google.maps.routes.Route3DElement extends HTMLElement implements Route3DElementOptions
library "routes"

คอมโพเนนต์เว็บสำหรับการแสดงผลเส้นทาง 3 มิติ ปัจจุบันรองรับพารามิเตอร์ต้นทางและปลายทางเพื่อแสดงผลเส้นประกอบในพื้นที่ 3 มิติในแผนที่ 3 มิติ

<gmp-route-3d
  autofits-camera
  departure-time="####-##-##T##:##Z"
  destination="lat,lng"
  internal-usage-attribution-ids="space separated strings"
  origin="lat,lng"
  routing-preference="value-name"
  traffic-polylines-disabled
  travel-mode="value-name">
</gmp-route-3d>
const {Route3DElement} = await google.maps.importLibrary("routes");
Route3DElement
Route3DElement([options])
พารามิเตอร์
สร้าง Route3DElement พร้อมตัวเลือกที่ระบุ
autofitsCamera
attr: autofits-camera
ประเภทอินพุต: boolean optional
ประเภทเอาต์พุต: boolean
ค่าเริ่มต้น: false
หากระบุไว้ เส้นทางที่ระบุจะแสดงในวิวพอร์ตแผนที่ พร้อมกับองค์ประกอบอื่นๆ ที่เลือกใช้
แอตทริบิวต์ HTML: autofits-camera
departureTime
attr: departure-time
ประเภทอินพุต: Date optional
ประเภทเอาต์พุต: Date optional
หากระบุ ระบบจะคำนวณเส้นทางตามเวลาออกเดินทางที่ระบุ เมื่อระบุผ่านแอตทริบิวต์ HTML ให้ใช้รูปแบบ ISO 8601 เพื่อให้ได้ผลลัพธ์ที่เชื่อถือได้ในเบราว์เซอร์ต่างๆ ดูข้อมูลเกี่ยวกับข้อกำหนดในการใช้งานได้ที่ ComputeRoutesRequest.departureTime
แอตทริบิวต์ HTML: departure-time="####-##-##T##:##Z"
destination
attr: destination
ประเภทอินพุต: string|LatLng|LatLngLiteral|LatLngAltitude|LatLngAltitudeLiteral|Place optional
ประเภทเอาต์พุต: string|LatLng|LatLngLiteral|LatLngAltitude|LatLngAltitudeLiteral|Place optional
จุดหมายของเส้นทาง
แอตทริบิวต์ HTML:
  • destination="lat,lng"
  • destination="places/###"
  • destination="address"
fallbackInfo
readonly
ประเภท: FallbackInfo optional
ข้อมูลสำรองสำหรับเส้นทางที่คำนวณ
geocodingResults
readonly
ประเภท: GeocodingResults optional
ผลลัพธ์การเข้ารหัสพิกัดภูมิศาสตร์สำหรับต้นทางและปลายทาง
internalUsageAttributionIds
attr: internal-usage-attribution-ids
ประเภทอินพุต: Iterable<string> optional
ประเภทเอาต์พุต: Array<string> optional
ตัวระบุที่ใช้เพื่อระบุแหล่งที่มาของการเรียกไปยังแพ็กเกจหรือไลบรารี OSS ที่เฉพาะเจาะจง
แอตทริบิวต์ HTML: internal-usage-attribution-ids="space separated strings"
origin
attr: origin
ประเภทอินพุต: string|LatLng|LatLngLiteral|LatLngAltitude|LatLngAltitudeLiteral|Place optional
ประเภทเอาต์พุต: string|LatLng|LatLngLiteral|LatLngAltitude|LatLngAltitudeLiteral|Place optional
ต้นทางของเส้นทาง
แอตทริบิวต์ HTML:
  • origin="lat,lng"
  • origin="places/###"
  • origin="address"
routes
readonly
ประเภท: Array<Route> optional
เส้นทางหลักพร้อมเส้นทางสำรอง (ไม่บังคับ) ซึ่งคำนวณจาก Routes API
routingPreference
attr: routing-preference
ประเภทอินพุต: RoutingPreference optional
ประเภทเอาต์พุต: RoutingPreference optional
หากระบุไว้ ระบบจะคำนวณเส้นทางพร้อมข้อมูลการจราจรตามเส้นทางที่อิงตาม RoutingPreference ที่ระบุ และใช้สีเฉพาะสำหรับการจราจร
แอตทริบิวต์ HTML: routing-preference="value-name"
trafficPolylinesDisabled
attr: traffic-polylines-disabled
ประเภทอินพุต: boolean optional
ประเภทเอาต์พุต: boolean
ค่าเริ่มต้น: false
ระบุว่าจะปิดใช้เส้นประกอบที่รับรู้การจราจรหรือไม่ เส้นประกอบที่คำนึงถึงการจราจรจะใช้ได้ก็ต่อเมื่อตั้งค่า routingPreference เป็น TRAFFIC_AWARE หรือ TRAFFIC_AWARE_OPTIMAL เท่านั้น
แอตทริบิวต์ HTML: traffic-polylines-disabled
travelMode
attr: travel-mode
ประเภทอินพุต: TravelMode optional
ประเภทเอาต์พุต: TravelMode optional
หากระบุไว้ เส้นประกอบจะอิงตามโหมดการเดินทางที่ระบุ
แอตทริบิวต์ HTML: travel-mode="value-name"
สืบทอด: addEventListener, removeEventListener
Alphagmp-error
function(routeInitializationErrorEvent)
อาร์กิวเมนต์
  • routeInitializationErrorEvent: Event optional
เหตุการณ์นี้จะเริ่มทำงานเมื่อโหลดเส้นทางไม่สำเร็จ
Alphagmp-load
function(routeInitializationSuccessEvent)
อาร์กิวเมนต์
  • routeInitializationSuccessEvent: Event optional
เหตุการณ์นี้จะเริ่มทำงานเมื่อโหลดเส้นทางสำเร็จ

อินเทอร์เฟซ Route3DElementOptions

อินเทอร์เฟซ google.maps.routes.Route3DElementOptions
ติดตั้งใช้งานโดย Route3DElement

ออบเจ็กต์ Route3DElementOptions ที่ใช้กำหนดพร็อพเพอร์ตี้ที่ตั้งค่าได้ใน Route3DElement

autofitsCamera
ไม่บังคับ
ประเภท: boolean optional
เลือกว่าจะเลือกใช้การปรับกล้องให้พอดีกับเส้นทางโดยอัตโนมัติหรือไม่
departureTime
ไม่บังคับ
ประเภท: Date optional
destination
ไม่บังคับ
ประเภท: string|LatLng|LatLngLiteral|LatLngAltitude|LatLngAltitudeLiteral|Place optional
internalUsageAttributionIds
ไม่บังคับ
ประเภท: Iterable<string> optional
ตัวระบุที่ใช้เพื่อระบุแหล่งที่มาของการเรียกไปยังแพ็กเกจหรือไลบรารี OSS ที่เฉพาะเจาะจง
origin
ไม่บังคับ
ประเภท: string|LatLng|LatLngLiteral|LatLngAltitude|LatLngAltitudeLiteral|Place optional
routingPreference
ไม่บังคับ
ประเภท: RoutingPreference optional
trafficPolylinesDisabled
ไม่บังคับ
ประเภท: boolean optional
ระบุว่าจะปิดใช้เส้นประกอบที่รับรู้การจราจรหรือไม่ เส้นประกอบที่คำนึงถึงการจราจรจะใช้ได้ก็ต่อเมื่อตั้งค่า routingPreference เป็น TRAFFIC_AWARE หรือ TRAFFIC_AWARE_OPTIMAL เท่านั้น
travelMode
ไม่บังคับ
ประเภท: TravelMode optional