DashImageRepresentation
public class DashImageRepresentation : MapPolyline.Representation
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.
-
Creates a uniform dash pattern in which the length of a gap is the same as the length of a dash. Dashes are rendered as image.
This allows for patterns like
' — — — —'or' —— —— ——'.For
MapMeasureDependentRenderSizesupplied fordashLengthanddashWidth, onlyMapMeasure.Kind.zoomLevelis supported forMapMeasureDependentRenderSize.measureKindand onlyRenderSize.Unit.metersis supported forMapMeasureDependentRenderSize.sizeUnit.Only map measure values in range [3-19] are supported.
The value of the keys in
MapMeasureDependentRenderSize.sizesis truncated to integer values, hence only a single value can be provided per zoom level.The values are interpolated linearly between zoom levels.
Throws
MapPolyline.Representation.InstantiationErrorIn case of invalid input parameters.Declaration
Swift
public init(dashLength: MapMeasureDependentRenderSize, dashWidth: MapMeasureDependentRenderSize, image: MapImage) throwsParameters
dashLengthThe map measure dependent length of a dash, to which image width is stretched.
dashWidthThe map measure dependent width of a dash, to which image height is stretched.
imageImage to be rendered in place of dash space. It is stretched to match
dashWidthanddashLength. -
Creates a simple dash pattern in which the lengths of a dash and gap can be different. Dashes are rendered as image.
This allows for patterns like
' — — — —'or' ——— ——— ———'.For
MapMeasureDependentRenderSizesupplied fordashLength,gapLengthanddashWidth, onlyMapMeasure.Kind.zoomLevelis supported forMapMeasureDependentRenderSize.measureKindand onlyRenderSize.Unit.metersis supported forMapMeasureDependentRenderSize.sizeUnit.Only map measure values in range [3-19] are supported.
The value of the keys in
MapMeasureDependentRenderSize.sizesis truncated to integer values, hence only a single value can be provided per zoom level.The values are interpolated linearly between zoom levels.
Throws
MapPolyline.Representation.InstantiationErrorIn case of invalid input parameters.Declaration
Swift
public init(dashLength: MapMeasureDependentRenderSize, gapLength: MapMeasureDependentRenderSize, dashWidth: MapMeasureDependentRenderSize, image: MapImage) throwsParameters
dashLengthThe map measure dependent length of a dash, to which image width is stretched.
gapLengthThe map measure dependent length of a gap between dash images.
dashWidthThe map measure dependent width of a dash, to which image height is stretched.
imageImage to be rendered in place of dash space. It is stretched to match
dashWidthanddashLength. -
Image to be rendered in place of dash space. It is stretched to fill whole polyline width and length of each dash.
Declaration
Swift
public var dashImage: MapImage { get } -
The map measure dependent length of a dash, to which image width is stretched.
Declaration
Swift
public var dashLength: MapMeasureDependentRenderSize { get } -
The map measure dependent length of a gap between dash images.
Declaration
Swift
public var gapLength: MapMeasureDependentRenderSize { get } -
The map measure dependent width of a dash, to which image height is stretched.
Declaration
Swift
public var dashWidth: MapMeasureDependentRenderSize { get }