MapOptions

extension 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,
                            optimizeForTerrain: Bool = true,
                            size: CGSize? = nil,
                            pixelRatio: CGFloat = UIScreen.main.nativeScale,
                            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 the main screen’s native 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 }
  • With terrain on, if true, the map will render for performance priority, which may lead to layer reordering allowing to maximize performance (layers that are draped over terrain will be drawn first, including fill, line, background, hillshade and raster). Any layers that are positioned after symbols are draped last, over symbols. Otherwise, if set to false, the map will always be drawn for layer order priority.

    By default, it is set to true.

    Declaration

    Swift

    public var optimizeForTerrain: 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 }
  • Undocumented

    Declaration

    Swift

    public override func isEqual(_ object: Any?) -> Bool
  • Undocumented

    Declaration

    Swift

    open override var hash: Int { get }