为了让开发者获取更全面的全景信息,获取数据更加方便,全景sdk提供了相关全景数据获取。第一个接口是室内全景描述信息的获取。例如:走进一家酒店,可以根据此处的pid ,通过以下接口得到此酒店的内部全景信息。这其中还包括内景相册相关信息,内景相册是指酒店中不同区域的全景,例如大堂,厕所,客房等。
为了能够让开发者更好的理解根据poi获取全景相关的信息,sdk特意封装为对应的数据结构。
@property(assign, nonatomic) double x;@property(assign, nonatomic) double y;@property(copy, nonatomic)nsstring*type;@property(copy, nonatomic)nsstring*sdkversion;@property(assign, nonatomic) int errorcode;@property(copy, nonatomic)nsstring*desc;@property(assign, nonatomic)bool haspanorama;
@property(assign, nonatomic) double direction;@property(copy, nonatomic)nsstring*pid;@property(copy, nonatomic)nsstring*uid;@property(copy, nonatomic)nsstring*iid;@property(copy, nonatomic)nsstring*name;@property(copy, nonatomic)nsstring*std_tag;@property(assign, nonatomic)bool hasstreet;@property(assign, nonatomic)bool hasinterior;
@property(copy, nonatomic)nsstring*pid;@property(copy, nonatomic)nsstring*roadname;@property(copy, nonatomic)nsstring*mode;
/*** @abstract 通过uid获取该poi下的全景描述信息,以此来判断此uid下是否有全景* @param pid* @result json string*/(baidupoipanodata*)requestpanoramainfowithuid:(nsstring*)uid;/*** @abstract 通过墨卡托坐标获取坐标下全景的相关信息。* @param 墨卡托坐标 x 墨卡托坐标 y* @result baidulocationpanodata*/(baidulocationpanodata*)requestpanoramainfowithx:(double)x y:(double)y;/*** @abstract 通过经纬度获取经纬度下全景相关信息,例如pid,全景类型等* @param pid* @result baidulocationpanodata*/(baidulocationpanodata*)requestpanoramainfowithlon:(double)lon lat:(double)lat;
/*** @abstract 获取室内全景描述信息* @param pid 全景pid*/(nsstring*)requestpanoramaindoordatawithpid:(nsstring*)pid;
返回的json 数据如下:
{"content":[{"interinfo":{"breakid":"01002200001308170737146415c","breakx":1292584839,"breaky":484668334,"d_icon":1,"d_street":1,"d_uii":1,"defaultfloor":0, --------------------- 默认楼层"entrances":[--------------------- 内景的入口点信息{"breakid":"01002200001308170737146415c","breakx":1292584839,"breaky":484668334,"entrancename":"大觉寺","isdefault":1,"marker":{"x":1292582800,"y":484668300},"uid":"465d2bc55c987ed7102935a0"}],"filetag":"inter_cfg","floors":[--------------------- 内景的楼层信息,以及楼层的单点信息{"floor":0,"imgheight":0,"imgwidth":0,"ltpoint":{"x":0,"y":0},"name":"floor_0","northdir":180,"points":[{"pid":"0300220000131105191740485in","timeline":"2013","x":1292581230,"y":484668209,"importance":0,"movedir":196,"name":"无量寿佛殿","northdir":180,"pin":0,"rank":1,"ugc":""},{"pid":"0300220000131105191733483in","timeline":"2013","x":1292581230,"y":484668209,"importance":0,"movedir":95,"name":"迦陵舍利塔","northdir":180,"pin":0,"rank":1,"ugc":""},{"pid":"0300220000131105191736484in","timeline":"2013","x":1292581230,"y":484668209,"importance":0,"movedir":260,"name":"大明敕谕碑","northdir":180,"pin":0,"rank":1,"ugc":""}],"scale":0,"startid":"0300220000131105191740485in"}],"hasimg":0,"iid":"465d2bc55c987ed7102935a0","ipoint":{"x":1292581200,"y":484668200},"imagetype":0,"name":"大觉寺","parent":"","type":"inter","uid":"465d2bc55c987ed7102935a0","vppoint":{"x":1292582800,"y":484668300},"vprank":586},"panoinfo":{"admission":"gs(2014)6066","date":"20131105","deviceheight":1.45,"enters":[],"filetag":"pano_cfg","heading":90,"id":"0300220000131105191740485in","imglayer":[{"blockx":2,"blocky":1,"imgformat":"jpg","imglevel":1},{"blockx":4,"blocky":2,"imgformat":"jpg","imglevel":2},{"blockx":8,"blocky":4,"imgformat":"jpg","imglevel":3},{"blockx":16,"blocky":8,"imgformat":"jpg","imglevel":4}],"inters":[{"breakid":"01002200001308170737146415c","floor":0,"iid":"465d2bc55c987ed7102935a0","name":"大觉寺"}],"layercount":4,"mode":"day","movedir":196,"northdir":180,"photos":[--------------------- 相册信息{"floor":0,"name":"无量寿佛殿","pid":"0300220000131105191740485in"},{"floor":0,"name":"迦陵舍利塔","pid":"0300220000131105191733483in"},{"floor":0,"name":"大明敕谕碑","pid":"0300220000131105191736484in"}],"pitch":0,"provider":4,"rname":"大觉寺","roll":0,"switchid":[],"time":"2013","type":"inter","version":"0","x":1292581230,"y":484668209,"z":0,"format_v":"0","plane":"","procdate":"20140922"}}],"result":{"error":0}}
/*** @abstract 获取全景pid周边所有的推荐服务信息* @param pid 全景pid*/(nsstring*)requestpanoramarecommendationservicedatawithpid:(nsstring*)pid;
返回的json 数据如下:
{"content":[{"dir":279.207, --------------视角朝向"info":"出口", --------------全景名称"pid":"01002200001308261445121685x", ------------全景pid"panox":12955228,"panoy":4817158,"pitch":0,"type":3,"uid":"","weigh":40,"x":12955203,"y":4817158},{"dir":337,"floor":1,"info":"美甲区","pid":"0300220000131231101751974in","pitch":0,"type":1,"weigh":15,"x":12955943,"y":4818040},{"dir":179,"floor":1,"info":"正门","pid":"0300220000131231101751975in","pitch":0,"type":1,"weigh":14,"x":12955943,"y":4818040},{"dir":0,"floor":2,"info":"大厅1","pid":"0300220000131231101751971in","pitch":0,"type":1,"weigh":10,"x":12955943,"y":4818040},{"dir":102,"floor":2,"info":"大厅2","pid":"0300220000131231101751972in","pitch":0,"type":1,"weigh":9,"x":12955943,"y":4818040},{"dir":61,"floor":2,"info":"包房","pid":"0300220000131231101751970in","pitch":0,"type":1,"weigh":9,"x":12955943,"y":4818040},{"dir":9,"floor":2,"info":"大厅等待区","pid":"0300220000131231101751973in","pitch":0,"type":1,"weigh":9,"x":12955943,"y":4818040}],"result":{"error":0}}
上一篇
下一篇
本篇文章对您是否有帮助?