ScaleBarViewOptions

public struct ScaleBarViewOptions : OrnamentOptionsProtocol, Equatable

Used to configure position, margin, and visibility for the map’s scale bar view.

  • The position of the scale bar view.

    The default value for this property is .topLeading.

    Declaration

    Swift

    public var position: OrnamentPosition
  • The margins of the scale bar view.

    The default value for this property is CGPoint(x: 8.0, y: 8.0).

    Declaration

    Swift

    public var margins: CGPoint
  • The visibility of the scale bar view.

    The default value for this property is .adaptive.

    Declaration

    Swift

    public var visibility: OrnamentVisibility
  • Specifies the whether the scale bar uses the metric system. True if the scale bar is using metric units, false if the scale bar is using imperial units.

    The default value for this property is Locale.current.usesMetricSystem.

    Declaration

    Swift

    public var useMetricUnits: Bool
  • Initializes a ScaleBarViewOptions.

    Declaration

    Swift

    public init(
        position: OrnamentPosition = .topLeading,
        margins: CGPoint = .init(x: 8.0, y: 8.0),
        visibility: OrnamentVisibility = .adaptive,
        useMetricUnits: Bool = Locale.current.usesMetricSystem
    )

    Parameters

    position

    The position of the scale bar view.

    margins

    The margins of the scale bar view.

    visibility

    The visibility of the scale bar view.

    useMetricUnits

    Whether the scale bar uses the metric system.