GoogleNavigation Framework Reference

GMSUISettings

@interface GMSUISettings : NSObject

Settings for the user interface of a GMSMapView.

  • Sets the preference for whether all gestures should be enabled (default) or disabled. This doesn’t restrict users from tapping any on screen buttons to move the camera (e.g., compass or zoom controls), nor does it restrict programmatic movements and animation.

    Declaration

    Swift

    func setAllGesturesEnabled(_ enabled: Bool)

    Objective-C

    - (void)setAllGesturesEnabled:(BOOL)enabled;
  • Controls whether scroll gestures are enabled (default) or disabled. If enabled, users may drag to pan the camera. This does not limit programmatic movement of the camera.

    Declaration

    Swift

    var scrollGestures: Bool { get set }

    Objective-C

    @property (nonatomic) BOOL scrollGestures;
  • Controls whether zoom gestures are enabled (default) or disabled. If enabled, users may double tap/two-finger tap or pinch to zoom the camera. This does not limit programmatic movement of the camera.

    Declaration

    Swift

    var zoomGestures: Bool { get set }

    Objective-C

    @property (nonatomic) BOOL zoomGestures;
  • Controls whether tilt gestures are enabled (default) or disabled. If enabled, users may use a two-finger vertical down or up swipe to tilt the camera. This does not limit programmatic control of the camera’s viewingAngle.

    Declaration

    Swift

    var tiltGestures: Bool { get set }

    Objective-C

    @property (nonatomic) BOOL tiltGestures;
  • Controls whether rotate gestures are enabled (default) or disabled. If enabled, users may use a two-finger rotate gesture to rotate the camera. This does not limit programmatic control of the camera’s bearing.

    Declaration

    Swift

    var rotateGestures: Bool { get set }

    Objective-C

    @property (nonatomic) BOOL rotateGestures;
  • Controls whether gestures by users are completely consumed by the GMSMapView when gestures are enabled (default YES). This prevents these gestures from being received by parent views.

    When the GMSMapView is contained by a UIScrollView (or other scrollable area), this means that gestures on the map will not be additional consumed as scroll gestures. However, disabling this (set to NO) may be useful to support complex view hierarchies or requirements.

    Declaration

    Swift

    var consumesGesturesInView: Bool { get set }

    Objective-C

    @property (nonatomic) BOOL consumesGesturesInView;
  • Enables or disables the compass. The compass is an icon on the map that indicates the direction of north on the map.

    If enabled, it is only shown when the camera is rotated away from its default orientation (bearing of 0). When a user taps the compass, the camera orients itself to its default orientation and fades away shortly after. If disabled, the compass will never be displayed.

    Declaration

    Swift

    var compassButton: Bool { get set }

    Objective-C

    @property (nonatomic) BOOL compassButton;
  • Enables or disables the My Location button. This is a button visible on the map that, when tapped by users, will center the map on the current user location.

    Declaration

    Swift

    var myLocationButton: Bool { get set }

    Objective-C

    @property (nonatomic) BOOL myLocationButton;
  • Enables (default) or disables the indoor floor picker.

    If enabled, it is only visible when the view is focused on a building with indoor floor data. If disabled, the selected floor can still be controlled programmatically via the indoorDisplay mapView property.

    Declaration

    Swift

    var indoorPicker: Bool { get set }

    Objective-C

    @property (nonatomic) BOOL indoorPicker;
  • Controls whether rotate and zoom gestures can be performed off-center and scrolled around (default YES).

    Declaration

    Swift

    var allowScrollGesturesDuringRotateOrZoom: Bool { get set }

    Objective-C

    @property (nonatomic) BOOL allowScrollGesturesDuringRotateOrZoom;
  • Enables or disables the navigation header. The header displays guidance instructions at the top of the map. This defaults to YES.

    Declaration

    Swift

    var isNavigationHeaderEnabled: Bool { get set }

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isNavigationHeaderEnabled) BOOL navigationHeaderEnabled;
  • Enables or disables the navigation footer. The footer displays distance and ETA information at the bottom of the map. This defaults to YES.

    Declaration

    Swift

    var isNavigationFooterEnabled: Bool { get set }

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isNavigationFooterEnabled) BOOL navigationFooterEnabled;
  • Enables or disables the navigation trip progress bar. The trip progress bar displays the details of the trip ahead in a linear view on the trailing side of the map. This defaults to NO.

    Declaration

    Swift

    var isNavigationTripProgressBarEnabled: Bool { get set }

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isNavigationTripProgressBarEnabled)
        BOOL navigationTripProgressBarEnabled;
  • Enables or disables the recenter button. If set to YES, the recenter button is displayed if the camera is not currently following the user location, or if it is following but the zoom is significantly different to the default. This defaults to YES.

    Declaration

    Swift

    var isRecenterButtonEnabled: Bool { get set }

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isRecenterButtonEnabled) BOOL recenterButtonEnabled;
  • Whether a card showing incident details will be displayed at the top of the map when the user taps an incident icon, eg a road closure. This defaults to YES.

    Declaration

    Swift

    var showsIncidentCards: Bool { get set }

    Objective-C

    @property (nonatomic) BOOL showsIncidentCards;
  • Whether destination markers for routes will be shown. This defaults to YES.

    Declaration

    Swift

    var showsDestinationMarkers: Bool { get set }

    Objective-C

    @property (nonatomic) BOOL showsDestinationMarkers;
  • Whether to show traffic lights along the route during navigation.

    Changes to this setting take effect only in subsequent route requests.

    Once the setting is applied, the user interface shows the first 3 upcoming traffic lights or stop signs at any time during navigation, provided the data is available.

    Defaults to NO.

    Declaration

    Swift

    var showsTrafficLights: Bool { get set }

    Objective-C

    @property (nonatomic) BOOL showsTrafficLights;
  • Whether to show stop signs along the route during navigation.

    Changes to this setting take effect only in subsequent route requests.

    Once the setting is applied, the user interface shows the first 3 upcoming traffic lights or stop signs at any time during navigation, provided the data is available.

    Defaults to NO.

    Declaration

    Swift

    var showsStopSigns: Bool { get set }

    Objective-C

    @property (nonatomic) BOOL showsStopSigns;
  • The primary background color to use for the navigation header. The default value is nil. When the value of this property is nil, green will be used as the primary background color.

    Declaration

    Swift

    @NSCopying var navigationHeaderPrimaryBackgroundColor: UIColor? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) UIColor *navigationHeaderPrimaryBackgroundColor;
  • The secondary background color to use for the navigation header. Appears as the background color in next-turn and lane guidance dropdowns. The default value is nil. When the value of this property is nil, dark green will be used as the secondary background color. The provided UIColor must be in a color space that supports [UIColor getRed:green:blue:alpha] or it will be ignored.

    Declaration

    Swift

    @NSCopying var navigationHeaderSecondaryBackgroundColor: UIColor? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) UIColor *navigationHeaderSecondaryBackgroundColor;
  • The alpha value of the navigation header view. This defaults to 1.0f (fully opaque).

    Declaration

    Swift

    var navigationHeaderBackgroundAlpha: CGFloat { get set }

    Objective-C

    @property (nonatomic) CGFloat navigationHeaderBackgroundAlpha;
  • The primary background color of the navigation header, in night mode, when the navigation header is showing the current step. The default value is nil. When the value of this property is nil, navigationHeaderPrimaryBackgroundColor will be used.

    Declaration

    Swift

    @NSCopying var navigationHeaderPrimaryBackgroundColorNightMode: UIColor? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) UIColor *navigationHeaderPrimaryBackgroundColorNightMode;
  • The secondary background color of the navigation header, in night mode, when the navigation header is showing the current step. The default value is nil. When the value of this property is nil, navigationHeaderSecondaryBackgroundColor will be used.

    Declaration

    Swift

    @NSCopying var navigationHeaderSecondaryBackgroundColorNightMode: UIColor? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) UIColor *navigationHeaderSecondaryBackgroundColorNightMode;
  • The color of the maneuver icon in the primary navigation header view.

    Declaration

    Swift

    @NSCopying var navigationHeaderLargeManeuverIconColor: UIColor? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) UIColor *navigationHeaderLargeManeuverIconColor;
  • The color of the maneuver icon in the next turn navigation header view.

    Declaration

    Swift

    @NSCopying var navigationHeaderSmallManeuverIconColor: UIColor? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) UIColor *navigationHeaderSmallManeuverIconColor;
  • The color of the recommended lane or lanes. Defaults to white. This property is taken into consideration only if the navigation header is displaying the current navigation step. Note that the other lanes (the ones the driver should not take) are automatically colored using a grayed out version of the secondary background color.

    Declaration

    Swift

    @NSCopying var navigationHeaderGuidanceRecommendedLaneColor: UIColor? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) UIColor *navigationHeaderGuidanceRecommendedLaneColor;
  • The color of the text in the next step header when the navigation header is showing the current step. The default value is nil. When the value of this property is nil or when the navigation is showing any other step, white will be used.

    Declaration

    Swift

    @NSCopying var navigationHeaderNextStepTextColor: UIColor? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) UIColor *navigationHeaderNextStepTextColor;
  • The font of the text in the next step header. The default value is nil. When the value of this property is nil, the system font of size 16.0f will be used.

    Declaration

    Swift

    @NSCopying var navigationHeaderNextStepFont: UIFont? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) UIFont *navigationHeaderNextStepFont;
  • The color of the text for the distance value when the navigation header is showing the current step. The default value is nil. When the value of this property is nil or when the navigation is showing any other step, white will be used.

    Declaration

    Swift

    @NSCopying var navigationHeaderDistanceValueTextColor: UIColor? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) UIColor *navigationHeaderDistanceValueTextColor;
  • The font of the text for the distance value. The default value is nil. When the value of this property is nil, the system bold font of size 24.0f will be used.

    Declaration

    Swift

    @NSCopying var navigationHeaderDistanceValueFont: UIFont? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) UIFont *navigationHeaderDistanceValueFont;
  • The color of the text for the distance units when the navigation header is showing the current step. The default value is nil. When the value of this property is nil or when the navigation is showing any other step, gray will be used.

    Declaration

    Swift

    @NSCopying var navigationHeaderDistanceUnitsTextColor: UIColor? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) UIColor *navigationHeaderDistanceUnitsTextColor;
  • The font of the text for the distance units. The default value is nil. When the value of this property is nil, the system font of size 18.0f will be used.

    Declaration

    Swift

    @NSCopying var navigationHeaderDistanceUnitsFont: UIFont? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) UIFont *navigationHeaderDistanceUnitsFont;
  • The color of the text in the instructions section. The default value is nil. When the value of this property is nil, white will be used.

    Declaration

    Swift

    @NSCopying var navigationHeaderInstructionsTextColor: UIColor? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) UIColor *navigationHeaderInstructionsTextColor;
  • The font of the text for the first row in the instructions section. The default value is nil. When the value of this property is nil, the system bold font of size 30 will be used.

    Declaration

    Swift

    @NSCopying var navigationHeaderInstructionsFirstRowFont: UIFont? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) UIFont *navigationHeaderInstructionsFirstRowFont;
  • The font of the text for the second row in the instructions section. The default value is nil. When the value of this property is nil, the system bold font of size 24 will be used.

    Declaration

    Swift

    @NSCopying var navigationHeaderInstructionsSecondRowFont: UIFont? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) UIFont *navigationHeaderInstructionsSecondRowFont;
  • The font of the text for the conjunctions in the instructions section. The default value is nil. When the value of this property is nil, the system bold font of size 18 will be used.

    Declaration

    Swift

    @NSCopying var navigationHeaderInstructionsConjunctionsFont: UIFont? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) UIFont *navigationHeaderInstructionsConjunctionsFont;
  • Sets the speedometer UI configuration based on speed alert severity.

    By setting a GMSNavigationSpeedometerUIOptions, you clear the previous one if set. When no GMSNavigationSpeedometerUIOptions is configured, speed alert UI fallbacks to NavSDK default configurations:

    • Minor speed alert in day mode: red text with white background.
    • Minor speed alert in night mode: red text with dark background.
    • Major speed alert in day mode: white text with red background.
    • Major speed alert in night mode: white text with red background.

    Declaration

    Swift

    @NSCopying var speedometerUIOptions: GMSNavigationSpeedometerUIOptions? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) GMSNavigationSpeedometerUIOptions *speedometerUIOptions;