KNMapSegmentPolyline
INFO
This English reference is based on Directions SDK 1.12.12. For the latest version, see the Korean reference.
Configures a Polyline with pattern images, segmented colors, and other custom styles.
Constructor
Creates a KNMapSegmentPolyline object.
objc
KNMapSegmentPolyline* segmentLine = [KNMapSegmentPolyline segmentPolyline];
[self->mapView addSegmentPolyline:segmentLine];Properties
| Name | Description | Type |
|---|---|---|
strokeColor | Outline color | @property (nonatomic, assign, nonnull) UIColor* strokeColor; |
lineWidth | Line width (default: 15, range: 1–50) | @property (nonatomic, assign) float lineWidth |
strokeWidth | Outline width (default: 4, range: 0–10) | @property (nonatomic, assign) float strokeWidth |
capType | Shape of both line ends | @property (nonatomic, assign) KNLineCapType capType |
isVisible | Whether the line is visible (default: YES) | @property (nonatomic, assign) BOOL isVisible |
priority | Display priority. Higher values appear on top. (default: 0, priority range: 0~65535) | @property (nonatomic, readwrite, assign) NSInteger priority |
patternImage | Pattern image for the line (default: nil) | @property (nonatomic, assign, nullable) UIImage* patternImage |
tag | Integer tag used to categorize or identify the line (optional) | @property (nonatomic, assign) NSInteger tag |
Methods
addSegment:countPoints:color
Creates a line segment from multiple KATEC coordinate vertices and colors, then connects it to the last segment.
Example code
objc
KNMapSegmentPolyline* segmentLine = [KNMapSegmentPolyline segmentPolyline];
FloatPoint *positions = nil;
positions = realloc(positions, sizeof(FloatPoint)*2);
positions[0] = FloatPointMake(321832.0, 533175.0);
positions[1] = FloatPointMake(321832.0, 532975.0);
UIColor* color = [[UIColor alloc] initWithRed:(float)(rand() % 256) / 255.0 green:(float)(rand() % 256) / 255.0 blue:(float)(rand() % 256) / 255.0 alpha:1.0];
[segmentLine addSegment:positions countPoints:2 color:color];
[self->mapView addSegmentPolyline:segmentLine];objc
+ (KNMapSegmentPolyline *_Nonnull)segmentPolyline