MapboxCoreMaps.MapOptions

extension MapboxCoreMaps.MapOptions
  • Initialize a MapOptions object that is used when initializing a Map.

    For initializing a MapView please see MapInitOptions, and MapOptions.default for a convenient object that can be used in conjunction.

    Declaration

    Swift

    public convenience init(constrainMode: ConstrainMode = .heightOnly,
                            viewportMode: ViewportMode = .default,
                            orientation: NorthOrientation = .upwards,
                            crossSourceCollisions: Bool = true,
                            size: CGSize? = nil,
                            pixelRatio: CGFloat = UIScreen.main.scale,
                            glyphsRasterizationOptions: GlyphsRasterizationOptions = GlyphsRasterizationOptions(fontFamilies: []))

    Parameters

    constrainMode

    The map constrain mode; default is .heightOnly.

    viewportMode

    The viewport mode; default is .default.

    orientation

    The view orientation; default is .upwards.

    crossSourceCollisions

    Whether cross-source symbol collision detection should be enabled; default is true

    size

    Size of the map, if nil (the default), a minimal default size will be used.

    pixelRatio

    Pixel scale of the map view; default is thee main screen’s scale.

    glyphsRasterizationOptions

    A GlyphsRasterizationOptions object.

  • Specifies whether cross-source symbol collision detection should be enabled. Default is true.

    Declaration

    Swift

    public var crossSourceCollisions: Bool { get }
  • The size of the map object and renderer backend. For Apple platforms this is specified with points (or device-independent pixel units). Other platforms, such as Android, use screen pixel units.

    For MapView usage, this can be left as nil, since view resizing will ensure the correct size is updated.

    Declaration

    Swift

    public var size: CGSize? { get }