PolygonOverlay

public class PolygonOverlay : Annotation

A polygon overlay can be built by setting the outer area color and adding inner polygons. Only one inner polygon is supported, but the inner polygons can be nested. Example:

   let innerOptions = InnerPolygonOptions(fillColor: .red
                                      coordinates: coordinates)

   innerOptions.nestedPolygonOptions = InnerPolygonOptions(
       fillColor: UIColor.blue,
       coordinates: coordinates
   )

   let polygonOptions = PolygonOverlayOptions(outerColor: .green,
                                          innerPolygonOptions: innerOptions)

   try? mapView.map.addPolygonOverlay(options: polygonOptions)

}

Important

This is a Public Preview API. It may be changed or removed at any time.

Public

  • The unique annotation id.

    Declaration

    Swift

    public let annotationID: String
  • tag

    PolygonOverlay tag

    Declaration

    Swift

    public var tag: String?
  • Color that will be used to fill outer area of the polygon.

    Declaration

    Swift

    public let outerColor: PolygonOverlayOptions.Color
  • Declaration

    Swift

    public var isSelectable: Bool