MapPolyline

public class MapPolyline
extension MapPolyline: NativeBase
extension MapPolyline: Hashable

A visual representation of a line on the map.

The geometry to be visualized is represented by an instance of GeoPolyline.

Altitude component of GeoPolyline‘s vertices is ignored.

  • Creates a new MapPolyline instance with a specified visual representation.

    Altitude component of GeoPolyline‘s vertices is ignored.

    After creating a MapPolyline with this representation, the deprecated MapPolyline properties do not work and any change to them will be ignored. Any modifications to polyline’s appearance must be done with MapPolyline.setRepresentation(...).

    Declaration

    Swift

    public init(geometry: GeoPolyline, representation: MapPolyline.Representation)

    Parameters

    geometry

    The list of vertices representing the polyline.

    representation

    The styling properties of the polyline.

  • The list of vertices that represent the geometry of the polyline. Altitude component of GeoPolyline‘s vertices is ignored.

    Declaration

    Swift

    public var geometry: GeoPolyline { get set }
  • The Metadata instance attached to this polyline. This will be nil if nothing has been attached before.

    Declaration

    Swift

    public var metadata: Metadata? { get set }
  • The draw order of the polyline. Polylines with a higher draw order are drawn on top of polylines with a lower draw order.

    In case multiple polylines have the same draw order, they can be rendered in different ways depending on the MapPolyline.drawOrderType set.

    The value is clamped to the range [0; 1023]. The default draw order is 0.

    Declaration

    Swift

    public var drawOrder: Int32 { get set }
  • The draw order type of the polyline. The default value is DrawOrderType.mapSceneAdditionOrderDependent.

    For DrawOrderType.mapSceneAdditionOrderDependent, map polylines with outlines having the same draw order are drawn as a whole in the order of addition to a map scene. There is no possibility that parts of another polyline, regardless of its draw order value, are drawn between outline and mainline of another polyline.

    With DrawOrderType.mapSceneAdditionOrderDependent polylines are rendered one by one. For DrawOrderType.mapSceneAdditionOrderIndependent for multiple polylines with outlines having the same draw order, all outlines are rendered first in an arbitrary order and then all mainlines are drawn on top of those polylines in an arbitrary order.

    DrawOrderType.mapSceneAdditionOrderIndependent allows speeding up the rendering process and keeping high frame rates when many similar polylines (with same styling attributes and MapPolyline.Representation) are present in a map scene.

    Declaration

    Swift

    public var drawOrderType: DrawOrderType { get set }
  • The list of visibility ranges. The map polyline is visible only inside these map measure ranges. A range is half open - [minimumZoomLevel, maximumZoomLevel), the given maximum value is not contained in the range.

    When empty (the default), the map polyline is visible without map measure restrictions. Only MapMeasureRange(s) of MapMeasure.Kind.zoomLevel type are supported. MapMeasureRange(s) of other unsupported types will be ignored.

    Declaration

    Swift

    public var visibilityRanges: [MapMeasureRange] { get set }
  • The progress from the polyline’s starting point, as a ratio of its total length clamped to the range [0, 1]. As the progress varies, the equivalent part of the polyline gets covered by the progress color and progress outline color. The rest of the polyline until its end point retains the line color and outline color along with an optional dash pattern.

    The default progress is 0.

    Declaration

    Swift

    public var progress: Double { get set }
  • The color used for the progress part of the polyline. The default progress color is opaque white.

    Declaration

    Swift

    public var progressColor: UIColor { get set }
  • The color used for outline of the progress part of the polyline. The default progress color is opaque white.

    Declaration

    Swift

    public var progressOutlineColor: UIColor { get set }
  • The maximum gradient length between MapPolyline.lineColor' and 'MapPolyline.progressColor in zoom level dependent pixels. To achieve a constant gradient length, use MapMeasureDependentRenderSize with a single value. To achieve a gradient length dependent on map zoom, use MapMeasureDependentRenderSize with multiple values. The default value is a constant gradient length of zero pixels. The gradient is guaranteed to fit into polyline, i.e. the actual gradient can be shorter then progressGradientLength.

    For MapMeasure.Kind only MapMeasure.Kind.zoomLevel is supported. For RenderSize.Unit only RenderSize.Unit.pixels is supported. When setting the attribute with with unsupported values, the operation is ignored.

    Declaration

    Swift

    public var progressGradientLength: MapMeasureDependentRenderSize { get set }
  • List of map content categories this polyline should block. Map content categories overlapping the polyline geometry (progress and non-progress) will be discarded from being rendered.

    Duplicate entries will be ignored and will have no additional effect.

    Default value is an empty list meaning none of the map categories will be blocked.

    Declaration

    Swift

    public var mapContentCategoriesToBlock: [MapContentCategory] { get set }
  • Base class to represent the visual appearance of a MapPolyline.

    See more

    Declaration

    Swift

    public class Representation : MapItemRepresentation
  • Represents a dash pattern for the map polyline consisting of images rendered with certain gaps from each other.

    This dash pattern representation consists only of images rendered at certain points along the polyline. For rendering them without any distortions, polyline gets sliced into series of straight segments that are multiple of sum of dash and gap lengths. For this reason, the new polyline geometry might not align fully with original geometry.

    The MapPolyline.DashImageRepresentation.dashImage is stretched according to MapPolyline.DashImageRepresentation.dashLength and MapPolyline.DashImageRepresentation.dashWidth, with image’s width matched to dashLength and image’s height matched to dashWidth. The image is oriented so that its bottom is on the left-hand side between vertices n and n+1.

    The spacing between images is specified by MapPolyline.DashImageRepresentation.gapLength.

    Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.

    See more

    Declaration

    Swift

    public class DashImageRepresentation : MapPolyline.Representation
  • Representation for a solid line without outline.

    Can represent polylines that have constant width or width dependent on the map zoom.

    To achieve constant width lines, use MapMeasureDependentRenderSize with a single value.

    To achieve line width dependent on map zoom, use MapMeasureDependentRenderSize with multiple values.

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

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

    See more

    Declaration

    Swift

    public class SolidRepresentation : 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).

    See more

    Declaration

    Swift

    public class DashRepresentation : MapPolyline.Representation
  • Changes the appearance of the MapPolyline instance.

    Declaration

    Swift

    public func setRepresentation(_ representation: MapPolyline.Representation)

    Parameters

    representation

    The representation describing a new appearance of the MapPolyline.

  • Starts an animation of this map polyline.

    The MapPolylineAnimation may be shared between multiple instances of MapPolyline.

    Starting animation on one polyline does not influence any ongoing animations on other polylines. Any ongoing animation of this map polyline will get cancelled.

    Declaration

    Swift

    public func startAnimation(_ animation: MapPolylineAnimation, animationDelegate: AnimationDelegate)

    Parameters

    animation

    The animation to start.

    animationDelegate

    The delegate to receive notifications about animation start, completion or cancellation.

  • Cancels single ongoing animation of this map polyline.

    Does nothing if the specified animation is not currently in progress for this polyline. Does not affect other polylines that might be running this animation.

    Declaration

    Swift

    public func cancelAnimation(_ animation: MapPolylineAnimation)

    Parameters

    animation

    The animation to cancel