MTRendering

@MainActor
public protocol MTRendering

Defines methods for adjusting rendering parameters.

  • getPixelRatio() Asynchronous

    Returns the pixel ratio currently used by the map.

    Declaration

    Swift

    @MainActor
    func getPixelRatio() async -> Double
  • setPixelRatio(_:) Asynchronous

    Sets the pixel ratio to use when rendering the map.

    Declaration

    Swift

    @MainActor
    func setPixelRatio(_ pixelRatio: Double) async

    Parameters

    pixelRatio

    Pixel ratio value to apply.

  • triggerRepaint() Asynchronous

    Trigger the rendering of a single frame. Use this method with custom layers to repaint the map when the layer changes. Calling this multiple times before the next frame is rendered will still result in only a single frame being rendered.

    Declaration

    Swift

    @MainActor
    func triggerRepaint() async
  • Displays tile boundaries on the map.

    Declaration

    Swift

    @MainActor
    func setShowTileBoundaries(_ show: Bool) async

    Parameters

    show

    A boolean value indicating whether to show tile boundaries.

  • setShowPadding(_:) Asynchronous

    Displays padding on the map.

    Declaration

    Swift

    @MainActor
    func setShowPadding(_ show: Bool) async

    Parameters

    show

    A boolean value indicating whether to show padding.

  • Displays the overdraw inspector on the map.

    Declaration

    Swift

    @MainActor
    func setShowOverdrawInspector(_ show: Bool) async

    Parameters

    show

    A boolean value indicating whether to show the overdraw inspector.

  • Displays collision boxes on the map.

    Declaration

    Swift

    @MainActor
    func setShowCollisionBoxes(_ show: Bool) async

    Parameters

    show

    A boolean value indicating whether to show collision boxes.

  • Sets the maximum number of images loaded in parallel.

    Declaration

    Swift

    @MainActor
    func setMaxParallelImageRequests(_ maxParallelImageRequests: Int) async

    Parameters

    maxParallelImageRequests

    The maximum number of images.

  • Sets the map’s RTL text plugin.

    Declaration

    Swift

    @MainActor
    func setRTLTextPlugin(pluginURL: String, deferred: Bool) async

    Parameters

    pluginURL

    URL pointing to the Mapbox RTL text plugin source.

    deferred

    A boolean indicating if the plugin evaluation should be deferred.