העדפת עצירת ביניים

במקומות מסוימים, הנהגים לא יכולים לעצור בבטחה (לדוגמה, באזורים מוגבהים, במעבורות, במיקומים תת-קרקעיים ובאזורים אחרים עם גישה מוגבלת). התכונה עצירה מעבירה את נקודת הדרך למקום סמוך אם המיקום שלה לא מתאים לעצירה של רכב. כשמגדירים את vehicleStopover ל-YES, נקודת הביניים ממוקמת מחדש באופן אוטומטי כשמחשבים את המסלול, אם יש מיקום חלופי.

איך זה עובד

כשיוצרים את נקודת הציון של העצירה, מגדירים את ההעדפה לעצירה. כדי לעשות את זה, מגדירים את ההעדפה לחניית ביניים ב-GMSNavigationMutableWaypoint כמו בדוגמה הבאה:

Swift

CLLocationCoordinate2D location = 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

CLLocationCoordinate2D location = CLLocationCoordinate2DMake(47.67, -122.20);
GMSNavigationMutableWaypoint *waypoint =
    [[GMSNavigationMutableWaypoint alloc] initWithLocation:location
                                                     title:@"waypoint from location"];
waypoint.vehicleStopover = YES;
[_mapView.navigator setDestinations:@[waypoint1]
                     routingOptions:routingOptions
                           callback:^(GMSRouteStatus routeStatus){...}];