GMSUISettings Class Reference

GMSUISettings Class Reference

Overview

Settings for the user interface of a GMSMapView.

Public Member Functions

(void) - setAllGesturesEnabled:
 Sets the preference for whether all gestures should be enabled (default) or disabled.

Properties

BOOL scrollGestures
 Controls whether scroll gestures are enabled (default) or disabled.
BOOL zoomGestures
 Controls whether zoom gestures are enabled (default) or disabled.
BOOL tiltGestures
 Controls whether tilt gestures are enabled (default) or disabled.
BOOL rotateGestures
 Controls whether rotate gestures are enabled (default) or disabled.
BOOL consumesGesturesInView
 Controls whether gestures by users are completely consumed by the GMSMapView when gestures are enabled (default YES).
BOOL compassButton
 Enables or disables the compass.
BOOL myLocationButton
 Enables or disables the My Location button.
BOOL indoorPicker
 Enables (default) or disables the indoor floor picker.
BOOL allowScrollGesturesDuringRotateOrZoom
 Controls whether rotate and zoom gestures can be performed off-center and scrolled around (default YES).
BOOL navigationHeaderEnabled
 Enables or disables the navigation header.
BOOL navigationFooterEnabled
 Enables or disables the navigation footer.
BOOL navigationTripProgressBarEnabled
 Enables or disables the navigation trip progress bar.
BOOL recenterButtonEnabled
 Enables or disables the recenter button.
BOOL showsIncidentCards
 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.
BOOL showsDestinationMarkers
 Whether destination markers for routes will be shown.
BOOL showsTrafficLights
 Whether to show traffic lights along the route during navigation.
BOOL showsStopSigns
 Whether to show stop signs along the route during navigation.
UIColor * navigationHeaderPrimaryBackgroundColor
 The primary background color to use for the navigation header.
UIColor * navigationHeaderSecondaryBackgroundColor
 The secondary background color to use for the navigation header.
CGFloat navigationHeaderBackgroundAlpha
 The alpha value of the navigation header view.
UIColor * navigationHeaderPrimaryBackgroundColorNightMode
 The primary background color of the navigation header, in night mode, when the navigation header is showing the current step.
UIColor * navigationHeaderSecondaryBackgroundColorNightMode
 The secondary background color of the navigation header, in night mode, when the navigation header is showing the current step.
UIColor * navigationHeaderLargeManeuverIconColor
 The color of the maneuver icon in the primary navigation header view.
UIColor * navigationHeaderSmallManeuverIconColor
 The color of the maneuver icon in the next turn navigation header view.
UIColor * navigationHeaderGuidanceRecommendedLaneColor
 The color of the recommended lane or lanes.
UIColor * navigationHeaderNextStepTextColor
 The color of the text in the next step header when the navigation header is showing the current step.
UIFont * navigationHeaderNextStepFont
 The font of the text in the next step header.
UIColor * navigationHeaderDistanceValueTextColor
 The color of the text for the distance value when the navigation header is showing the current step.
UIFont * navigationHeaderDistanceValueFont
 The font of the text for the distance value.
UIColor * navigationHeaderDistanceUnitsTextColor
 The color of the text for the distance units when the navigation header is showing the current step.
UIFont * navigationHeaderDistanceUnitsFont
 The font of the text for the distance units.
UIColor * navigationHeaderInstructionsTextColor
 The color of the text in the instructions section.
UIFont * navigationHeaderInstructionsFirstRowFont
 The font of the text for the first row in the instructions section.
UIFont * navigationHeaderInstructionsSecondRowFont
 The font of the text for the second row in the instructions section.
UIFont * navigationHeaderInstructionsConjunctionsFont
 The font of the text for the conjunctions in the instructions section.
GMSNavigationSpeedometerUIOptionsspeedometerUIOptions
 Sets the speedometer UI configuration based on speed alert severity.

Member Function Documentation

- (void) setAllGesturesEnabled: (BOOL)  enabled

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.


Property Documentation

- (BOOL) scrollGestures [read, write, assign]

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.

- (BOOL) zoomGestures [read, write, assign]

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.

- (BOOL) tiltGestures [read, write, assign]

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.

- (BOOL) rotateGestures [read, write, assign]

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.

- (BOOL) consumesGesturesInView [read, write, assign]

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.

- (BOOL) compassButton [read, write, assign]

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.

- (BOOL) myLocationButton [read, write, assign]

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.

- (BOOL) indoorPicker [read, write, assign]

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.

- (BOOL) allowScrollGesturesDuringRotateOrZoom [read, write, assign]

Controls whether rotate and zoom gestures can be performed off-center and scrolled around (default YES).

- (BOOL) navigationHeaderEnabled [read, write, assign]

Enables or disables the navigation header.

The header displays guidance instructions at the top of the map. This defaults to YES.

- (BOOL) navigationFooterEnabled [read, write, assign]

Enables or disables the navigation footer.

The footer displays distance and ETA information at the bottom of the map. This defaults to YES.

- (BOOL) navigationTripProgressBarEnabled [read, write, assign]

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.

- (BOOL) recenterButtonEnabled [read, write, assign]

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.

- (BOOL) showsIncidentCards [read, write, assign]

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.

- (BOOL) showsDestinationMarkers [read, write, assign]

Whether destination markers for routes will be shown.

This defaults to YES.

- (BOOL) showsTrafficLights [read, write, assign]

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.

- (BOOL) showsStopSigns [read, write, assign]

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.

- (UIColor*) navigationHeaderPrimaryBackgroundColor [read, write, copy]

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.

- (UIColor*) navigationHeaderSecondaryBackgroundColor [read, write, copy]

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.

- (CGFloat) navigationHeaderBackgroundAlpha [read, write, assign]

The alpha value of the navigation header view.

This defaults to 1.0f (fully opaque).

- (UIColor*) navigationHeaderPrimaryBackgroundColorNightMode [read, write, copy]

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.

- (UIColor*) navigationHeaderSecondaryBackgroundColorNightMode [read, write, copy]

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.

- (UIColor*) navigationHeaderLargeManeuverIconColor [read, write, copy]

The color of the maneuver icon in the primary navigation header view.

- (UIColor*) navigationHeaderSmallManeuverIconColor [read, write, copy]

The color of the maneuver icon in the next turn navigation header view.

- (UIColor*) navigationHeaderGuidanceRecommendedLaneColor [read, write, copy]

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.

- (UIColor*) navigationHeaderNextStepTextColor [read, write, copy]

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.

- (UIFont*) navigationHeaderNextStepFont [read, write, copy]

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.

- (UIColor*) navigationHeaderDistanceValueTextColor [read, write, copy]

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.

- (UIFont*) navigationHeaderDistanceValueFont [read, write, copy]

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.

- (UIColor*) navigationHeaderDistanceUnitsTextColor [read, write, copy]

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.

- (UIFont*) navigationHeaderDistanceUnitsFont [read, write, copy]

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.

- (UIColor*) navigationHeaderInstructionsTextColor [read, write, copy]

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.

- (UIFont*) navigationHeaderInstructionsFirstRowFont [read, write, copy]

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.

- (UIFont*) navigationHeaderInstructionsSecondRowFont [read, write, copy]

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.

- (UIFont*) navigationHeaderInstructionsConjunctionsFont [read, write, copy]

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.

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.