MapPolyline.DashRepresentation (API Reference)
Class MapPolyline.DashRepresentation
- Enclosing class:
- MapPolyline
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
ConstructorsConstructorDescriptionDashRepresentation(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
Modifier and TypeMethodDescriptionGets the color of the dashes of the polyline.Gets the map measure dependent polyline dash length.Gets the color for the gaps of the polyline.Gets the map measure dependent polyline gap length.Gets the map measure dependent polyline width.
-
Constructor Details
-
DashRepresentation
public DashRepresentation(@NonNull MapMeasureDependentRenderSize lineWidth, @NonNull MapMeasureDependentRenderSize dashLength, @NonNull MapMeasureDependentRenderSize gapLength, @NonNull Color dashColor) throws MapPolyline.Representation.InstantiationException Creates 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.InstantiationException Creates 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 Details
-
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
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
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
Gets the color of the dashes of the polyline.
- Returns:
The color of the dashes of the polyline.
-
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.
-