MapPolyline.SolidRepresentation (API Reference)
Class MapPolyline.SolidRepresentation
- Enclosing class:
- MapPolyline
Representation for a solid line without outline.
Can represent polylines that have constant width or width dependent on the map zoom.
To achieve constant width lines, use MapMeasureDependentRenderSize with a single value.
To achieve line width dependent on map zoom, use MapMeasureDependentRenderSize with
multiple values.
For MapMeasure.Kind only MapMeasure.Kind.ZOOM_LEVEL is supported.
For RenderSize.Unit only RenderSize.Unit.PIXELS is supported.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.here.sdk.mapview.MapPolyline.Representation
MapPolyline.Representation.InstantiationErrorCode, MapPolyline.Representation.InstantiationException -
Constructor Summary
ConstructorsConstructorDescriptionSolidRepresentation(MapMeasureDependentRenderSize lineWidth, Color color, LineCap capShape) Creates a representation for a solid line without outline.SolidRepresentation(MapMeasureDependentRenderSize lineWidth, Color color, MapMeasureDependentRenderSize outlineWidth, Color outlineColor, LineCap capShape) Creates a representation for a solid line with outline. -
Method Summary
Modifier and TypeMethodDescriptionReturns the cap shape of the polyline and its outline.Gets the color of the polyline.Gets the map measure dependent polyline width.Gets the color of outline of the polyline.Gets the map measure dependent polyline outline width.
-
Constructor Details
-
SolidRepresentation
public SolidRepresentation(@NonNull MapMeasureDependentRenderSize lineWidth, @NonNull Color color, @NonNull LineCap capShape) throws MapPolyline.Representation.InstantiationException Creates a representation for a solid line without outline.
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 line width is linearly interpolated between width values given for these map measures.
For
MapMeasure.KindonlyMapMeasure.Kind.ZOOM_LEVELis supported.For
RenderSize.UnitonlyRenderSize.Unit.PIXELSis supported.lineWidthmust not be 0 (lineWidth.sizeswith all values set to 0.0).- Parameters:
lineWidth-The width of the polyline depending on the map measure.
color-The color of the polyline.
capShape-The cap shape applied to both ends of the polyline.
- Throws:
MapPolyline.Representation.InstantiationException-In case of invalid input parameters.
-
SolidRepresentation
public SolidRepresentation(@NonNull MapMeasureDependentRenderSize lineWidth, @NonNull Color color, @NonNull MapMeasureDependentRenderSize outlineWidth, @NonNull Color outlineColor, @NonNull LineCap capShape) throws MapPolyline.Representation.InstantiationException Creates a representation for a solid line with outline.
The total width of the polyline is
line width + 2 * outline width.At map measures smaller than smallest map measure in the
lineWidthandoutlineWidth, the value is constant and equal to the width given for the smallest map measure in thelineWidthandoutlineWidth.At map measures bigger than biggest map measure in the
lineWidthandoutlineWidth, the value is constant and equal to the width given for the biggest map measure in thelineWidthandoutlineWidth.At map measures between two nearest given map measure is linearly interpolated between width values given for these map measures.
For
MapMeasure.KindonlyMapMeasure.Kind.ZOOM_LEVELis supported.For
RenderSize.UnitonlyRenderSize.Unit.PIXELSis supported.lineWidthmust not be 0 (lineWidth.sizeswith all values set to 0.0).- Parameters:
lineWidth-The width of the polyline depending on the map measure.
color-The color of the polyline.
outlineWidth-The width of the outline on one side of the polyline depending on the map measure.
outlineColor-The outline color of the polyline.
capShape-The cap shape applied to both ends of the polyline.
- 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.
-
getLineColor
Gets the color of the polyline.
- Returns:
The color of the polyline.
-
getOutlineWidth
Gets the map measure dependent polyline outline width.
The total width of the polyline is
line width + 2 * outline width.At map measures smaller than smallest map measure in the
outlineWidth, outline width is constant and equal to the width given for the smallest map measure in theoutlineWidth.At map measures bigger than biggest map measure in the
outlineWidth, outline width is constant and equal to the width given for the biggest map measure in theoutlineWidth.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 outline on one side of the polyline depending on the map measure.
-
getOutlineColor
Gets the color of outline of the polyline.
- Returns:
The outline color of the polyline.
-
getCapShape
Returns the cap shape of the polyline and its outline.
- Returns:
The cap shape applied to both ends of the polyline and its outline.
-