BMKPolyline.h 3.2 KB
Newer Older
曹云霄's avatar
曹云霄 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
/*
 *  BMKPolyline.h
 *  BMapKit
 *
 *  Copyright 2011 Baidu Inc. All rights reserved.
 *
 */

#import "BMKMultiPoint.h"
#import "BMKOverlay.h"

/// 此类用于定义一段折线
@interface BMKPolyline : BMKMultiPoint <BMKOverlay>

/**
 *根据指定坐标点生成一段折线
 *@param points 指定的直角坐标点数组
 *@param count 坐标点的个数
 *@return 新生成的折线对象
 */
+ (BMKPolyline *)polylineWithPoints:(BMKMapPoint *)points count:(NSUInteger)count;

/**
 *根据指定坐标点生成一段折线
 *@param coords 指定的经纬度坐标点数组
 *@param count 坐标点的个数
 *@return 新生成的折线对象
 */
+ (BMKPolyline *)polylineWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSUInteger)count;

/**
 *重新设置折线坐标点
 *@param points 指定的直角坐标点数组
 *@param count 坐标点的个数
 *@return 是否设置成功
 */
- (BOOL)setPolylineWithPoints:(BMKMapPoint *)points count:(NSInteger) count;

/**
 *重新设置折线坐标点
 *@param coords 指定的经纬度坐标点数组
 *@param count 坐标点的个数
 *@return 是否设置成功
 */
- (BOOL)setPolylineWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSInteger) count;


#pragma mark - 以下方法和属性只适用于分段纹理绘制

///纹理索引数组
@property (nonatomic, strong) NSArray *textureIndex;

/**
 *分段纹理绘制,根据指定坐标点生成一段折线
 *
 *其对应的BMKPolylineView,必须使用 - (BOOL)loadStrokeTextureImages:(NSArray *)textureImages; 加载纹理图片;否则使用默认的灰色纹理绘制
 *
 *@param points 指定的直角坐标点数组
 *@param count 坐标点的个数
 *@param textureIndex 纹理索引数组,成员为NSNumber,且为非负数,负数按0处理
 *@return 新生成的折线对象
 */
+ (BMKPolyline *)polylineWithPoints:(BMKMapPoint *)points count:(NSUInteger)count textureIndex:(NSArray*) textureIndex;

/**
 *根据指定坐标点生成一段折线
 *
 *其对应的BMKPolylineView,必须使用 - (BOOL)loadStrokeTextureImages:(NSArray *)textureImages; 加载纹理图片;否则使用默认的灰色纹理绘制
 *
 *@param coords 指定的经纬度坐标点数组
 *@param count 坐标点的个数
 *@param textureIndex 纹理索引数组,成员为NSNumber,且为非负数,负数按0处理
 *@return 新生成的折线对象
 */
+ (BMKPolyline *)polylineWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSUInteger)count textureIndex:(NSArray*) textureIndex;

/**
 *重新设置折线坐标点 和 纹理索引
 *@param points 指定的直角坐标点数组
 *@param count 坐标点的个数
 *@param textureIndex 纹理索引数组,成员为NSNumber,且为非负数,负数按0处理
 *@return 是否设置成功
 */
- (BOOL)setPolylineWithPoints:(BMKMapPoint *)points count:(NSInteger) count textureIndex:(NSArray*) textureIndex;

/**
 *重新设置折线坐标点
 *@param coords 指定的经纬度坐标点数组
 *@param count 坐标点的个数
 *@param textureIndex 纹理索引数组,成员为NSNumber,且为非负数,负数按0处理
 *@return 是否设置成功
 */
- (BOOL)setPolylineWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSInteger) count textureIndex:(NSArray*) textureIndex;

@end