Interface ColoredPolylineMapObject

com.yandex.mapkit.map

public interface ColoredPolylineMapObject extends MapObject

All Superinterfaces:
MapObject

A colored polyline object.

Methods

Arrow addArrow(@NonNull PolylinePosition position, float length, int fillColor)

Adds an arrow.

void addArrowTapListener(@NonNull ArrowTapListener tapListener)

Adds a tap listener for arrows.

List< Arrow > arrows()

Provides arrows.

float getArcApproximationStep()

Defines step of arc approximation.

Polyline getGeometry()

Provides the geometry.

float getGradientLength()

Maximum length (in units) of the gradient from one color to another.

int getOutlineColor()

The outline color.

float getOutlineWidth()

Width of the outline in units.

float getStrokeWidth()

The stroke width in units.

float getTurnRadius()

Maximum radius of a turn.

void hide(@NonNull Subpolyline subpolyline)

Hides the subpolyline, canceling any previous hides.

void hide(@NonNull List< Subpolyline > subpolylines)

Hides multiple subpolylines, canceling any previous hides.

boolean isInnerOutlineEnabled()

Enables the inner outline if true (a dark border along the edge of the outline).

void removeArrowTapListener(@NonNull ArrowTapListener tapListener)

Removes the tap listener for arrows.

void select(int selectionColor, @NonNull Subpolyline subpolyline)

Selects subpolyline by color.

void setArcApproximationStep(float arcApproximationStep)
void setColors(@NonNull List< Integer > colors, @NonNull List< Double > weights)

Sets indexes of colors in palette for line segments.

void setColors(@NonNull List< Integer > colors)

Sets indexes of colors in palette for line segments.

void setGeometry(@NonNull Polyline geometry)
void setGradientLength(float gradientLength)
void setInnerOutlineEnabled(boolean innerOutlineEnabled)
void setOutlineColor(int outlineColor)
void setOutlineWidth(float outlineWidth)
void setPaletteColor(int colorIndex, int color)

Sets color in RGBA mode for colorIndex.

void setStrokeWidth(float strokeWidth)
void setTurnRadius(float turnRadius)

Method Detail

addArrow

public Arrow addArrow (@NonNull PolylinePosition position, float length, int fillColor)

Adds an arrow.

Parameters:
position

Coordinates of the center of the arrow.

length

Overall length of the arrow (including the tip) in units.

fillColor

Color of the arrow.

addArrowTapListener

public void addArrowTapListener (@NonNull ArrowTapListener tapListener)

Adds a tap listener for arrows.

arrows

public List< Arrow > arrows ()

Provides arrows.

getArcApproximationStep

public float getArcApproximationStep ()

Defines step of arc approximation.

Smaller values make polyline smoother. Measured in degrees. Default: 12.

getGeometry

public Polyline getGeometry ()

Provides the geometry.

getGradientLength

public float getGradientLength ()

Maximum length (in units) of the gradient from one color to another.

Default: 0.

getOutlineColor

public int getOutlineColor ()

The outline color.

Default: white.

getOutlineWidth

public float getOutlineWidth ()

Width of the outline in units.

Default: 2.

getStrokeWidth

public float getStrokeWidth ()

The stroke width in units.

Default: 5. The size of a unit is equal to the size of a pixel at the current zoom level when the camera position's tilt is equal to 0 and the scale factor is equal to 1.

getTurnRadius

public float getTurnRadius ()

Maximum radius of a turn.

Measured in units. Default: 10.

hide

public void hide (@NonNull Subpolyline subpolyline)

Hides the subpolyline, canceling any previous hides.

hide

public void hide (@NonNull List< Subpolyline > subpolylines)

Hides multiple subpolylines, canceling any previous hides.

isInnerOutlineEnabled

public boolean isInnerOutlineEnabled ()

Enables the inner outline if true (a dark border along the edge of the outline).

Default: true.

removeArrowTapListener

public void removeArrowTapListener (@NonNull ArrowTapListener tapListener)

Removes the tap listener for arrows.

select

public void select (int selectionColor, @NonNull Subpolyline subpolyline)

Selects subpolyline by color.

setArcApproximationStep

public void setArcApproximationStep (float arcApproximationStep)

setColors

public void setColors (@NonNull List< Integer > colors, @NonNull List< Double > weights)

Sets indexes of colors in palette for line segments.

Weights are used for generalization of colors.

setColors

public void setColors (@NonNull List< Integer > colors)

Sets indexes of colors in palette for line segments.

All the weights are equal to 1.

setGeometry

public void setGeometry (@NonNull Polyline geometry)

setGradientLength

public void setGradientLength (float gradientLength)

setInnerOutlineEnabled

public void setInnerOutlineEnabled (boolean innerOutlineEnabled)

setOutlineColor

public void setOutlineColor (int outlineColor)

setOutlineWidth

public void setOutlineWidth (float outlineWidth)

setPaletteColor

public void setPaletteColor (int colorIndex, int color)

Sets color in RGBA mode for colorIndex.

If the color is not provided for some index, the default value 0xffffffff is used.

setStrokeWidth

public void setStrokeWidth (float strokeWidth)

setTurnRadius

public void setTurnRadius (float turnRadius)