MapPolyline.DashImageRepresentation (API Reference)
Class MapPolyline.DashImageRepresentation
- Enclosing class:
- MapPolyline
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 getDashImage() is stretched according to getDashLength()
and getDashWidth(), 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 getGapLength().
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.here.sdk.mapview.MapPolyline.Representation
MapPolyline.Representation.InstantiationErrorCode, MapPolyline.Representation.InstantiationException -
Constructor Summary
ConstructorsConstructorDescriptionDashImageRepresentation(MapMeasureDependentRenderSize dashLength, MapMeasureDependentRenderSize dashWidth, MapImage image) Creates a uniform dash pattern in which the length of a gap is the same as the length of a dash.DashImageRepresentation(MapMeasureDependentRenderSize dashLength, MapMeasureDependentRenderSize gapLength, MapMeasureDependentRenderSize dashWidth, MapImage image) Creates a simple dash pattern in which the lengths of a dash and gap can be different. -
Method Summary
Modifier and TypeMethodDescriptionGets the image that is rendered in place of dash space.Gets the map measure dependent length of a dash, to which image width is stretched.Gets the map measure dependent width of a dash, to which image height is stretched.Gets the map measure dependent length of a gap between dash images.
-
Constructor Details
-
DashImageRepresentation
public DashImageRepresentation(@NonNull MapMeasureDependentRenderSize dashLength, @NonNull MapMeasureDependentRenderSize dashWidth, @NonNull MapImage image) throws MapPolyline.Representation.InstantiationException 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.ZOOM_LEVELis 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.
- Parameters:
dashLength-The map measure dependent length of a dash, to which image width is stretched.
dashWidth-The map measure dependent width of a dash, to which image height is stretched.
image-Image to be rendered in place of dash space. It is stretched to match
dashWidthanddashLength.- Throws:
MapPolyline.Representation.InstantiationException-In case of invalid input parameters.
-
DashImageRepresentation
public DashImageRepresentation(@NonNull MapMeasureDependentRenderSize dashLength, @NonNull MapMeasureDependentRenderSize gapLength, @NonNull MapMeasureDependentRenderSize dashWidth, @NonNull MapImage image) throws MapPolyline.Representation.InstantiationException 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.ZOOM_LEVELis 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.
- Parameters:
dashLength-The map measure dependent length of a dash, to which image width is stretched.
gapLength-The map measure dependent length of a gap between dash images.
dashWidth-The map measure dependent width of a dash, to which image height is stretched.
image-Image to be rendered in place of dash space. It is stretched to match
dashWidthanddashLength.- Throws:
MapPolyline.Representation.InstantiationException-In case of invalid input parameters.
-
-
Method Details
-
getDashImage
Gets the image that is rendered in place of dash space.
It is stretched to fill whole polyline width and length of each dash.
- Returns:
Image to be rendered in place of dash space.
-
getDashLength
Gets the map measure dependent length of a dash, to which image width is stretched.
- Returns:
The map measure dependent length of a dash, to which image width is stretched.
-
getGapLength
Gets the map measure dependent length of a gap between dash images.
- Returns:
The map measure dependent length of a gap between dash images.
-
getDashWidth
Gets the map measure dependent width of a dash, to which image height is stretched.
- Returns:
The map measure dependent width of a dash, to which image height is stretched.
-