* Refactoring online file source so that tile server configuration is not hardcoded - part 1 * Added default templates * Update from master * Renaming MGLAccountManager to MGLSettings. Passing ResourceOptions and TileServerOptions to relevant classes and method in order to remove mapbox hardocded configuration * Fixing build * Addedm missing theme * Unit tests fixes * Fixing unit tests, adding factory methods for creating predefined configuration. * Fixing mapbox unit tests * Additional unit test fixes * Making MapboxConfiguration default * Making get/set resource options available in all classes that inherits from FileSource * Making get/set resource options available in all classes that inherits from FileSource - part 2 * Fixes for Android * Disable test coverage reports * Disable test coverage reports * Disable test coverage reports * Disable test coverage reports * Removing hardcoded configuration in iOS project - part 1 * Fixing wrong file extension, making use of tile server options. * Use apiKey and MGL_API_KEY everywhere * Just a rename * Re-enabling tests and improving MGLSettings init * Removing mapbox hardcoded configuration, using api key everywhere, implementing JNI conversion for TileServerOptions * Lint issues. * Integrating configurable tile server properties into Android SDK - part 2 * Removing mabox accounts * Exposing multiple configurations to Android SDK - bug fixes * Removing TileServerOptions from public interface - native methods dont work before mapbox-gl library is loaded * Adding support for configurable predefined styles * Migrating predefined styles in test app + cleanup * Parameter fix * Bug fixes * Fixing render test build * Fixing offline tester * Fixing benchmark tool * Fix: typo in method name * Adding code for public access to TileServerOptions * Bug fixes and debug code removal * Fixes for macOS, adding unit tests from MapLibre, removing redundant members from OnlineFileSource * Unit test fixes * MacOS test app - migrating to configurable tile server options, part 1 * Fixing offline maps * Migrating macOS test app to MapTiler * Minor improvements * Putting back apiKey test * Added unit tests for MapTiler configuration * Migrating test resources to MapTiler * minor fix * A few fixes * Fixing macOS tests, removing feedback functionality * Migrating ios test app to MapTiler * Migrating ui tests * UI tests fix * Benchmarking app fix * Cleanup and strings updates * Migrating benchmark app to maptiler * API key injection in benchmark app * Putting back release configuration * Additional tests and fixing issues identified by thread sanitizer. * Removing test filters * Fixes and addressing lint issues * More Maptiler tests + minro fix * Android instrumentation test migration to MapTiler. Exposing missing TileServerOptions in Android SDK. Minor fixes. * No requirements on API key format. * Fixing offline cache test tool * Adding configurable domain name for sources, adding source domain int MapTiler configuration, cleanup * Migrating tests to MapTiler, adding code for canonicalizing URLs, removing mapbox stuff from comments, cleanup * More tests * Updated database size * Lint issues * Fixed test * Updating developer config API key * Fixes for Android, propagaing updated tileServerOptions to native file sources, more tests * Just a few more fixes * Propagating updated settings to file sources + additional unit test * Lint issues * Removing test filter and fixing incorrect uri * Release preparation * macos release notes
MapLibre GL Native - Open-Source Mapbox GL Native
SDK for iOS, Android and other platforms
MapLibre GL Native is a community led fork derived from mapbox-gl-native prior to their switch to a non-OSS license. The fork also includes Maps SDK for iOS and MacOS (forked from mapbox-gl-native-ios) and Android SDK (forked from mapbox-gl-native-android). These platform-specific SDKs were merged under platform directory and they reference mapbox-gl-native directly, not as a submodule.
Beside merging in platform specific SDKs, the following changes were made compared to original mapbox projects:
- The code was upgraded so that it can be built using latest clang compiler / Xcode 12.
- CI/CD was migrated from CircleCI to GitHub Actions.
- Along with GitHub releases, binaries are distributed as follows:
- The iOS binaries distribution was upgraded from fat packages to Swift package containing XCFramework.
- The Android binaries are distributed to GitHub maven package repository.
The mapbox-gl-native was forked from d60fd30 - mgbl 1.6.0, mapbox-gl-native-ios from a139216 and mapbox-gl-native-android from 4c12fb2
Build Status
| SDK | Build | Build status |
|---|---|---|
| Maps SDK for iOS | CI | |
| Maps SDK for iOS | Release | |
| Maps SDK for Android | CI | |
| Maps SDK for Android | Release |
Installation
Android
-
Add bintray maven repositories to your build.gradle at project level so that you can access MapLibre packages for Android:
allprojects { repositories { ... mavenCentral() } }Note: Bintray was turn off May 1st, 2021 so we migrated all packages to maven central.
-
Add the library as a dependency into your module build.gradle
dependencies { ... implementation 'org.maplibre.gl:android-sdk:9.4.0' ... } -
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 MapLibre GitHub distribution URL (https://github.com/maplibre/maplibre-gl-native-distribution) or search for
maplibre-gl-nativepackage. -
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/maplibre/maplibre-gl-native.git
Build
MapLibre uses tags for its Android & iOS releases based on SemVer versioning. This is useful for checking out a particular released version for feature enhancments or debugging.
You can list available tags by issuing the command git tag, then use the result
# 1. Obtain a list of tags, which matches to release versions
git tag
# 2. Set a convenience variable with the desired TAG
# TAG=android-v9.2.1
# TAG=android-v9.4.2
TAG=ios-v5.11.0
# TAG=ios-v5.12.0-pre.1
# 3. Check out a particular TAG
git checkout tags/$TAG -b $TAG
# 4. build, debug or enhance features based on the tag
# clean, if you need to troubleshoot build dependencies by using `make clean`
Android
Make sure you have set Android SDK path in platform/android/local.properties, variable sdk.dir
cd platform/android
BUILDTYPE=Release make apackage
Binaries are produced in platform/android/MapboxGLAndroidSDK/build/outputs/aar/MapboxGLAndroidSDK-release.aar
Please refer to Mapbox Maps SDK for Android for detailed instructions.
iOS
You can run automated test on a Simulator or Device by changing to the Scheme iosapp and choosing Product > Test (or use ⌘-U). Use ⌘-9 to navigate to Reports to see results and browse through screenshots. This method of testing should work well with CI tools such as GitHub Actions, Xcode Server Bots, & AWS Device Farm.
cd platform/ios
# make and open the Xcode workspace
make iproj
# make Xcode workspace, but run in headless mode
make iproj CI=1
# Make Frameworks
make xcframework BUILDTYPE=Release
# test
make ios-test
# UITests
# You can review uitest results: $(IOS_OUTPUT_PATH)/Logs/Test
make ios-uitest
The packaging script will produce a platform/ios/build/ios/pkg/dynamic
Please refer to Mapbox Maps SDK for iOS for detailed instructions.
MacOS
cd platform/ios
make xpackage
This produces a Mapbox.framework in the platform/ios/build/macos/pkg/ folder.
Please refer to Mapbox Maps SDK for macos for detailed instructions.