Class MapPolyline.DashImageRepresentation
Class MapPolyline.DashImageRepresentation
- java.lang.Object
-
- com.here.NativeBase
-
- com.here.sdk.mapview.MapItemRepresentation
-
- com.here.sdk.mapview.MapPolyline.Representation
-
- com.here.sdk.mapview.MapPolyline.DashImageRepresentation
-
- Enclosing class:
- MapPolyline
public static final class MapPolyline.DashImageRepresentation extends 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
getDashImage()is stretched according togetDashLength()andgetDashWidth(), with image's width matched todashLengthand image's height matched todashWidth. The image is oriented so that its bottom is on the left-hand side between verticesnandn+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
Constructors Constructor Description DashImageRepresentation(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MapImagegetDashImage()Gets the image that is rendered in place of dash space.MapMeasureDependentRenderSizegetDashLength()Gets the map measure dependent length of a dash, to which image width is stretched.MapMeasureDependentRenderSizegetDashWidth()Gets the map measure dependent width of a dash, to which image height is stretched.MapMeasureDependentRenderSizegetGapLength()Gets the map measure dependent length of a gap between dash images.
-
-
-
Constructor Detail
-
DashImageRepresentation
public DashImageRepresentation(@NonNull MapMeasureDependentRenderSize dashLength, @NonNull MapMeasureDependentRenderSize dashWidth, @NonNull MapImage image) throws MapPolyline.Representation.InstantiationExceptionCreates 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.InstantiationExceptionCreates 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 Detail
-
getDashImage
@NonNull public MapImage 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
@NonNull public MapMeasureDependentRenderSize 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
@NonNull public MapMeasureDependentRenderSize 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
@NonNull public MapMeasureDependentRenderSize 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.
-
-