---
title: "MTPolygonLayerHelper | Mobile sdk | Mobile sdk ios | Ios"
description: "Helper for creating a polygon (fill) visualization layer from data and styling options."
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# MTPolygonLayerHelper

```
public final class MTPolygonLayerHelper : MTVectorLayerHelper, @unchecked Sendable
```

Helper for creating a polygon (fill) visualization layer from data and styling options.

-   `[style](#/s:11MapTilerSDK20MTPolygonLayerHelperC5styleAA7MTStyleCvp)`
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    public var style: MTStyle { get }
    ```
    
-   `[init(_:)](#/s:11MapTilerSDK20MTPolygonLayerHelperCyAcA7MTStyleCcfc)`
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    public init(_ style: MTStyle)
    ```
    
-   `[addPolygon(_:completionHandler:)](#/s:11MapTilerSDK20MTPolygonLayerHelperC10addPolygon_17completionHandleryAA0dE7OptionsV_ys6ResultOyAA0deL0VAA7MTErrorOGcSgtF)`
    
    Adds a polygon layer based on the provided options.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func addPolygon(
        _ options: MTPolygonLayerOptions,
        completionHandler: ((Result<MTPolygonLayerResult, MTError>) -> Void)? = nil
    )
    ```
    
-   `[addPolygon(_:)](#/s:11MapTilerSDK20MTPolygonLayerHelperC10addPolygonyAA0dE6ResultVAA0dE7OptionsVYaKF)` Asynchronous
    
    Adds a polygon layer based on the provided options (async).
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func addPolygon(
        _ options: MTPolygonLayerOptions
    ) async throws -> MTPolygonLayerResult
    ```
    
-   `[removePolygon(result:completionHandler:)](#/s:11MapTilerSDK20MTPolygonLayerHelperC13removePolygon6result17completionHandleryAA0dE6ResultV_ys0L0OyytAA7MTErrorOGcSgtF)`
    
    Removes the layers and source created by the `addPolygon` helper
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func removePolygon(
        result: MTPolygonLayerResult,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )
    ```
    
-   `[removePolygon(result:)](#/s:11MapTilerSDK20MTPolygonLayerHelperC13removePolygon6resultyAA0dE6ResultV_tYaKF)` Asynchronous
    
    Removes the layers and source created by the `addPolygon` helper
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func removePolygon(result: MTPolygonLayerResult) async throws
    ```
