MMKPolylineMapObject
- Summary
- Instance methods
- selectWithSelectionColor:subpolyline:
- hideWithSubpolyline:
- hideWithSubpolylines:
- setStrokeColorsWithColors:weights:
- setStrokeColorsWithColors:
- setPaletteColorWithColorIndex:color:
- getPaletteColorWithColorIndex:
- setStrokeColorWithColor:
- getStrokeColorWithSegmentIndex:
- addArrowWithPosition:length:fillColor:
- arrows
- Properties
@interface MMKPolylineMapObject : MMKMapObject |
A polyline object with adjustable segment colors. Supports outlines, dash, arrows, and hiding parts of the polyline efficiently.
Summary
Instance methods
- (void)selectWithSelectionColor:(nonnull UIColor *)selectionColor |
- (void)hideWithSubpolyline:(nonnull MMKSubpolyline *)subpolyline; |
- (void)hideWithSubpolylines:(nonnull NSArray<MMKSubpolyline *> *)subpolylines; |
- (void)setStrokeColorsWithColors:(nonnull NSArray<NSNumber *> *)colors |
- (void)setStrokeColorsWithColors:(nonnull NSArray<NSNumber *> *)colors; |
- (void)setPaletteColorWithColorIndex:(NSUInteger)colorIndex |
- (nonnull UIColor *)getPaletteColorWithColorIndex:(NSUInteger)colorIndex; |
- (void)setStrokeColorWithColor:(nonnull UIColor *)color; |
- (NSUInteger)getStrokeColorWithSegmentIndex:(NSUInteger)segmentIndex; |
- (nonnull MMKArrow *)addArrowWithPosition: |
Properties
@property (nonatomic, assign, unsafe_unretained, readwrite, nonnull) |
@property (nonatomic, assign, unsafe_unretained, readwrite) float strokeWidth; |
@property (nonatomic, assign, unsafe_unretained, readwrite) float gradientLength; |
@property (nonatomic, assign, unsafe_unretained, readwrite, nonnull) |
@property (nonatomic, assign, unsafe_unretained, readwrite) float outlineWidth; |
@property (nonatomic, assign, unsafe_unretained, readwrite, |
@property (nonatomic, assign, unsafe_unretained, readwrite) float turnRadius; |
@property (nonatomic, assign, unsafe_unretained, readwrite) |
@property (nonatomic, assign, unsafe_unretained, readwrite) float dashLength; |
@property (nonatomic, assign, unsafe_unretained, readwrite) float gapLength; |
@property (nonatomic, assign, unsafe_unretained, readwrite) float dashOffset; |
Instance methods
selectWithSelectionColor:subpolyline:
- (void)selectWithSelectionColor:(nonnull UIColor *)selectionColor |
Highlights a subpolyline using the specified color.
hideWithSubpolyline:
- (void)hideWithSubpolyline:(nonnull MMKSubpolyline *)subpolyline; |
Hides the subpolyline, canceling any previous hides.
hideWithSubpolylines:
- (void)hideWithSubpolylines:(nonnull NSArray<MMKSubpolyline *> *)subpolylines; |
Hides multiple subpolylines, canceling any previous hides.
setStrokeColorsWithColors:weights:
- (void)setStrokeColorsWithColors:(nonnull NSArray<NSNumber *> *)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.
setStrokeColorsWithColors:
- (void)setStrokeColorsWithColors:(nonnull NSArray<NSNumber *> *)colors; |
Sets indexes of colors in palette for line segments. All the weights are equal to 1.
setPaletteColorWithColorIndex:color:
- (void)setPaletteColorWithColorIndex:(NSUInteger)colorIndex |
Sets color in RGBA mode for colorIndex. If the color is not provided for some index, the default value 0x0066FFFF is used.
getPaletteColorWithColorIndex:
- (nonnull UIColor *)getPaletteColorWithColorIndex:(NSUInteger)colorIndex; |
Returns the palette color for the specified index.
setStrokeColorWithColor:
- (void)setStrokeColorWithColor:(nonnull UIColor *)color; |
Sets the polyline color. Effectively sets a single-color palette and sets all segments' palette indices to 0.
getStrokeColorWithSegmentIndex:
- (NSUInteger)getStrokeColorWithSegmentIndex:(NSUInteger)segmentIndex; |
Returns the palette index used by segment with the specified index.
addArrowWithPosition:length:fillColor:
- (nonnull MMKArrow *)addArrowWithPosition: |
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. Adding arrows disables dash for this polyline. |
arrows
- (nonnull NSArray<MMKArrow *> *)arrows; |
Provides arrows.
Properties
geometry
@property (nonatomic, assign, unsafe_unretained, readwrite, nonnull) |
The polyline's geometry. Should contain at least 2 points. Changing geometry resets polyline color indices to 0.
strokeWidth
@property (nonatomic, assign, unsafe_unretained, readwrite) float strokeWidth; |
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.
gradientLength
@property (nonatomic, assign, unsafe_unretained, readwrite) float gradientLength; |
Maximum length (in units) of the gradient from one color to another. Default: 0.
outlineColor
@property (nonatomic, assign, unsafe_unretained, readwrite, nonnull) |
The outline color. Default: hexademical RGBA code 0x00000000.
outlineWidth
@property (nonatomic, assign, unsafe_unretained, readwrite) float outlineWidth; |
Width of the outline in units. Default: 0.
innerOutlineEnabled
@property (nonatomic, assign, unsafe_unretained, readwrite, |
Enables the inner outline if true (a dark border along the edge of the outline). Default: false.
turnRadius
@property (nonatomic, assign, unsafe_unretained, readwrite) float turnRadius; |
Maximum radius of a turn. Measured in units. Default: 10.
arcApproximationStep
@property (nonatomic, assign, unsafe_unretained, readwrite) |
Defines step of arc approximation. Smaller values make polyline smoother. Measured in degrees. Default: 12.
dashLength
@property (nonatomic, assign, unsafe_unretained, readwrite) float dashLength; |
Length of a dash in units. Default: 0 (dashing is turned off). Arrows are ignored in dashed polylines.
gapLength
@property (nonatomic, assign, unsafe_unretained, readwrite) float gapLength; |
Length of the gap between two dashes in units. Default: 0 (dashing is turned off). Arrows are ignored in dashed polylines.
dashOffset
@property (nonatomic, assign, unsafe_unretained, readwrite) float dashOffset; |
Offset from the start of the polyline to the reference dash in units. Default: 0.