Calculates a route to the given waypoints and simulates travel along this route. The new route
will use the travel mode that is set on the GMSMapView.
Travel will be started just before the callback is called with GMSRouteStatusOK. If the
callback returns any value other than GMSRouteStatusOK, no simulation will start. If any other
simulator methods are called before the route is generated, route generation will be canceled and
the callback will be called with GMSRouteStatusCanceled.
Calculates a route to the given waypoints, and simulates travel along this route. The new route
will use the travel mode which is set on the GMSMapView.
Travel starts right before the callback is invoked with GMSRouteStatusOK. If the callback
returns a value other than GMSRouteStatusOK, then no simulation starts. If any other simulator
methods are called before the route is generated, then route generation will be canceled, and the
callback will be called with GMSRouteStatusCanceled.
Whether the simulation is currently paused. If this is set to YES whilst simulating along a
route, then location updates will still be sent periodically, but the location will stop
advancing along the route.
The speed multiplier to use when simulating travel along a route. The value of this property must
be positive. Attempting to set a non-positive value will have no effect. The default value is
1.0.
Set license plate restriction with current vehicle’s last digit of license plate and country
code. This allows us to route around certain types of road restrictions which are based on
license plate number. This will only apply to -simulateAlongNewRouteToDestinations calls made
after this value is set.
Set to nil if there is no license plate restriction. Default to nil.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-15 UTC."],[[["\u003cp\u003e\u003ccode\u003eGMSLocationSimulator\u003c/code\u003e is a class used for simulating device location for testing purposes in iOS applications.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to simulate movement along existing or new routes, set location at a fixed coordinate, and control simulation speed and behavior.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use this class to test location-based features and functionalities within their apps without needing actual device movement.\u003c/p\u003e\n"],["\u003cp\u003eThe simulator allows for pausing the simulation, avoiding certain road types like highways or tolls, and introducing random location jittering for realistic testing scenarios.\u003c/p\u003e\n"],["\u003cp\u003eIt also includes methods to simulate navigation prompts and traffic incident reports for a more comprehensive testing environment.\u003c/p\u003e\n"]]],["The `GMSLocationSimulator` class simulates device locations for testing. Key actions include: simulating travel along existing routes or new routes to specified destinations using various routing options, simulating a fixed location, stopping the simulation, and displaying dummy navigation/traffic prompts. It allows pausing simulations, adjusting speed, avoiding tolls/highways/ferries, and setting license plate restrictions. The simulator can be set to randomly \"jitter\" the simulated location. Route simulations require a callback to handle the status of the route.\n"],null,["GMSLocationSimulator \n\n @interface GMSLocationSimulator : NSObject\n\nA class you can use to simulate a device location for testing purposes.\n- `\n ``\n ``\n `\n\n [-init](#/c:objc(cs)GMSLocationSimulator(im)init)`\n ` \n Unavailable \n\n Declaration \n Objective-C \n\n - (instancetype)init NS_UNAVAILABLE;\n\n- `\n ``\n ``\n `\n\n [-simulateLocationsAlongExistingRoute](#/c:objc(cs)GMSLocationSimulator(im)simulateLocationsAlongExistingRoute)`\n ` \n Starts simulating travel along the route currently set on the [GMSNavigator](../Classes/GMSNavigator.html). If the\n [GMSNavigator](../Classes/GMSNavigator.html) does not have a route, this does nothing. \n\n Declaration \n Swift \n\n func simulateLocationsAlongExistingRoute()\n\n Objective-C \n\n - (void)simulateLocationsAlongExistingRoute;\n\n- `\n ``\n ``\n `\n\n [-simulateAlongNewRouteToDestinations:callback:](#/c:objc(cs)GMSLocationSimulator(im)simulateAlongNewRouteToDestinations:callback:)`\n ` \n Calculates a route to the given waypoints and simulates travel along this route. The new route\n will use the travel mode that is set on the [GMSMapView](../Classes/GMSMapView.html).\n\n Travel will be started just before the callback is called with `GMSRouteStatusOK`. If the\n callback returns any value other than `GMSRouteStatusOK`, no simulation will start. If any other\n simulator methods are called before the route is generated, route generation will be canceled and\n the callback will be called with `GMSRouteStatusCanceled`. \n\n Declaration \n Swift \n\n func simulateAlongNewRoute(toDestinations destinations: [../Classes/GMSNavigationWaypoint.html], callback: @escaping ../Type-Definitions/GMSRouteStatusCallback.html)\n\n Objective-C \n\n - (void)simulateAlongNewRouteToDestinations:\n (nonnull NSArray\u003c../Classes/GMSNavigationWaypoint.html *\u003e *)destinations\n callback:\n (nonnull ../Type-Definitions/GMSRouteStatusCallback.html)callback;\n\n Parameters\n\n |----------------------|------------------------------------------------------------------------|\n | ` `*destinations*` ` | The list of destinations for the route that will be simulated. |\n | ` `*callback*` ` | A block that will be called when the route becomes available or fails. |\n\n- `\n ``\n ``\n `\n\n [-simulateAlongNewRouteToDestinations:routingOptions:callback:](#/c:objc(cs)GMSLocationSimulator(im)simulateAlongNewRouteToDestinations:routingOptions:callback:)`\n ` \n Calculates a route to the given waypoints, and simulates travel along this route. The new route\n will use the travel mode which is set on the [GMSMapView](../Classes/GMSMapView.html).\n\n Travel starts right before the callback is invoked with `GMSRouteStatusOK`. If the callback\n returns a value other than `GMSRouteStatusOK`, then no simulation starts. If any other simulator\n methods are called before the route is generated, then route generation will be canceled, and the\n callback will be called with `GMSRouteStatusCanceled`. \n\n Declaration \n Swift \n\n func simulateAlongNewRoute(toDestinations destinations: [../Classes/GMSNavigationWaypoint.html], routingOptions: ../Classes/GMSNavigationRoutingOptions.html, callback: @escaping ../Type-Definitions/GMSRouteStatusCallback.html)\n\n Objective-C \n\n - (void)simulateAlongNewRouteToDestinations:\n (nonnull NSArray\u003c../Classes/GMSNavigationWaypoint.html *\u003e *)destinations\n routingOptions:\n (nonnull ../Classes/GMSNavigationRoutingOptions.html *)\n routingOptions\n callback:\n (nonnull ../Type-Definitions/GMSRouteStatusCallback.html)callback;\n\n Parameters\n\n |------------------------|------------------------------------------------------------------------|\n | ` `*destinations*` ` | The list of destinations for the route that will be simulated. |\n | ` `*routingOptions*` ` | The routing logic that will determine the returned route. |\n | ` `*callback*` ` | A block that will be called when the route becomes available or fails. |\n\n- `\n ``\n ``\n `\n\n [-simulateLocationAtCoordinate:](#/c:objc(cs)GMSLocationSimulator(im)simulateLocationAtCoordinate:)`\n ` \n Starts simulating the device location at a fixed coordinate. \n\n Declaration \n Swift \n\n func simulateLocation(at coordinate: CLLocationCoordinate2D)\n\n Objective-C \n\n - (void)simulateLocationAtCoordinate:(CLLocationCoordinate2D)coordinate;\n\n- `\n ``\n ``\n `\n\n [-stopSimulation](#/c:objc(cs)GMSLocationSimulator(im)stopSimulation)`\n ` \n Stops simulating the device location if it is currently being simulated. \n\n Declaration \n Swift \n\n func stopSimulation()\n\n Objective-C \n\n - (void)stopSimulation;\n\n- `\n ``\n ``\n `\n\n [-simulateNavigationPrompt](#/c:objc(cs)GMSLocationSimulator(im)simulateNavigationPrompt)`\n ` \n Diplays a navigation prompt with fake data for testing purposes. \n\n Declaration \n Swift \n\n func simulateNavigationPrompt()\n\n Objective-C \n\n - (void)simulateNavigationPrompt;\n\n- `\n ``\n ``\n `\n\n [-simulateTrafficIncidentReport](#/c:objc(cs)GMSLocationSimulator(im)simulateTrafficIncidentReport)`\n ` \n Displays a dummy traffic prompt for testing purposes. \n\n Declaration \n Swift \n\n func simulateTrafficIncidentReport()\n\n Objective-C \n\n - (void)simulateTrafficIncidentReport;\n\n- `\n ``\n ``\n `\n\n [paused](#/c:objc(cs)GMSLocationSimulator(py)paused)`\n ` \n Whether the simulation is currently paused. If this is set to `YES` whilst simulating along a\n route, then location updates will still be sent periodically, but the location will stop\n advancing along the route. \n\n Declaration \n Swift \n\n var isPaused: Bool { get set }\n\n Objective-C \n\n @property (nonatomic, getter=isPaused) BOOL paused;\n\n- `\n ``\n ``\n `\n\n [avoidsHighways](#/c:objc(cs)GMSLocationSimulator(py)avoidsHighways)`\n ` \n Whether to avoid highways when simulating travel to destinations with the\n [-simulateAlongNewRouteToDestinations:callback:](../Classes/GMSLocationSimulator.html#/c:objc(cs)GMSLocationSimulator(im)simulateAlongNewRouteToDestinations:callback:) method. Defaults to NO. \n\n Declaration \n Swift \n\n var avoidsHighways: Bool { get set }\n\n Objective-C \n\n @property (nonatomic) BOOL avoidsHighways;\n\n- `\n ``\n ``\n `\n\n [avoidsTolls](#/c:objc(cs)GMSLocationSimulator(py)avoidsTolls)`\n ` \n Whether to avoid toll roads when simulating travel to destinations with the\n [-simulateAlongNewRouteToDestinations:callback:](../Classes/GMSLocationSimulator.html#/c:objc(cs)GMSLocationSimulator(im)simulateAlongNewRouteToDestinations:callback:) method. Defaults to NO. \n\n Declaration \n Swift \n\n var avoidsTolls: Bool { get set }\n\n Objective-C \n\n @property (nonatomic) BOOL avoidsTolls;\n\n- `\n ``\n ``\n `\n\n [avoidsFerries](#/c:objc(cs)GMSLocationSimulator(py)avoidsFerries)`\n ` \n Whether to avoid ferries when simulating travel to destinations with the\n [-simulateAlongNewRouteToDestinations:callback:](../Classes/GMSLocationSimulator.html#/c:objc(cs)GMSLocationSimulator(im)simulateAlongNewRouteToDestinations:callback:) method. Defaults to YES. \n\n Declaration \n Swift \n\n var avoidsFerries: Bool { get set }\n\n Objective-C \n\n @property (nonatomic) BOOL avoidsFerries;\n\n- `\n ``\n ``\n `\n\n [speedMultiplier](#/c:objc(cs)GMSLocationSimulator(py)speedMultiplier)`\n ` \n The speed multiplier to use when simulating travel along a route. The value of this property must\n be positive. Attempting to set a non-positive value will have no effect. The default value is\n 1.0. \n\n Declaration \n Swift \n\n var speedMultiplier: Float { get set }\n\n Objective-C \n\n @property (nonatomic) float speedMultiplier;\n\n- `\n ``\n ``\n `\n\n [locationJitteringEnabled](#/c:objc(cs)GMSLocationSimulator(py)locationJitteringEnabled)`\n ` \n Whether the simulated location should jitter randomly. \n\n Declaration \n Swift \n\n var isLocationJitteringEnabled: Bool { get set }\n\n Objective-C \n\n @property (nonatomic, assign, unsafe_unretained, readwrite,\n getter=isLocationJitteringEnabled) BOOL locationJitteringEnabled;\n\n- `\n ``\n ``\n `\n\n [licensePlateRestriction](#/c:objc(cs)GMSLocationSimulator(py)licensePlateRestriction)`\n ` \n Set license plate restriction with current vehicle's last digit of license plate and country\n code. This allows us to route around certain types of road restrictions which are based on\n license plate number. This will only apply to `-simulateAlongNewRouteToDestinations` calls made\n after this value is set.\n\n Set to nil if there is no license plate restriction. Default to nil. \n\n Declaration \n Swift \n\n var licensePlateRestriction: ../Classes/GMSNavigationLicensePlateRestriction.html? { get set }\n\n Objective-C \n\n @property (nonatomic, nullable) ../Classes/GMSNavigationLicensePlateRestriction.html *licensePlateRestriction;"]]