MapBox GL Native SDK Open-Source Fork
For iOS and Android
Build Status
| SDK | Build | Build status |
|---|---|---|
| Mapbox Maps SDK for iOS | CI | |
| Mapbox Maps SDK for iOS | Release | |
| Mapbox Maps SDK for Android | CI | |
| Mapbox Maps SDK for Android | Release |
Installation
Android
-
Add github maven repositories to your build.gradle at project level so that you can access MapTiler packages for Android:
allprojects { repositories { ... maven { url = "https://maven.pkg.github.com/maptiler/mapbox-gl-mobile" } } } -
Add the library as a dependency into your module build.gradle
dependencies { ... implementation 'com.maptiler.gl:android-sdk:9.2.1' ... } -
Sync gradle and rebuild your app
iOS
-
To add a package dependency to your Xcode project, select File > Swift Packages > Add Package Dependency and enter its repository URL. You can also navigate to your target’s General pane, and in the “Frameworks, Libraries, and Embedded Content” section, click the + button, select Add Other, and choose Add Package Dependency.
-
Either add MapTiler GitHub distribution URL (https://github.com/maptiler/maptiler-gl-mobile-distribution) or search for
maptiler-gl-mobilepackage. -
Choose "next". Xcode should clone the distribution repository and download the binaries.
Alternative installation
You can also download pre-build from releases in this repository.
How to create your own build
Source code checkout
git clone --recurse-submodules https://github.com/maptiler/mapbox-gl-mobile.git
Build
Android
Make sure you have set Android SDK path in mapbox-gl-native-android/local.properties, variable sdk.dir
cd mapbox-gl-native-android
BUILDTYPE=Release make apackage
Binaries are produced in mapbox-gl-native-android/MapboxGLAndroidSDK/build/outputs/aar/MapboxGLAndroidSDK-release.aar
Please refer to Mapbox Maps SDK for Android for detailed instructions.
iOS
cd mapbox-gl-native-ios
make xcframework BUILDTYPE=Release
The packaging script will produce a build/ios/pkg/dynamic
Please refer to Mapbox Maps SDK for iOS for detailed instructions.
MacOS
cd mapbox-gl-native-ios
make xpackage
This produces a Mapbox.framework in the build/macos/pkg/ folder.
Please refer to Mapbox Maps SDK for macos for detailed instructions.