高德地图SDK(导航)  V9.8.1
MAMultiPolyline Class Reference

多彩线model类。此类用于定义一个由多个点相连的多段线,绘制时支持分段采用不同颜色(纹理)绘制,点与点之间尾部相连但第一点与最后一个点不相连, 通常MAMultiPolyline是MAMultiColoredPolylineRenderer(分段颜色绘制)或MAMultiTexturePolylineRenderer(分段纹理绘制)的model More...

#import <MAMultiPolyline.h>

Inheritance diagram for MAMultiPolyline:
MAPolyline MAMultiPoint <MAOverlay> MAShape <MAAnnotation> MABaseOverlay <MAAnnotation> <MAOverlay> <MAAnnotation>

Instance Methods

(BOOL) - setPolylineWithPoints:count:drawStyleIndexes:
 重新设置坐标点. since 5.0.0 More...
 
(BOOL) - setPolylineWithCoordinates:count:drawStyleIndexes:
 重新设置坐标点. since 5.0.0 More...
 
- Instance Methods inherited from MAPolyline
(BOOL) - setPolylineWithPoints:count:
 重新设置折线坐标点. since 5.0.0 More...
 
(BOOL) - setPolylineWithCoordinates:count:
 重新设置折线坐标点. since 5.0.0 More...
 
- Instance Methods inherited from MAMultiPoint
(void) - getCoordinates:range:
 将内部的坐标点数据转化为经纬度坐标并拷贝到coords内存中 More...
 
- Instance Methods inherited from <MAOverlay>
(CLLocationCoordinate2D) - coordinate
 返回区域中心坐标 More...
 
(MAMapRect- boundingMapRect
 区域外接矩形 More...
 
- Instance Methods inherited from <MAAnnotation>
(void) - setCoordinate:
 设置标注的坐标,在拖拽时会被调用. More...
 

Class Methods

(instancetype) + polylineWithPoints:count:drawStyleIndexes:
 多彩线,根据MAMapPoint数据生成多彩线 More...
 
(instancetype) + polylineWithCoordinates:count:drawStyleIndexes:
 多彩线,根据经纬度坐标数据生成多彩线 More...
 
- Class Methods inherited from MAPolyline
(instancetype) + polylineWithPoints:count:
 根据map point数据生成多段线 More...
 
(instancetype) + polylineWithCoordinates:count:
 根据经纬度坐标数据生成多段线 More...
 

Properties

NSArray< NSNumber * > * drawStyleIndexes
 
- Properties inherited from MAMultiPoint
MAMapPointpoints
 坐标点数组 More...
 
NSUInteger pointCount
 坐标点的个数 More...
 
BOOL cross180Longitude
 是否跨越180度经度线,默认NO since 6.4.0 More...
 
- Properties inherited from MAShape
NSString * title
 标题 More...
 
NSString * subtitle
 副标题 More...
 
- Properties inherited from MABaseOverlay
CLLocationCoordinate2D coordinate
 返回区域中心坐标 More...
 
MAMapRect boundingMapRect
 区域外接矩形 More...
 
double altitude
 海拔,单位米,默认0 More...
 
- Properties inherited from <MAAnnotation>
NSString * title
 annotation标题 More...
 
NSString * subtitle
 annotation副标题 More...
 
double altitude
 annotation海拔高度,单位米,默认0 More...
 

Additional Inherited Members

- Protected Attributes inherited from MAShape
NSString * _title
 标题 More...
 
NSString * _subtitle
 副标题 More...
 
- Protected Attributes inherited from MABaseOverlay
double _altitude
 海拔 More...
 

Detailed Description

多彩线model类。此类用于定义一个由多个点相连的多段线,绘制时支持分段采用不同颜色(纹理)绘制,点与点之间尾部相连但第一点与最后一个点不相连, 通常MAMultiPolyline是MAMultiColoredPolylineRenderer(分段颜色绘制)或MAMultiTexturePolylineRenderer(分段纹理绘制)的model

Method Documentation

◆ polylineWithCoordinates:count:drawStyleIndexes:

+ (instancetype) polylineWithCoordinates: (CLLocationCoordinate2D *)  coords
count: (NSUInteger)  count
drawStyleIndexes: (NSArray< NSNumber * > *)  drawStyleIndexes 

多彩线,根据经纬度坐标数据生成多彩线

分段纹理绘制:其对应的MAMultiTexturePolylineRenderer必须设置strokeTextureImages属性; 否则使用默认的灰色纹理绘制。 分段颜色绘制:其对应的MAMultiColoredPolylineRenderer必须设置strokeColors属性。

Parameters
coords指定的经纬度坐标点数组,注意:如果有连续重复点,需要去重处理,只保留一个,否则会导致绘制有问题。
count坐标点的个数
drawStyleIndexes纹理索引数组(颜色索引数组), 成员为NSNumber, 且为非负数。
Returns
生成的折线对象

◆ polylineWithPoints:count:drawStyleIndexes:

+ (instancetype) polylineWithPoints: (MAMapPoint *)  points
count: (NSUInteger)  count
drawStyleIndexes: (NSArray< NSNumber * > *)  drawStyleIndexes 

多彩线,根据MAMapPoint数据生成多彩线

分段纹理绘制:其对应的MAMultiTexturePolylineRenderer必须设置strokeTextureImages属性; 否则使用默认的灰色纹理绘制。 分段颜色绘制:其对应的MAMultiColoredPolylineRenderer必须设置strokeColors属性

Parameters
points指定的直角坐标点数组,注意:如果有连续重复点,需要去重处理,只保留一个,否则会导致绘制有问题。
count坐标点的个数
drawStyleIndexes纹理索引数组(颜色索引数组)
Returns
生成的折线对象

◆ setPolylineWithCoordinates:count:drawStyleIndexes:

- (BOOL) setPolylineWithCoordinates: (CLLocationCoordinate2D *)  coords
count: (NSUInteger)  count
drawStyleIndexes: (NSArray< NSNumber * > *)  drawStyleIndexes 

重新设置坐标点. since 5.0.0

Parameters
coords指定的经纬度坐标点数组,C数组,内部会做copy,调用者负责内存管理。注意:如果有连续重复点,需要去重处理,只保留一个,否则会导致绘制有问题。
count坐标点的个数
drawStyleIndexes纹理索引数组(颜色索引数组), 成员为NSNumber, 且为非负数。
Returns
是否设置成功

◆ setPolylineWithPoints:count:drawStyleIndexes:

- (BOOL) setPolylineWithPoints: (MAMapPoint *)  points
count: (NSUInteger)  count
drawStyleIndexes: (NSArray< NSNumber * > *)  drawStyleIndexes 

重新设置坐标点. since 5.0.0

Parameters
points指定的直角坐标点数组,C数组,内部会做copy,调用者负责内存管理。注意:如果有连续重复点,需要去重处理,只保留一个,否则会导致绘制有问题。
count坐标点的个数
drawStyleIndexes纹理索引数组(颜色索引数组), 成员为NSNumber, 且为非负数。
Returns
是否设置成功

Property Documentation

◆ drawStyleIndexes

- (NSArray<NSNumber *>*) drawStyleIndexes
readwritenonatomicstrong

绘制索引数组(纹理、颜色索引数组), 成员为NSNumber, 且为非负数。 例子:[1,3,6] 表示 0-1使用第一种颜色\纹理,1-3使用第二种,3-6使用第三种,6-最后使用第四种。 在渐变模式下(MAMultiColoredPolylineRenderer.gradient = YES),0-1使用第一种颜色,3使用第二种,6-最后使用第四种,1-3,3-6使用渐变色进行填充。

注意:polyline在渲染时会进行抽稀以提高渲染效率,但是如果是设置为drawIndex的点,则不会被抽稀。 在每一个点都是索引点的极端情况下,则抽稀过程不会生效,点数量很多时会极大的影响渲染效率。所以请尽量少的设置索引点的数量。


The documentation for this class was generated from the following file:
© 2017 高德信息技术有限公司 版权所有,保留所有权利。