# GMSLocationSimulator

    @interface GMSLocationSimulator : NSObject

A class you can use to simulate a device location for testing purposes.
- `
  ### [-init](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSLocationSimulator#/c:objc(cs)GMSLocationSimulator(im)init)

  ` Unavailable

  #### Declaration

  Objective-C

      - (instancetype)init NS_UNAVAILABLE;

- `
  ### [-simulateLocationsAlongExistingRoute](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSLocationSimulator#/c:objc(cs)GMSLocationSimulator(im)simulateLocationsAlongExistingRoute)

  ` Starts simulating travel along the route currently set on the `https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSNavigator.html`. If the `https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSNavigator.html` does not have a route, this does nothing.

  #### Declaration

  Swift

      func simulateLocationsAlongExistingRoute()

  Objective-C

      - (void)simulateLocationsAlongExistingRoute;

- `
  ### [-simulateAlongNewRouteToDestinations:callback:](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSLocationSimulator#/c:objc(cs)GMSLocationSimulator(im)simulateAlongNewRouteToDestinations:callback:)

  ` 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 `https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSMapView.html`.

  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`.

  #### Declaration

  Swift

      func simulateAlongNewRoute(toDestinations destinations: [https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSNavigationWaypoint.html], callback: @escaping https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Type-Definitions/GMSRouteStatusCallback.html)

  Objective-C

      - (void)simulateAlongNewRouteToDestinations:
                  (nonnull NSArray<https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSNavigationWaypoint.html *> *)destinations
                                         callback:
                                             (nonnull https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Type-Definitions/GMSRouteStatusCallback.html)callback;

  #### Parameters

  |---|---|
  | ` destinations ` | The list of destinations for the route that will be simulated. |
  | ` callback ` | A block that will be called when the route becomes available or fails. |

- `
  ### [-simulateAlongNewRouteToDestinations:routingOptions:callback:](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSLocationSimulator#/c:objc(cs)GMSLocationSimulator(im)simulateAlongNewRouteToDestinations:routingOptions:callback:)

  ` 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 `https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSMapView.html`.

  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`.

  #### Declaration

  Swift

      func simulateAlongNewRoute(toDestinations destinations: [https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSNavigationWaypoint.html], routingOptions: https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSNavigationRoutingOptions.html, callback: @escaping https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Type-Definitions/GMSRouteStatusCallback.html)

  Objective-C

      - (void)simulateAlongNewRouteToDestinations:
                  (nonnull NSArray<https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSNavigationWaypoint.html *> *)destinations
                                   routingOptions:
                                       (nonnull https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSNavigationRoutingOptions.html *)
                                           routingOptions
                                         callback:
                                             (nonnull https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Type-Definitions/GMSRouteStatusCallback.html)callback;

  #### Parameters

  |---|---|
  | ` destinations ` | The list of destinations for the route that will be simulated. |
  | ` routingOptions ` | The routing logic that will determine the returned route. |
  | ` callback ` | A block that will be called when the route becomes available or fails. |

- `
  ### [-simulateLocationAtCoordinate:](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSLocationSimulator#/c:objc(cs)GMSLocationSimulator(im)simulateLocationAtCoordinate:)

  ` Starts simulating the device location at a fixed coordinate.

  #### Declaration

  Swift

      func simulateLocation(at coordinate: CLLocationCoordinate2D)

  Objective-C

      - (void)simulateLocationAtCoordinate:(CLLocationCoordinate2D)coordinate;

- `
  ### [-stopSimulation](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSLocationSimulator#/c:objc(cs)GMSLocationSimulator(im)stopSimulation)

  ` Stops simulating the device location if it is currently being simulated.

  #### Declaration

  Swift

      func stopSimulation()

  Objective-C

      - (void)stopSimulation;

- `
  ### [-simulateNavigationPrompt](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSLocationSimulator#/c:objc(cs)GMSLocationSimulator(im)simulateNavigationPrompt)

  ` Diplays a navigation prompt with fake data for testing purposes.

  #### Declaration

  Swift

      func simulateNavigationPrompt()

  Objective-C

      - (void)simulateNavigationPrompt;

- `
  ### [-simulateTrafficIncidentReport](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSLocationSimulator#/c:objc(cs)GMSLocationSimulator(im)simulateTrafficIncidentReport)

  ` Displays a dummy traffic prompt for testing purposes.

  #### Declaration

  Swift

      func simulateTrafficIncidentReport()

  Objective-C

      - (void)simulateTrafficIncidentReport;

- `
  ### [paused](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSLocationSimulator#/c:objc(cs)GMSLocationSimulator(py)paused)

  ` Whether the simulation is currently paused. If this is set to `YES` while simulating along a route, then location updates will still be sent periodically, but the location will stop advancing along the route.

  #### Declaration

  Swift

      var isPaused: Bool { get set }

  Objective-C

      @property (nonatomic, getter=isPaused) BOOL paused;

- `
  ### [avoidsHighways](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSLocationSimulator#/c:objc(cs)GMSLocationSimulator(py)avoidsHighways)

  ` Whether to avoid highways when simulating travel to destinations with the `https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSLocationSimulator.html#/c:objc(cs)GMSLocationSimulator(im)simulateAlongNewRouteToDestinations:callback:` method. Defaults to NO.

  #### Declaration

  Swift

      var avoidsHighways: Bool { get set }

  Objective-C

      @property (nonatomic) BOOL avoidsHighways;

- `
  ### [avoidsTolls](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSLocationSimulator#/c:objc(cs)GMSLocationSimulator(py)avoidsTolls)

  ` Whether to avoid toll roads when simulating travel to destinations with the `https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSLocationSimulator.html#/c:objc(cs)GMSLocationSimulator(im)simulateAlongNewRouteToDestinations:callback:` method. Defaults to NO.

  #### Declaration

  Swift

      var avoidsTolls: Bool { get set }

  Objective-C

      @property (nonatomic) BOOL avoidsTolls;

- `
  ### [avoidsFerries](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSLocationSimulator#/c:objc(cs)GMSLocationSimulator(py)avoidsFerries)

  ` Whether to avoid ferries when simulating travel to destinations with the `https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSLocationSimulator.html#/c:objc(cs)GMSLocationSimulator(im)simulateAlongNewRouteToDestinations:callback:` method. Defaults to YES.

  #### Declaration

  Swift

      var avoidsFerries: Bool { get set }

  Objective-C

      @property (nonatomic) BOOL avoidsFerries;

- `
  ### [speedMultiplier](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSLocationSimulator#/c:objc(cs)GMSLocationSimulator(py)speedMultiplier)

  ` 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.

  #### Declaration

  Swift

      var speedMultiplier: Float { get set }

  Objective-C

      @property (nonatomic) float speedMultiplier;

- `
  ### [locationJitteringEnabled](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSLocationSimulator#/c:objc(cs)GMSLocationSimulator(py)locationJitteringEnabled)

  ` Whether the simulated location should jitter randomly.

  #### Declaration

  Swift

      var isLocationJitteringEnabled: Bool { get set }

  Objective-C

      @property (nonatomic, assign, unsafe_unretained, readwrite,
                getter=isLocationJitteringEnabled) BOOL locationJitteringEnabled;

- `
  ### [licensePlateRestriction](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSLocationSimulator#/c:objc(cs)GMSLocationSimulator(py)licensePlateRestriction)

  ` 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.

  #### Declaration

  Swift

      var licensePlateRestriction: https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSNavigationLicensePlateRestriction.html? { get set }

  Objective-C

      @property (nonatomic, nullable) https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSNavigationLicensePlateRestriction.html *licensePlateRestriction;