Mapfit iOS SDK
特性
- 创建地图
- 向地图添加标记
要求
- iOS 11.0+
- Xcode 9
安装
CocoaPods
您可以使用 CocoaPods 通过将其添加到您的 Podfile
中来安装 Mapfit
platform :ios, '11.0'
use_frameworks!
pod 'Mapfit'
使用示例
import Mapfit
设置您的API密钥
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
MFTManager.sharedManager.apiKey = "API_KEY"
return true
}
}
创建您的地图
let mapView = MFTMapView(frame: view.bounds)
view.addSubview(mapView)
向您的地图添加标记
let marker = mapView.addMarker(position: CLLocationCoordinate2D(latitude: 40.74699, longitude: -73.98742))