Class MapPolyline.DashRepresentation
Class MapPolyline.DashRepresentation
- java.lang.Object
-
- com.here.NativeBase
-
- com.here.sdk.mapview.MapItemRepresentation
-
- com.here.sdk.mapview.MapPolyline.Representation
-
- com.here.sdk.mapview.MapPolyline.DashRepresentation
-
- Enclosing class:
- MapPolyline
public static final class MapPolyline.DashRepresentation extends 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).
-
-
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 DashRepresentation(MapMeasureDependentRenderSize lineWidth, MapMeasureDependentRenderSize dashLength, MapMeasureDependentRenderSize gapLength, Color dashColor)Creates a representation for a dashed line.DashRepresentation(MapMeasureDependentRenderSize lineWidth, MapMeasureDependentRenderSize dashLength, MapMeasureDependentRenderSize gapLength, Color dashColor, Color gapColor)Creates a representation for a dashed line with both dash and the gap being colored.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ColorgetDashColor()Gets the color of the dashes of the polyline.MapMeasureDependentRenderSizegetDashLength()Gets the map measure dependent polyline dash length.ColorgetGapColor()Gets the color for the gaps of the polyline.MapMeasureDependentRenderSizegetGapLength()Gets the map measure dependent polyline gap length.MapMeasureDependentRenderSizegetLineWidth()Gets the map measure dependent polyline width.
-
-
-
Constructor Detail
-
DashRepresentation
public DashRepresentation(@NonNull MapMeasureDependentRenderSize lineWidth, @NonNull MapMeasureDependentRenderSize dashLength, @NonNull MapMeasureDependentRenderSize gapLength, @NonNull Color dashColor) throws MapPolyline.Representation.InstantiationExceptionCreates a representation for a dashed line. Gaps are not displayed.
At map measures smaller than the smallest map measure in the
lineWidth,dashLengthandgapLength, the value used for rendering is constant and equal to the value given for the smallest map measure in the respectiveMapMeasureDependentRenderSizeobject.At map measures bigger than the biggest map measure in the
lineWidth,dashLengthandgapLength, the value used for rendering is constant and equal to the value given for the biggest map measure in the respectiveMapMeasureDependentRenderSizeobject.At map measures between two nearest given map measures, the values are linearly interpolated between values given for these map measures.
For
MapMeasure.KindonlyMapMeasure.Kind.ZOOM_LEVELis supported.For
RenderSize.UnitonlyRenderSize.Unit.PIXELSis supported.All sizes must not be 0 (
MapMeasureDependentRenderSize.sizeswith all values set to 0.0).- 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.
- Throws:
MapPolyline.Representation.InstantiationException-In case of invalid input parameters.
-
DashRepresentation
public DashRepresentation(@NonNull MapMeasureDependentRenderSize lineWidth, @NonNull MapMeasureDependentRenderSize dashLength, @NonNull MapMeasureDependentRenderSize gapLength, @NonNull Color dashColor, @NonNull Color gapColor) throws MapPolyline.Representation.InstantiationExceptionCreates 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,dashLengthandgapLength, the value used for rendering is constant and equal to the value given for the smallest map measure in the respectiveMapMeasureDependentRenderSizeobject.At map measures bigger than the biggest map measure in the
lineWidth,dashLengthandgapLength, the value used for rendering is constant and equal to the value given for the biggest map measure in the respectiveMapMeasureDependentRenderSizeobject.At map measures between two nearest given map measures, the values are linearly interpolated between values given for these map measures.
For
MapMeasure.KindonlyMapMeasure.Kind.ZOOM_LEVELis supported.For
RenderSize.UnitonlyRenderSize.Unit.PIXELSis supported.All sizes must not be 0 (
MapMeasureDependentRenderSize.sizeswith all values set to 0.0).- 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.
- Throws:
MapPolyline.Representation.InstantiationException-In case of invalid input parameters.
-
-
Method Detail
-
getLineWidth
@NonNull public MapMeasureDependentRenderSize getLineWidth()
Gets the map measure dependent polyline width.
At map measures smaller than smallest map measure in the
lineWidthline width is constant and equal to the width given for the smallest map measure in thelineWidth.At map measures bigger than biggest map measure in the
lineWidthline width is constant and equal to the width given for the biggest map measure in thelineWidth.At map measures between two nearest given map measures, the values are linearly interpolated between values given for these map measures.
- Returns:
The width of the polyline depending on the map measure.
-
getDashLength
@NonNull public MapMeasureDependentRenderSize getDashLength()
Gets the map measure dependent polyline dash length.
At map measures smaller than smallest map measure in the
dashLengthline width is constant and equal to the width given for the smallest map measure in thedashLength.At map measures bigger than biggest map measure in the
dashLengthline width is constant and equal to the width given for the biggest map measure in thedashLength.At map measures between two nearest given map measures, the values are linearly interpolated between values given for these map measures.
- Returns:
The dash length of the polyline depending on the map measure.
-
getGapLength
@NonNull public MapMeasureDependentRenderSize getGapLength()
Gets the map measure dependent polyline gap length.
At map measures smaller than smallest map measure in the
gapLengthline width is constant and equal to the width given for the smallest map measure in thegapLength.At map measures bigger than biggest map measure in the
gapLengthline width is constant and equal to the width given for the biggest map measure in thegapLength.At map measures between two nearest given map measures, the values are linearly interpolated between values given for these map measures.
- Returns:
The gap length of the polyline depending on the map measure.
-
getDashColor
@NonNull public Color getDashColor()
Gets the color of the dashes of the polyline.
- Returns:
The color of the dashes of the polyline.
-
getGapColor
@Nullable public Color getGapColor()
Gets the color for the gaps of the polyline. Returns
nullif no color is used.- Returns:
The color for the gaps of the polyline. The default value is
nulland no color is used.
-
-