Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Ở một số nơi, người lái xe không thể dừng lại một cách an toàn (ví dụ: khu vực trên cao, phà, địa điểm dưới lòng đất và những khu vực khác có quyền tiếp cận hạn chế). Tính năng Điểm dừng sẽ di chuyển điểm tham chiếu đến một địa điểm gần đó nếu vị trí của điểm tham chiếu đó không phù hợp để xe dừng lại. Khi bạn đặt vehicleStopover thành YES, điểm đánh dấu sẽ tự động được di chuyển khi tuyến đường được tính toán, nếu có vị trí thay thế.
Cách hoạt động
Bạn đặt lựa chọn ưu tiên cho điểm dừng chân khi tạo điểm tham chiếu cho điểm dừng đó.
Để thực hiện việc này, hãy đặt lựa chọn ưu tiên cho một điểm dừng trên GMSNavigationMutableWaypoint như trong ví dụ sau:
Swift
CLLocationCoordinate2Dlocation=CLLocationCoordinate2D(47.67,-122.20);GMSNavigationMutableWaypoint*waypoint=GMSNavigationMutableWaypoint(withLocation:location,title:@"waypoint from location");waypoint.vehicleStopover=YES;mapView.navigator?.setDestinations([waypoint],routingOptions:routingOptions,callback:{...})
Objective-C
CLLocationCoordinate2Dlocation=CLLocationCoordinate2DMake(47.67,-122.20);GMSNavigationMutableWaypoint*waypoint=[[GMSNavigationMutableWaypointalloc]initWithLocation:locationtitle:@"waypoint from location"];waypoint.vehicleStopover=YES;[_mapView.navigatorsetDestinations:@[waypoint1]routingOptions:routingOptionscallback:^(GMSRouteStatusrouteStatus){...}];
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-16 UTC."],[[["The **Stopover** feature automatically relocates waypoints to nearby, accessible locations if the original location is unsafe for vehicle stops (e.g., elevated areas, ferries)."],["Enabling `vehicleStopover` when creating a waypoint allows the Maps SDK to automatically find an alternate, safe stopping point during route calculation."],["Developers can set the `vehicleStopover` preference to `YES` using `GMSNavigationMutableWaypoint` in their Swift or Objective-C code to utilize this feature."]]],["The **Stopover** feature automatically relocates waypoints unsuitable for vehicle stops, such as elevated areas or ferries. To enable this, set `vehicleStopover` to `YES` on a `GMSNavigationMutableWaypoint` when creating the waypoint. This triggers automatic relocation during route calculation if an alternative location is available. The provided examples in Swift and Objective-C demonstrate how to configure `vehicleStopover` on a waypoint.\n"]]