Preferência de parada

Em alguns lugares, não é possível parar com segurança (por exemplo, áreas elevadas, balsas, locais subterrâneos e outras áreas de acesso limitado). O recurso Parada realoca o ponto de referência para um lugar próximo se o local não for adequado para um veículo fazer uma parada. Quando você define vehicleStopover como YES, o waypoint é automaticamente realocado quando o trajeto é calculado, se um local alternativo estiver disponível.

Como funciona

Você define a preferência de uma parada ao criar o ponto de referência dela. Para fazer isso, defina a preferência de uma parada em um GMSNavigationMutableWaypoint, conforme mostrado no exemplo a seguir:

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){...}];