My Project
BaiduPanoramaView.h
Go to the documentation of this file.
1 //
2 // BaiduPanoramaView.h
3 // BaiduPanoSDK
4 //
5 // Created by bianheshan on 15/4/19.
6 // Copyright (c) 2015年 baidu. All rights reserved.
7 //
8 
9 #import <UIKit/UIKit.h>
10 #import <CoreMotion/CoreMotion.h>
13 #import <CoreLocation/CoreLocation.h>
14 typedef enum : NSUInteger {
15  ImageDefinitionHigh = 5,// 高清图
16  ImageDefinitionMiddle = 4,// 标准图
17  ImageDefinitionLow = 3,// 低清图
19 
20 typedef enum : NSUInteger {
21  BaiduPanoErrorEngineInitFailed = 101,// 引擎初始化失败
22  BaiduPanoErrorDescriptionLoadFailed = 102,// 引擎描述信息加载失败
23  BaiduPanoErrorPanoramaLoadFailed = 103,// 全景加载失败
24  BaiduPanoErrorInteriorLoadFailed = 201,// 全景室内图加载失败
25  BaiduPanoErrorNoIndoorAlbumPlugin = 202, // 全景室内图的插件没有安装
26  BaiduPanoErrorNoIndoorAlbumPluginFunc = 203, // 全景室内图的插件无对应方法
27  BaiduPanoErrorNoPanorama = 301,// 当前 UID 点没有全景图
29 
30 typedef enum : NSUInteger {
34 
35 @class BaiduPanoramaView;
36 @class BaiduPoiPanoData;
37 @protocol BaiduPanoramaViewDelegate <NSObject>
38 @optional
39 
40 
41 #pragma mark - 全景回掉
42 
46 - (void)panoramaWillLoad:(BaiduPanoramaView *)panoramaView;
47 
54 - (void)panoramaDidLoad:(BaiduPanoramaView *)panoramaView descreption:(NSString *)jsonStr;
55 
62 - (void)panoramaLoadFailed:(BaiduPanoramaView *)panoramaView error:(NSError *)error;
63 
68 - (void)panoramaView:(BaiduPanoramaView *)panoramaView overlayClicked:(NSString *)overlayId;
69 
70 - (void)panoramaView:(BaiduPanoramaView *)panoramaView didReceivedMessage:(NSDictionary *)dict;
71 
72 #pragma mark 室内相册回调
73 
78 - (UIView *)indoorAlbumViewForPanoramaView:(BaiduPanoramaView *)panoramaView poiData:(BaiduPoiPanoData *)data;
79 
80 
81 @end
82 
83 @interface BaiduPanoramaView : UIView
84 
85 @property(weak, nonatomic) id<BaiduPanoramaViewDelegate> delegate;
86 
87 #pragma mark - 获取全景
88 
94 - (id)initWithFrame:(CGRect)frame key:(NSString *)key;
95 
100 - (id)initWithFrame:(CGRect)frame;
101 
108 - (id)initWithFrame:(CGRect)frame mcX:(NSInteger)x mcY:(NSInteger)y;
109 
115 - (void)setPanoramaWithPid:(NSString *)pid;
116 
122 - (void)setPanoramaAccessKey:(NSString *)key;
128 - (void)setPanoramaWithLon:(double)lon lat:(double)lat;
129 
135 - (void)setPanoramaWithX:(NSInteger)x Y:(NSInteger)y;
136 
141 - (void)setPanoramaWithUid:(NSString *)uid;
142 
148 - (void)setPanoramaWithUid:(NSString *)uid type:(BaiduPanoramaType)type;
149 
150 #pragma mark - 全景图属性设置以及获取
151 
156 - (void)setPanoramaZoomLevel:(int)level;
157 
163 - (void)setPanoramaImageLevel:(ImageDefinition)imageDefinition;
164 
169 - (void)setPanoramaPitch:(float)pitch;
170 
175 - (void)setPanoramaHeading:(float)heading;
176 
181 - (void)setDirectionArrowImage:(UIImage *)image;
182 
187 - (void)setDirectionArrowByUrl:(NSString *)url;
188 
193 - (void)showDirectionArrow:(BOOL) isShow;
194 
199 - (void)enableFastMoving:(BOOL)isOpen;
200 
204 - (BOOL)isEnableFastMoving;
205 
209 - (float)getPanoramaZoomLevel;
210 
214 - (float)getPanoramaPitch;
215 
219 - (float)getPanoramaHeading;
220 
224 - (float)getPanoramaFOV;
225 #pragma mark - 全景图覆盖物
226 
230 - (void)addOverlay:(BaiduPanoOverlay *)overlay;
231 
236 - (void)removeOverlay:(NSString *)overlayId;
237 
242 - (void)setAllCustomOverlaysHidden:(BOOL)hidden;
243 
248 - (void)setPoiOverlayHidden:(BOOL)hidden;
249 /*
250  * @abstract 移除所有覆盖物
251  *
252  */
253 - (void)removeAllOverlay;
254 
261 - (void)setCustomOverlayAnchor:(NSString *)key x:(float)x y:(float)y;
262 
270 - (void)addLabelOverlayById:(NSString *)overlayId
271  coordinate:(CLLocationCoordinate2D)coor
272  height:(double)height
273  text:(NSString *)text;
274 
282 - (void)addImageOverlayById:(NSString *)overlayId
283  coordinate:(CLLocationCoordinate2D)coor
284  height:(double)height
285  image:(UIImage *)image;
294 - (void)addLabelOverlayById:(NSString *)overlayId
295  X:(NSInteger)x
296  Y:(NSInteger)y
297  Z:(NSInteger)z
298  text:(NSString *)text;
299 
308 - (void)addImageOverlayById:(NSString *)overlayId
309  X:(NSInteger)x
310  Y:(NSInteger)y
311  Z:(NSInteger)z
312  image:(UIImage *)image;
313 
314 #pragma mark 屏幕坐标转化
315 
316 - (void)convertCoorFromScreenX:(float)sX Y:(float)sY toMercatorX:(double *)mX Y:(double *)mY Z:(double *)mZ;
317 @end
318 
float getPanoramaHeading()
BaiduPanoramaType
id< BaiduPanoramaViewDelegate > delegate
ImageDefinition
BaiduPanoError
float getPanoramaZoomLevel()