iOS高德地图SDK(3D) V11.2.0001

Instance Methods | Class Methods | Properties | List of all members
MAMultiPolyline Class Reference

`#import <MAMultiPolyline.h>`

Inheritance diagram for MAMultiPolyline:

## Instance Methods
(BOOL) | - setPolylineWithPoints:count:drawStyleIndexes:
| 重新设置坐标点. since 5.0.0 Reset the coordinate points . since 5.0.0 More...
(BOOL) | - setPolylineWithCoordinates:count:drawStyleIndexes:
| 重新设置坐标点. since 5.0.0 Reset the coordinate points. since 5.0.0 More...
Instance Methods inherited from MAPolyline
(BOOL) | - setPolylineWithPoints:count:
| 重新设置折线坐标点. since 5.0.0 Reset polyline coordinate points. since 5.0.0 More...
(BOOL) | - setPolylineWithCoordinates:count:
| 重新设置折线坐标点. since 5.0.0 Reset polyline coordinate points. since 5.0.0 More...
Instance Methods inherited from MAMultiPoint
(void) | - getCoordinates:range:
| 将内部的坐标点数据转化为经纬度坐标并拷贝到coords内存中 Convert the internal coordinate point data into latitude and longitude coordinates and copy them to the coords memory More...
Instance Methods inherited from <MAOverlay>
(CLLocationCoordinate2D) | - coordinate
(MAMapRect) | - boundingMapRect
Instance Methods inherited from <MAAnnotation>
(void) | - setCoordinate:
| 设置标注的坐标，在拖拽时会被调用. Set the coordinates of the annotation, which will be called during dragging More...

## Class Methods
(instancetype) | + polylineWithPoints:count:drawStyleIndexes:
| 多彩线，根据MAMapPoint数据生成多彩线 Colorful line, generated based on MAMapPoint data; More...
(instancetype) | + polylineWithCoordinates:count:drawStyleIndexes:
| 多彩线，根据经纬度坐标数据生成多彩线 Multicolored line, generated based on latitude and longitude coordinate data More...
Class Methods inherited from MAPolyline
(instancetype) | + polylineWithPoints:count:
| 根据map point数据生成多段线 Generate polylines based on map point data More...
(instancetype) | + polylineWithCoordinates:count:
| 根据经纬度坐标数据生成多段线 Generate a polyline based on latitude and longitude coordinate data More...

## Properties
NSArray< NSNumber * > * | drawStyleIndexes
Properties inherited from MAMultiPoint
MAMapPoint * | points
NSUInteger | pointCount
BOOL | cross180Longitude
Properties inherited from MAShape
NSString * | title
| 标题 Title More...
NSString * | subtitle
| 副标题 Subtitle More...
Properties inherited from MABaseOverlay
CLLocationCoordinate2D | coordinate
MAMapRect | boundingMapRect
double | altitude
Properties inherited from <MAAnnotation>
NSString * | title
NSString * | subtitle
double | altitude

## Additional Inherited Members
Protected Attributes inherited from MAShape
NSString * | _title
| 标题 Title More...
NSString * | _subtitle
| 副标题 Subtitle More...
Protected Attributes inherited from MABaseOverlay
double | _altitude
| 海拔 Elevation More...

## Detailed Description

多彩线model类。此类用于定义一个由多个点相连的多段线，绘制时支持分段采用不同颜色（纹理）绘制，点与点之间尾部相连但第一点与最后一个点不相连, 通常MAMultiPolyline是MAMultiColoredPolylineRenderer（分段颜色绘制）或MAMultiTexturePolylineRenderer（分段纹理绘制）的model The MultiColorLine model class. This class is used to define a polyline connected by multiple points, supporting the use of different colors (textures) for each segment during drawing. The points are connected end to end, but the first and last points are not connected, usually MAMultiPolyline is a model of MAMultiColoredPolylineRenderer (segmented color rendering) or MAMultiTexturePolylineRenderer (segmented texture rendering)

## Method Documentation

## ◆ polylineWithCoordinates:count:drawStyleIndexes:

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

多彩线，根据经纬度坐标数据生成多彩线 Multicolored line, generated based on latitude and longitude coordinate data

分段纹理绘制：其对应的MAMultiTexturePolylineRenderer必须设置strokeTextureImages属性; 否则使用默认的灰色纹理绘制。 Segmented texture rendering: its corresponding MAMultiTexturePolylineRenderer must set the strokeTextureImages property; otherwise, the default gray texture will be used. 分段颜色绘制：其对应的MAMultiColoredPolylineRenderer必须设置strokeColors属性。 Segmented color rendering: Its corresponding MAMultiColoredPolylineRenderer must set the strokeColors property.

Parameters

  coords | 指定的经纬度坐标点数组，注意：如果有连续重复点，需要去重处理，只保留一个，否则会导致绘制有问题。 The array of specified latitude and longitude coordinate points, note: if there are consecutive duplicate points, they need to be deduplicated, only one should be retained, otherwise it will cause drawing issues.
  count | 坐标点的个数 Number of coordinate points
  drawStyleIndexes | 纹理索引数组(颜色索引数组), 成员为NSNumber, 且为非负数。 Texture index array (color index array), members are NSNumber, and are non-negative.

Returns
  生成的折线对象 Generated polyline object

## ◆ polylineWithPoints:count:drawStyleIndexes:

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

多彩线，根据MAMapPoint数据生成多彩线 Colorful line, generated based on MAMapPoint data;

分段纹理绘制：其对应的MAMultiTexturePolylineRenderer必须设置strokeTextureImages属性; 否则使用默认的灰色纹理绘制。 Segmented texture rendering: its corresponding MAMultiTexturePolylineRenderer must set the strokeTextureImages property; otherwise, the default gray texture will be used. 分段颜色绘制：其对应的MAMultiColoredPolylineRenderer必须设置strokeColors属性 Segmented color rendering: Its corresponding MAMultiColoredPolylineRenderer must set the strokeColors property

Parameters

  points | 指定的直角坐标点数组，注意：如果有连续重复点，需要去重处理，只保留一个，否则会导致绘制有问题。 Specified array of rectangular coordinate points, note: if there are consecutive duplicate points, deduplication is required, only one should be retained, otherwise it will cause issues in drawing.
  count | 坐标点的个数 Number of coordinate points
  drawStyleIndexes | 纹理索引数组(颜色索引数组) Texture index array (color index array)

Returns
  生成的折线对象 Generated polyline object

## ◆ setPolylineWithCoordinates:count:drawStyleIndexes:

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

重新设置坐标点. since 5.0.0 Reset the coordinate points. since 5.0.0

Parameters

  coords | 指定的经纬度坐标点数组,C数组，内部会做copy，调用者负责内存管理。注意：如果有连续重复点，需要去重处理，只保留一个，否则会导致绘制有问题。 Specified latitude and longitude coordinate point array, C array, internal copy will be made, the caller is responsible for memory management. Note: if there are consecutive duplicate points, they need to be deduplicated, only one should be retained, otherwise it will cause drawing issues.
  count | 坐标点的个数 Number of coordinate points
  drawStyleIndexes | 纹理索引数组(颜色索引数组), 成员为NSNumber, 且为非负数。 Texture index array (color index array), members are NSNumber, and are non-negative.

Returns
  是否设置成功 Whether the setup was successful

## ◆ setPolylineWithPoints:count:drawStyleIndexes:

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

重新设置坐标点. since 5.0.0 Reset the coordinate points . since 5.0.0

Parameters

  points | 指定的直角坐标点数组,C数组，内部会做copy，调用者负责内存管理。注意：如果有连续重复点，需要去重处理，只保留一个，否则会导致绘制有问题。 Specified rectangular coordinate point array, C array, internal copy will be made, the caller is responsible for memory management, note: if there are consecutive duplicate points, they need to be deduplicated, only one should be retained, otherwise it will cause drawing issues.
  count | 坐标点的个数 Number of coordinate points
  drawStyleIndexes | 纹理索引数组(颜色索引数组), 成员为NSNumber, 且为非负数。 Texture index array (color index array), members are NSNumber, and are non-negative.

Returns
  是否设置成功 Whether the setup was successful

## Property Documentation

## ◆ drawStyleIndexes

- (NSArray<NSNumber *>*) drawStyleIndexes
| read write nonatomic strong

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

注意：polyline在渲染时会进行抽稀以提高渲染效率，但是如果是设置为drawIndex的点，则不会被抽稀。 在每一个点都是索引点的极端情况下，则抽稀过程不会生效，点数量很多时会极大的影响渲染效率。所以请尽量少的设置索引点的数量。 Draw index array (texture, color index array), members are NSNumber and non-negative. Example: [1,3,6] means using the first color\texture for 0-1, the second for 1-3, the third for 3-6, and the fourth from 6 to the end. In gradient mode (MAMultiColoredPolylineRenderer.gradient = YES), use the first color for 0-1, the second for 3, and the fourth from 6 to the end. Use gradient colors for filling between 1-3 and 3-6.

Note: The polyline will be simplified during rendering to improve efficiency, but points set as drawIndex will not be simplified. In the extreme case where every point is an index point, the thinning process will not take effect, and a large number of points will significantly affect rendering efficiency. Therefore, please try to minimize the number of index points.

The documentation for this class was generated from the following file:

- MAMultiPolyline.h

© 2017 高德信息技术有限公司 版权所有，保留所有权利。