WDGPosition
WDGPosition实例代表一个WilddogLocation SDK存储的位置信息。
latitude
Section titled “latitude”@property (nonatomic, assign, readonly) double latitude;位置信息的经度。
longitude
Section titled “longitude”@property (nonatomic, assign, readonly) double longitude;位置信息的纬度。
timestamp
Section titled “timestamp”@property (nonatomic, strong, readonly) NSDate *timestamp;位置信息在设备上创建时的时间戳。
customAttributes
Section titled “customAttributes”@property (nonatomic, strong, readonly, nullable) NSDictionary *customAttributes;随位置信息一同上传的附加信息。
- initWithLatitude:longitude:
Section titled “- initWithLatitude:longitude:”- (instancetype)initWithLatitude:(double)latitude longitude:(double)longitude;通过直接指定纬度和经度初始化 WDGPosition 实例。时间戳会自动根据设备当前时间生成。
| 参数名 | 说明 |
|---|---|
| latitude | 纬度 |
| longitude | 经度 |
WDGPosition 实例。
- initWithLatitude:longitude:timestamp:
Section titled “- initWithLatitude:longitude:timestamp:”- (instancetype)initWithLatitude:(double)latitude longitude:(double)longitude timestamp:(NSDate *)timestamp;通过直接指定纬度、经度和时间戳初始化 WDGPosition 实例。
| 参数名 | 说明 |
|---|---|
| latitude | 纬度 |
| longitude | 经度 |
| timestamp | 指定的时间戳 |
WDGPosition 实例。
- initWithLatitude:longitude:timestamp:customAttributes:
Section titled “- initWithLatitude:longitude:timestamp:customAttributes:”- (instancetype)initWithLatitude:(double)latitude longitude:(double)longitude timestamp:(NSDate *)timestamp customAttributes:(NSDictionary *_Nullable)customAttributes;通过直接指定纬度、经度、时间戳和自定义属性字典初始化 WDGPosition 实例。
| 参数名 | 说明 |
|---|---|
| latitude | 纬度 |
| longitude | 经度 |
| timestamp | 指定的时间戳 |
| customAttributes | 自定义属性字典 |
WDGPosition 实例。
- initWithCLLocation:
Section titled “- initWithCLLocation:”- (instancetype)initWithCLLocation:(CLLocation *)location;通过Objective-C定义的CLLocation位置信息初始化 WDGPosition 实例。
| 参数名 | 说明 |
|---|---|
| location | 位置信息 |
WDGPosition 实例。
- initWithCLLocation:customAttributes:
Section titled “- initWithCLLocation:customAttributes:”- (instancetype)initWithCLLocation:(CLLocation *)location customAttributes:(NSDictionary *_Nullable)customAttributes;通过Objective-C定义的CLLocation位置信息和自定义属性字典初始化 WDGPosition 实例。
| 参数名 | 说明 |
|---|---|
| location | 位置信息 |
| customAttributes | 自定义属性字典 |
WDGPosition 实例。