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 at the root of the project's app bundle.
AirMap exposes an
AirMapMapView, which exposes methods that allow you to configure the map with Rulesets.
AirMapMapView is a subclass of
MGLMapView, which is apart of the Mapbox SDK for iOS. 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. Various subspecs are available including AirMap/Core, AirMap/Traffic, AirMap/Telemetry, and AirMap/UI:
Check SDK Releases for latest version
# ... pod 'AirMapSDK', :git => 'https://github.com/airmap/AirMapSDK-Swift', :tag => '2.0.0.beta.2' # ... post_install do |installer| # List of Pods to use as Swift 3.2 swift3targets = ['Lock', 'SwiftMQTT'] 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 use the AirMap SDK within your code, add the following import statement:
An example iOS and Mac App is avaialble in the the
features/rulesets branch of the AirMapSDK-Swift repository.
$ git clone https://github.com/AirMap/AirMapSDK-Swift.git $ cd AirMapSDK-Swift $ git checkout 2.0.0.beta.1
$ 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.