Class MapPolyline.SolidRepresentation

Enclosing class:
MapPolyline

public static final class MapPolyline.SolidRepresentation extends MapPolyline.Representation

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.

  • 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 lineWidth line width is constant and equal to the width given for the smallest map measure in the lineWidth.

      At map measures bigger than biggest map measure in the lineWidth line width is constant and equal to the width given for the biggest map measure in the lineWidth.

      At map measures between two nearest given map measures line width is linearly interpolated between width values given for these map measures.

      For MapMeasure.Kind only MapMeasure.Kind.ZOOM_LEVEL is supported.

      For RenderSize.Unit only RenderSize.Unit.PIXELS is supported.

      lineWidth must not be 0 (lineWidth.sizes with 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 lineWidth and outlineWidth, the value is constant and equal to the width given for the smallest map measure in the lineWidth and outlineWidth.

      At map measures bigger than biggest map measure in the lineWidth and outlineWidth, the value is constant and equal to the width given for the biggest map measure in the lineWidth and outlineWidth.

      At map measures between two nearest given map measure is linearly interpolated between width values given for these map measures.

      For MapMeasure.Kind only MapMeasure.Kind.ZOOM_LEVEL is supported.

      For RenderSize.Unit only RenderSize.Unit.PIXELS is supported.

      lineWidth must not be 0 (lineWidth.sizes with 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

      @NonNull public MapMeasureDependentRenderSize getLineWidth()

      Gets the map measure dependent polyline width.

      At map measures smaller than smallest map measure in the lineWidth line width is constant and equal to the width given for the smallest map measure in the lineWidth.

      At map measures bigger than biggest map measure in the lineWidth line width is constant and equal to the width given for the biggest map measure in the lineWidth.

      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

      @NonNull public Color getLineColor()

      Gets the color of the polyline.

      Returns:

      The color of the polyline.

    • getOutlineWidth

      @NonNull public MapMeasureDependentRenderSize 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 the outlineWidth.

      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 the outlineWidth.

      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

      @NonNull public Color getOutlineColor()

      Gets the color of outline of the polyline.

      Returns:

      The outline color of the polyline.

    • getCapShape

      @NonNull public LineCap 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.