Fengmap iOS SDK

下载SDK 配置SDK
三维室内地图 iOS SDK v2.5.20版本发布!
indoormaps

为您的iOS应用程序加入3D室内地图 Fengmap iOS SDK是一套基于iOS 8.0及以上版本设备的应用程序接口。您可以使用该SDK开发适用于iOS系统移动设备的室内地图应用,通过调用地图SDK接口,您可以轻松访问蜂鸟的地图服务和数据,构建功能丰富、交互性强的室内地图类应用程序。

map
地图显示与操作
map
覆盖物
map
查询与分析
map
路径与导航

功能体验

// 离线地图加载
// NSString *dataPath = [[NSBundle mainBundle] pathForResource:@"10347" ofType:@"fmap"];
// _mapView = [[FMKMapView alloc] initWithFrame:CGRectMake(0, 64,
// [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height-64)
// path:dataPath delegate:self];
// [self.view addSubview:_mapView];

// 在线地图加载
_mapView = [[FMKMapView alloc] initWithFrame:CGRectMake(0, 64,
[UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height-64)
ID:@"10347" delegate:self autoUpgrade:YES];
[self.view addSubview:_mapView];

// 离线主题加载
// NSBundle *fmBundle = [NSBundle bundleWithPath: [[[NSBundle mainBundle] resourcePath]
 stringByAppendingPathComponent:@"FMBundle.bundle"]];
// [_mapView setThemeWithLocalPath:[fmBundle pathForResource:@"2001.theme" ofType:nil]];

// 在线主题加载
[_mapView setThemeWithID:@"1003"];
// 设置地图焦点层
 [_mapView setFocusByGroupID:@"1" animated:YES];

// 多楼层显示地图,地图加载默认显示第一层
// 设置楼层id数组为 所有楼层id(即多层显示)
_mapView.displayGroupIDs = _mapView.map.groupIDs;
// 设置焦点层为第一层 (焦点层不透明,非焦点层透明显示); 可以选择切换时是否显示动画效果
[_mapView setFocusByGroupID:@"1" animated:NO];

/*
// 单楼层显示地图,地图加载默认显示第一层
// 设置楼层id数组为 某一楼层组成的数组
_mapView.displayGroupIDs = @[@"1"];
 */
// 获取地图上某一点
// 投影坐标点
FMKMapPoint point = FMKMapPointMake((_mapView.map.info.maxX+_mapView.map.info.minX)/2,
(_mapView.map.info.maxY+_mapView.map.info.minY)/2);
// 地理楼层坐标点
FMKGeoCoord coord = FMKGeoCoordMake(1, point);

// 初始化图片标注层
_imageLayer = [[FMKImageLayer alloc] initWithGroupID:@"1"];
// 将图片标注层添加到地图上
[_mapView.map addLayer:_imageLayer];

// 初始化图片标注
_imageMarker = [[FMKImageMarker alloc] initWithImage:[UIImage imageNamed:@"blueImageMarker"]
Coord:point];
// 设置图片标注大小
_imageMarker.imageSize = CGSizeMake(30, 30);
// 设置图片标注位于地图上的位置
_imageMarker.offsetMode = FMKImageMarker_MODELTOP;
// 添加图片标注物到图片标注层
[_imageLayer addMarker:_imageMarker];


// 初始化文本标注层
_textLayer = [[FMKTextLayer alloc] initWithGroupID:@"1"];
// 将文本标注层添加到地图上
[_mapView.map addLayer:_textLayer];

// 初始化文本标注
_textMarker = [[FMKTextMarker alloc] initWithTextContent:@"这是一个文本标注" coord:point];
// 设置文本位于地图上的位置
_textMarker.offsetMode = FMKTextMarker_MODELTOP;
_textMarker.fontSize = 20;
_textMarker.textColor = [UIColor redColor];
// 添加文本标注到文本标注层
[_textLayer addMarker:_textMarker];


// 初始化定位标注
_locationMarker = [[FMKLocationMarker alloc] initWithPointerImageName:@"active.png" DomeImageName:@""];
// 添加定位标注到定位标注层(必须先添加,然后设置定位标注的大小和位置,否则设置无效!)
// 地图定位标注层 _mapView.map.locationLayer (直接获取 ,不支持创建)
[_mapView.map. addMarker:_locationMarker];
_locationMarker.size = CGSizeMake(30, 30);
// 模拟定位
[_locationMarker locateWithGeoCoord:coord];
// 更新定位方向
[_locationMarker updateRotate:90];
// 初始化搜索分析
_searchAnalyser = [[FMKSearchAnalyser alloc] initWithDataPath:dataPath];
_searchAnalyser.delegate = self;

// 创建模型请求体
FMKModelSearchRequest *modelRequest = [[FMKModelSearchRequest alloc] init];
// 查询关键字
modelRequest.keywords = @"火锅";
// 通过关键字进行查询
[_searchAnalyser executeFMKSearchRequestByKeyWords:modelRequest];

// 创建公共设施请求体
FMKFacilitySearchRequest *facilityRequest = [[FMKFacilitySearchRequest alloc] init];
// 查询类型
facilityRequest.type = @"170006";
// 通过类型进行查询
[_searchAnalyser executeFMKSearchRequestByType:facilityRequest];
// 通过地图数据路径初始化路径分析
NSString *dataPath = [[NSBundle mainBundle] pathForResource:@"10347" ofType:@"fmap"];
_naviAnalyser = [[FMKNaviAnalyser alloc] initWithMapPath:dataPath];

// result:保存路径规划得到的点
NSMutableArray *result = [NSMutableArray array];
// 路径分析类型设置
FMKRouteSetting routeSetting;
routeSetting.naviModule = MODULE_BEST;
routeSetting.routeCrossGroupPriority = FMKROUTE_CGP_DEFAULT;
// 进行路径计算分析
FMKRouteCalculateResultType type = [_naviAnalyser analyseRouteWithStartCoord:start end:end
type:routeSetting routeResult:&result];
//若分析结果不成功,直接返回
if (type == IROUTE_SUCCESS) {
    // 初始化线标注
    FMKLineMarker* line = [[FMKLineMarker alloc] init];
    for (FMKNaviResult* navi in result) {
        //利用分析结果添加segment
        FMKSegment* segment = [[FMKSegment alloc] initWithGroupID:navi.groupID pointArray:
        navi.pointArray];
        //在直线中添加segment
        [line addSegment:segment];
    }
    // 添加线
    [_mapView.map.lineLayer addMarker:line];
}

账号与Key 首先请注册成为蜂鸟云用户,成为平台用户您可以访问蜂鸟云控制台,并且创建您的iOS应用和Key。

获取密钥(Key)
注册蜂鸟云账号
创建您的应用项目
获取SDK Key

关于Fengmap iOS SDK 1、蜂鸟三维地图SDK永久免费,任何应用及网站都可以使用。您需要先申请Key,才能正常使用SDK,有关详情请参阅《蜂鸟云服务条款》
2、蜂鸟三维地图iOS SDK V2.0.0及以上版本与V1.2.0版本不兼容,建议升级为V2.0.0以上版本,有关详情请参考版本升级帮助。
3、iOS SDK 历史版本、开发手册请通过相关下载开发手册查看和下载。