MTFitBoundsOptions

public struct MTFitBoundsOptions : Sendable, Codable

Options that configure how the map fits to a set of bounds.

  • Padding to apply on each side of the viewport when fitting the bounds.

    Declaration

    Swift

    public var padding: MTFitBoundsPadding?
  • The maximum zoom level that the fit operation can produce.

    Declaration

    Swift

    public var maxZoom: Double?
  • Enables linear interpolation instead of the default easing.

    Declaration

    Swift

    public var linear: Bool?
  • Final bearing for the camera after the fit completes.

    Declaration

    Swift

    public var bearing: Double?
  • Final pitch for the camera after the fit completes.

    Declaration

    Swift

    public var pitch: Double?
  • Additional animation configuration.

    Declaration

    Swift

    public var animationOptions: MTAnimationOptions?
  • Creates a new set of fit bounds options.

    Declaration

    Swift

    public init(
        padding: MTFitBoundsPadding? = nil,
        maxZoom: Double? = nil,
        linear: Bool? = nil,
        bearing: Double? = nil,
        pitch: Double? = nil,
        animationOptions: MTAnimationOptions? = nil
    )

    Parameters

    padding

    Padding to apply around the fitted bounds.

    maxZoom

    Upper zoom limit for the resulting camera.

    linear

    Boolean indicating whether to animate linearly.

    bearing

    Target bearing after the fit completes.

    pitch

    Target pitch after the fit completes.

    animationOptions

    Extra animation parameters.

  • Declaration

    Swift

    public init(from decoder: any Decoder) throws
  • Declaration

    Swift

    public func encode(to encoder: Encoder) throws