Constructor 링크 복사
KNMapSegmentPolyline
객체를 생성합니다.
KNMapSegmentPolyline* segmentLine = [KNMapSegmentPolyline segmentPolyline];
[self->mapView addSegmentPolyline:segmentLine];
KNMapSegmentPolyline* segmentLine = [KNMapSegmentPolyline segmentPolyline];
[self->mapView addSegmentPolyline:segmentLine];
코드가 숨겨졌습니다.
표 1
Properties
Name | Description | Type |
---|---|---|
strokeColor | 라인의 외곽선 색상 | @property (nonatomic, assign, nonnull) UIColor* strokeColor; |
lineWidth | 라인의 두께 (기본값: 15, 두께 설정 범위: 1~50) | @property (nonatomic, assign) float lineWidth |
strokeWidth | 라인의 외곽선 두께 (기본값: 4, 외곽선 두께 설정 범위: 0~10) | @property (nonatomic, assign) float strokeWidth |
capType | 라인의 양쪽 끝단 모양 설정 | @property (nonatomic, assign) KNLineCapType capType |
isVisible | 라인의 표시 여부 (기본값: YES ) | @property (nonatomic, assign) BOOL isVisible |
priority | 라인을 표시할 우선 순위. 숫자가 높을수록 상위로 표시됨. (기본값: 0, 우선 순위 설정 범위: 0~65535) | @property (nonatomic, readwrite, assign) NSInteger priority |
patternImage | 라인 내 패턴 이미지 설정 여부 (기본값: nil ) | @property (nonatomic, assign, nullable) UIImage* patternImage |
tag | 라인에 설정할 태그(tag). 카테고리 분류나 별도의 구분을 하고 싶을 때 사용할 수 있음. (선택 사항) | @property (nonatomic, assign) NSInteger tag |
함수 링크 복사
여러 개의 카텍(KATEC) 좌표 정점과 색상을 적용하여 하나의 라인 세그먼트(segment, 부분)를 생성합니다. 그리고 현재 라인의 세그먼트와 마지막으로 추가된 세그먼트를 연결합니다.
+ (KNMapSegmentPolyline *_Nonnull)segmentPolyline |
예시 코드
예시 코드
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];
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];
코드가 숨겨졌습니다.