- All Superinterfaces:
- Summary
- Methods
- getGeometry
- setGeometry
- getStrokeWidth
- setStrokeWidth
- getGradientLength
- setGradientLength
- getOutlineColor
- setOutlineColor
- getOutlineWidth
- setOutlineWidth
- isInnerOutlineEnabled
- setInnerOutlineEnabled
- getTurnRadius
- setTurnRadius
- getArcApproximationStep
- setArcApproximationStep
- getDashLength
- setDashLength
- getGapLength
- setGapLength
- getDashOffset
- setDashOffset
- select
- hide
- hide
- setStrokeColors
- setStrokeColors
- setPaletteColor
- getPaletteColor
- setStrokeColor
- getStrokeColor
- addArrow
- arrows
Package com.yandex.mapkit.map
Interface PolylineMapObject
All Superinterfaces:
interface PolylineMapObject extends MapObject
A polyline object with adjustable segment colors.
Supports outlines, dash, arrows, and hiding parts of the polyline efficiently.
Summary
Methods
Type and modifiers |
Method and Description |
getGeometry() |
|
void |
setGeometry(@NonNull Polyline geometry) |
float |
getStrokeWidth() |
void |
setStrokeWidth(float strokeWidth) |
float |
getGradientLength() |
void |
setGradientLength(float gradientLength) |
int |
getOutlineColor() |
void |
setOutlineColor(int outlineColor) |
float |
getOutlineWidth() |
void |
setOutlineWidth(float outlineWidth) |
boolean |
isInnerOutlineEnabled() |
void |
setInnerOutlineEnabled(boolean innerOutlineEnabled) |
float |
getTurnRadius() |
void |
setTurnRadius(float turnRadius) |
float |
getArcApproximationStep() |
void |
setArcApproximationStep(float arcApproximationStep) |
float |
getDashLength() |
void |
setDashLength(float dashLength) |
float |
getGapLength() |
void |
setGapLength(float gapLength) |
float |
getDashOffset() |
void |
setDashOffset(float dashOffset) |
void |
select(int selectionColor, |
void |
hide(@NonNull Subpolyline subpolyline) |
void |
hide(@NonNull java.util.List<Subpolyline> subpolylines) |
void |
setStrokeColors(@NonNull java.util.List<java.lang.Integer> colors, |
void |
setStrokeColors(@NonNull java.util.List<java.lang.Integer> colors) |
void |
setPaletteColor(int colorIndex, |
int |
getPaletteColor(int colorIndex) |
void |
setStrokeColor(int color) |
int |
getStrokeColor(int segmentIndex) |
addArrow(@NonNull PolylinePosition position, |
|
java.util.List<Arrow> |
arrows() |
Methods
getGeometry
@NonNull |
The polyline's geometry.
Should contain at least 2 points. Changing geometry resets polyline color indices to 0.
setGeometry
void setGeometry(@NonNull Polyline geometry) |
getStrokeWidth
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.
setStrokeWidth
void setStrokeWidth(float strokeWidth) |
getGradientLength
float getGradientLength() |
Maximum length (in units) of the gradient from one color to another.
Default: 0.
setGradientLength
void setGradientLength(float gradientLength) |
getOutlineColor
int getOutlineColor() |
The outline color.
Default: hexademical RGBA code 0x00000000.
setOutlineColor
void setOutlineColor(int outlineColor) |
getOutlineWidth
float getOutlineWidth() |
Width of the outline in units.
Default: 0.
setOutlineWidth
void setOutlineWidth(float outlineWidth) |
isInnerOutlineEnabled
boolean isInnerOutlineEnabled() |
Enables the inner outline if true (a dark border along the edge of the outline).
Default: false.
setInnerOutlineEnabled
void setInnerOutlineEnabled(boolean innerOutlineEnabled) |
getTurnRadius
float getTurnRadius() |
Maximum radius of a turn.
Measured in units. Default: 10.
setTurnRadius
void setTurnRadius(float turnRadius) |
getArcApproximationStep
float getArcApproximationStep() |
Defines step of arc approximation.
Smaller values make polyline smoother. Measured in degrees. Default: 12.
setArcApproximationStep
void setArcApproximationStep(float arcApproximationStep) |
getDashLength
float getDashLength() |
Length of a dash in units.
Default: 0 (dashing is turned off). Arrows are ignored in dashed polylines.
setDashLength
void setDashLength(float dashLength) |
getGapLength
float getGapLength() |
Length of the gap between two dashes in units.
Default: 0 (dashing is turned off). Arrows are ignored in dashed polylines.
setGapLength
void setGapLength(float gapLength) |
getDashOffset
float getDashOffset() |
Offset from the start of the polyline to the reference dash in units.
Default: 0.
setDashOffset
void setDashOffset(float dashOffset) |
select
void select(int selectionColor, |
Highlights a subpolyline using the specified color.
hide
void hide(@NonNull Subpolyline subpolyline) |
Hides the subpolyline, canceling any previous hides.
hide
void hide(@NonNull java.util.List<Subpolyline> subpolylines) |
Hides multiple subpolylines, canceling any previous hides.
setStrokeColors
void setStrokeColors(@NonNull java.util.List<java.lang.Integer> colors, |
Sets indexes of colors in palette for line segments.
Weights are used for generalization of colors. By default, all segments use palette index 0.
setStrokeColors
void setStrokeColors(@NonNull java.util.List<java.lang.Integer> colors) |
Sets indexes of colors in palette for line segments.
All the weights are equal to 1.
setPaletteColor
void setPaletteColor(int colorIndex, |
Sets color in RGBA mode for colorIndex.
If the color is not provided for some index, the default value 0x0066FFFF is used.
getPaletteColor
int getPaletteColor(int colorIndex) |
Returns the palette color for the specified index.
setStrokeColor
void setStrokeColor(int color) |
Sets the polyline color.
Effectively sets a single-color palette and sets all segments' palette indices to 0.
getStrokeColor
int getStrokeColor(int segmentIndex) |
Returns the palette index used by segment with the specified index.
addArrow
@NonNull |
Adds an arrow.
Parameters |
|
|
Coordinates of the center of the arrow. |
|
Overall length of the arrow (including the tip) in units. |
|
Color of the arrow. Adding arrows disables dash for this polyline. |
arrows
@NonNull |
Provides arrows.