1. 访问 http://lbs.amap.com/console/key/。c++
注册高德开发者帐号,并认证成为开发者。(若已是开发者,可直接到步骤 3)api
在“KEY 管理”页面点击上方的“获取 key”按钮,依次输入应用名,选择绑定的服务为“iOS 平台 SDK”,输入 Bundle Identifierui
在“相关下载”页面中根据您的需求下载库文件并解压,包括:
3D矢量地图库,点击下载。解压后获得MAMapKit.framework文件。3D矢量地图效果优,可 查看 3D 楼块,功能全,还支持离线地图,能帮您节省流量。目前暂不支持地图多实例。编码
2D栅格地图库,点击下载。解压后获得MAMapKit.framework文件。2D栅格地图库体积小, 能耗低。支持地图多实例。spa
搜索库,点击下载。解压后获得AMapSearchKit.framework文件。搜索库功能包含:POI查询、 路径规划、地理编码和逆地理编码、公交查询以及输入提示语查询。code
注意:3D 矢量地图和 2D 栅格地图只能选择一个使用,接口相似。 blog
引入系统库 接口
UIKit.framework 开发
Foundation.framework it
CoreGraphics.framework
OpenGLES.framework
SystemConfiguration.framework
Security.framework
CoreLocation.framework
libstdc++.6.0.9.dylib
libz.dylib
QuartzCore.framework
CoreTelephony.framework
环境配置
在 TARGETS->Build Settings->Other Linker Flags 中添加-ObjC。
注意:V2.3.0(含)以前版本不支持 arm64,还需在 TARGETS->Build Settings->Architectures 点 出选择框,选择 “Other”,将默认值修改成 $(ARCHS_STANDARD_32_BIT)。
pod 'AMap3DMap' #3D 地图 SDK
pod 'AMap2DMap' #2D 地
pod 'AMapSearch' #搜索服务 SDK
[MAMapServices sharedServices].apiKey = @"用户 Key";
-(void) viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. //配置用户 Key [MAMapServices sharedServices].apiKey = @"用户 Key"; _mapView = [[MAMapView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), CGRectGetHeight(self.view.bounds))]; _mapView.delegate = self; [self.view addSubview:_mapView]; }
-(void) viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; // Do any additional setup after loading the view, typically from a nib. //配置用户 Key [MAMapServices sharedServices].apiKey = @"用户 Key"; _mapView = [[MAMapView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), CGRectGetHeight(self.view.bounds))]; _mapView.delegate = self; [self.view addSubview:_mapView]; }
具体实现能够下载demo模仿操做。