Map Doc  1.0
iOS-引擎SDK-开放平台
MBUtils类 参考

#import <MBUtils.h>

类 MBUtils 继承关系图:

类方法

(NSDictionary *) + App_getNaviDataMetadata:
 
(NSInteger) + distanceWithStartPoint:endPoint:
 
(NSString *) + distanceTextWithStartPoint:endPoint:
 
(NSString *) + distanceTextWithLength:
 
(NSString *) + orientationTextWithStartPoint:endPoint:
 
(NSInteger) + angleFromDx:andDy:
 
(NSInteger) + angleFromPoint:toPoint:
 
(int) + isNightMode
 
(NSString *) + getAbsolutePath:
 
(MBDateTime+ NSDate2DateTime:
 
(NSString *) + Device_uniqueDeviceIdentifier
 
(unsigned char *) + convertUIImageToBitmapRGBA8:
 
(UIImage *) + convertBitmapRGBA8ToUIImage:withWidth:withHeight:
 

函数文档

◆ angleFromDx:andDy:()

+ (NSInteger) angleFromDx: (NSInteger)  dx
andDy: (NSInteger)  dy 

计算角度

参数
dx经度
dy纬度
返回
角度

◆ angleFromPoint:toPoint:()

+ (NSInteger) angleFromPoint: (MBPoint posFrom
toPoint: (MBPoint posTo 

计算角度

参数
posFrom起始点
posTo终点
返回
角度

◆ App_getNaviDataMetadata:()

+ (NSDictionary *) App_getNaviDataMetadata: (NSString *)  fileName

数据源

参数
fileName文件相对路径
返回
字典,keys分别是:fileExist,guid,dataVersion,moreDataVersionNumber,moreDataVersions,mapbarVersion,compileTime,dataId,values分别是:BOOL,NSString,NSString,int,NSArray,NSString,NSString,NSString。
自从
4.10.x

◆ convertBitmapRGBA8ToUIImage:withWidth:withHeight:()

+ (UIImage *) convertBitmapRGBA8ToUIImage: (unsigned char *)  buffer
withWidth: (int)  width
withHeight: (int)  height 

位图转换成UIImage

参数
buffer位图缓冲区大小
width
height
返回
UIImage 实例
自从
4.10.x

◆ convertUIImageToBitmapRGBA8:()

+ (unsigned char *) convertUIImageToBitmapRGBA8: (UIImage *)  image

UIImage 转换成位图

参数
imageUIImage
返回
位图指针
自从
4.9.x

◆ Device_uniqueDeviceIdentifier()

+ (NSString *) Device_uniqueDeviceIdentifier

获取设备唯一表示

返回
唯一标示

◆ distanceTextWithLength:()

+ (NSString *) distanceTextWithLength: (NSInteger)  length

NSInteger类型的距离转化成字符串类型的距离

参数
lengthNSInteger表示的长度
返回
字符串表示的长度
自从
4.9.x

◆ distanceTextWithStartPoint:endPoint:()

+ (NSString *) distanceTextWithStartPoint: (MBPoint *)  startPoint
endPoint: (MBPoint *)  endPoint 

将世界坐标系下的经纬度表示的长度转换为屏幕坐标系下的长度,来绘制用于显示的比例尺。

参数
startPoint起点坐标
endPoint终点坐标
返回
距离,单位为“公里”、“米”、“英里”、“英尺”。

◆ distanceWithStartPoint:endPoint:()

+ (NSInteger) distanceWithStartPoint: (MBPoint *)  startPoint
endPoint: (MBPoint *)  endPoint 

将世界坐标系下的经纬度表示的长度转换为屏幕坐标系下的长度,来绘制用于显示的比例尺。

参数
startPoint起点坐标
endPoint终点坐标
返回
距离,单位:米。
自从
4.9.x

◆ getAbsolutePath:()

+ (NSString *) getAbsolutePath: (NSString *)  relativePath

相对路径转化绝对路径,客户端无需理会

参数
relativePath相对路径
返回
绝对路径

◆ isNightMode()

+ (int) isNightMode

白天黑夜自动模式,根据当前时区自动判断是否是白天或者黑夜,需要开启定位 MBLocationManager

返回
-1表示error,0表示daymode,1表示nightmode

◆ NSDate2DateTime:()

+ (MBDateTime) NSDate2DateTime: (NSDate *)  date

类型转换

参数
dateNSDate
返回
MBDateTime
自从
4.9.x

◆ orientationTextWithStartPoint:endPoint:()

+ (NSString *) orientationTextWithStartPoint: (MBPoint *)  startPoint
endPoint: (MBPoint *)  endPoint 

相对位置转化为字符串,比如"东偏北300米",但是如果小于等于100米,则返回"附近"

参数
startPoint起始点
endPoint终点
返回
字符串描述

该类的文档由以下文件生成: