AirMapSDK-Swift library reads a JSON configuration file during initialization. This
airmap.config.json file can be downloaded from the AirMap Developer Portal and placed in the root of the project's app bundle.
AirMapMapView, which exposes methods that allow you to contextually configure the map.
AirMapMapView is a subclass of
MGLMapView, which is provided by the Mapbox SDK. Please sign up and request a Mapbox access token: https://www.mapbox.com/ios-sdk/#access_tokens
You can add this access token to your
The AirMapSDK-Swift library and its dependencies are available via CocoaPods or Carthage.
Always check the Github repo for the latest release versions: SDK Releases
The CocoaPods version is broken down into various subspecs including AirMapSDK/Core, AirMapSDK/Traffic, AirMapSDK/Telemetry, and AirMap/UI. To install all components, use AirMapSDK.
pod 'AirMapSDK', :git => 'https://github.com/airmap/AirMapSDK-Swift', :tag => '2.0.0.rc.3'
As the SDK uses a Swift 3 library, you will need to add the following at the end of your Podfile
post_install do |installer| # List of Pods to use as Swift 3.2 swift3targets = ['Lock'] installer.pods_project.targets.each do |target| if swift3targets.include? target.name target.build_configurations.each do |config| config.build_settings['SWIFT_VERSION'] = '3.2' end end end end
To install the iOS SDK using Carthage dependency management add the following to your Cartfile:
github "airmap/AirMapSDK-Swift" "2.0.0.rc.3"
To use the AirMap SDK within your code, add the following import statement:
An example iOS app is available in the AirMapSDK-Swift repository.
$ git clone https://github.com/AirMap/AirMapSDK-Swift.git $ cd AirMapSDK-Swift
$ cd Example $ pod install
$ open AirMapSDK.xcworkspace
Download your application's
airmap.config.json file from the AirMap Developer Portal and set the Mapbox access token.
Add the configuration file to the root of the project.