Preferenza scali
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
In alcuni luoghi, i conducenti non possono fermarsi in sicurezza (ad esempio, in zone sopraelevate, traghetti, luoghi sotterranei e altre aree con accesso limitato). La funzionalità Sosta sposta il waypoint in un luogo vicino se la sua posizione non è adatta a una sosta del veicolo. Quando imposti
vehicleStopover su YES, il waypoint viene riposizionato automaticamente quando
viene calcolato il percorso, se è disponibile una posizione alternativa.
Come funziona
Imposti la preferenza per una sosta quando crei il waypoint per quella sosta.
Per farlo, imposta la preferenza per uno scalo su un
GMSNavigationMutableWaypoint come mostrato nell'esempio seguente:
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){...}];
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-12-19 UTC."],[],["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"]]