DashRepresentation

public class DashRepresentation : MapPolyline.Representation

Represents a dash pattern for map polyline where the dash can be rendered as a colored line and the gap can be either empty or colored.

The length of the dash and gap are set independently, allowing for patterns like ' — — — —' (dash length = gap length) or ' ——— ——— ———' (dash length != gap length).

  • Creates a representation for a dashed line. Gaps are not displayed.

    At map measures smaller than the smallest map measure in the lineWidth, dashLength and gapLength, the value used for rendering is constant and equal to the value given for the smallest map measure in the respective MapMeasureDependentRenderSize object.

    At map measures bigger than the biggest map measure in the lineWidth, dashLength and gapLength, the value used for rendering is constant and equal to the value given for the biggest map measure in the respective MapMeasureDependentRenderSize object.

    At map measures between two nearest given map measures, the values are linearly interpolated between values given for these map measures.

    For MapMeasure.Kind only MapMeasure.Kind.zoomLevel is supported.

    For RenderSize.Unit only RenderSize.Unit.pixels is supported.

    All sizes must not be 0 (MapMeasureDependentRenderSize.sizes with all values set to 0.0).

    Throws

    MapPolyline.Representation.InstantiationError In case of invalid input parameters.

    Declaration

    Swift

    public init(lineWidth: MapMeasureDependentRenderSize, dashLength: MapMeasureDependentRenderSize, gapLength: MapMeasureDependentRenderSize, dashColor: UIColor) throws

    Parameters

    lineWidth

    The width of the polyline depending on the map measure.

    dashLength

    The dash length of the polyline depending on the map measure.

    gapLength

    The gap length of the polyline depending on the map measure.

    dashColor

    The dash color of the polyline.

  • Creates a representation for a dashed line with both dash and the gap being colored.

    At map measures smaller than the smallest map measure in the lineWidth, dashLength and gapLength, the value used for rendering is constant and equal to the value given for the smallest map measure in the respective MapMeasureDependentRenderSize object.

    At map measures bigger than the biggest map measure in the lineWidth, dashLength and gapLength, the value used for rendering is constant and equal to the value given for the biggest map measure in the respective MapMeasureDependentRenderSize object.

    At map measures between two nearest given map measures, the values are linearly interpolated between values given for these map measures.

    For MapMeasure.Kind only MapMeasure.Kind.zoomLevel is supported.

    For RenderSize.Unit only RenderSize.Unit.pixels is supported.

    All sizes must not be 0 (MapMeasureDependentRenderSize.sizes with all values set to 0.0).

    Throws

    MapPolyline.Representation.InstantiationError In case of invalid input parameters.

    Declaration

    Swift

    public init(lineWidth: MapMeasureDependentRenderSize, dashLength: MapMeasureDependentRenderSize, gapLength: MapMeasureDependentRenderSize, dashColor: UIColor, gapColor: UIColor) throws

    Parameters

    lineWidth

    The width of the polyline depending on the map measure.

    dashLength

    The dash length of the polyline depending on the map measure.

    gapLength

    The gap length of the polyline depending on the map measure.

    dashColor

    The color of the dashes.

    gapColor

    The color of the gaps.

  • The width of the polyline depending on the map measure. At map measures smaller than smallest map measure in the lineWidth line width is constant and equal to the width given for the smallest map measure in the lineWidth.

    At map measures bigger than biggest map measure in the lineWidth line width is constant and equal to the width given for the biggest map measure in the lineWidth.

    At map measures between two nearest given map measures, the values are linearly interpolated between values given for these map measures.

    Declaration

    Swift

    public var lineWidth: MapMeasureDependentRenderSize { get }
  • The dash length of the polyline depending on the map measure. At map measures smaller than smallest map measure in the dashLength line width is constant and equal to the width given for the smallest map measure in the dashLength.

    At map measures bigger than biggest map measure in the dashLength line width is constant and equal to the width given for the biggest map measure in the dashLength.

    At map measures between two nearest given map measures, the values are linearly interpolated between values given for these map measures.

    Declaration

    Swift

    public var dashLength: MapMeasureDependentRenderSize { get }
  • The gap length of the polyline depending on the map measure. At map measures smaller than smallest map measure in the gapLength line width is constant and equal to the width given for the smallest map measure in the gapLength.

    At map measures bigger than biggest map measure in the gapLength line width is constant and equal to the width given for the biggest map measure in the gapLength.

    At map measures between two nearest given map measures, the values are linearly interpolated between values given for these map measures.

    Declaration

    Swift

    public var gapLength: MapMeasureDependentRenderSize { get }
  • The color of the dashes of the polyline.

    Declaration

    Swift

    public var dashColor: UIColor { get }
  • The color for the gaps of the polyline. The default value is nil and no color is used.

    Declaration

    Swift

    public var gapColor: UIColor? { get }