AI-generated Key Takeaways
-
GMSRouteStatusis an enum representing the result of a Google Maps route request, indicating success, various errors, or other states. -
A successful route calculation is represented by
GMSRouteStatusOK. -
Multiple error statuses, like
GMSRouteStatusNoRouteFoundorGMSRouteStatusNetworkError, signal specific reasons for route calculation failures. -
Some errors, such as
GMSRouteStatusQuotaExceededorGMSRouteStatusAPIKeyNotAuthorized, relate to usage limits or permissions. -
Other status codes indicate issues with the request itself, such as
GMSRouteStatusDuplicateWaypointsErroror invalid waypoints.
GMSRouteStatus
enum GMSRouteStatus : NSInteger {}A GMSRouteStatus is a status code that represents the result of a route request.
-
A route could not be calculated because of an internal error. In some case, this can be resolved by updating to a newer SDK version.
Declaration
Swift
case internalError = 0Objective-C
GMSRouteStatusInternalError = 0 -
A route to the destination was successfully calculated.
Declaration
Swift
case OK = 1Objective-C
GMSRouteStatusOK -
A route to the destination could not be calculated.
Declaration
Swift
case noRouteFound = 2Objective-C
GMSRouteStatusNoRouteFound -
A route to the destination could not be calculated because of a network error.
Declaration
Swift
case networkError = 3Objective-C
GMSRouteStatusNetworkError -
A route to the destination could not be calculated because of insufficient quota.
Declaration
Swift
case quotaExceeded = 4Objective-C
GMSRouteStatusQuotaExceeded -
A route could not be calculated because the provided key does not have permission to use the Navigation SDK.
Declaration
Swift
case apiKeyNotAuthorized = 5Objective-C
GMSRouteStatusAPIKeyNotAuthorized -
The route calculation was canceled in favor of a newer one.
Declaration
Swift
case canceled = 6Objective-C
GMSRouteStatusCanceled -
A route could not be calculated because there were duplicate waypoints present in the request.
Declaration
Swift
case duplicateWaypointsError = 7Objective-C
GMSRouteStatusDuplicateWaypointsError -
A route could not be calculated because no waypoints were provided.
Declaration
Swift
case noWaypointsError = 8Objective-C
GMSRouteStatusNoWaypointsError -
A route could not be calculated because the user’s location is not available. This could be because the user hasn’t granted location permissions for the app.
Declaration
Swift
case locationUnavailable = 9Objective-C
GMSRouteStatusLocationUnavailable -
A route could not be generated because there was a problem with the waypoints provided in the request. For example, a stale or invalid Place ID may have been provided.
Declaration
Swift
case waypointError = 10Objective-C
GMSRouteStatusWaypointError -
A route could not be generated if given an unsupported travel mode. For example, if you are setting destinations with a route token, only Driving and TwoWheeler travel mode are supported.
Declaration
Swift
case travelModeUnsupported = 11Objective-C
GMSRouteStatusTravelModeUnsupported