Before this change, we've tried to open the database in read/write, but not create mode. In situations where the database didn't exist yet, this logged an error to the console, and we proceeded to opening it again in read/write/create mode, which actually created the file. The reason we did this is so that we could detect really old caching databases from January 2016 in case a developer upgraded from an older SDK (iOS v3.1 and earlier, Android v3.2 and earlier) that didn't have https://github.com/mapbox/mapbox-gl-native/pull/3715 yet. However, these error messages, while innocent, look scary in the console and some users suspect that it's a bug. This change opens the file directly in read/write/create mode, omitting the first failed attempt. To handle old cache databases, we're now deleting the `http_cache` table, which was the only table in those old databases, and create the new schema, rather than deleting the entire file and recreating the Database object. In most scenarios, this will lead to one fewer opening attempt, while the database migration will continue to work for the few users who upgrade all the way from a January 2016 SDK. Additionally, this fixes a mismatch between the Qt and non-Qt implementation: Qt doesn't support opening a file in read/write mode without the create flag. This means that we've seen a different control flow on Qt compared to the non-Qt implementation when opening a database.
Mapbox GL Native
A library for embedding interactive, customizable vector maps into native applications on multiple platforms. It takes stylesheets that conform to the Mapbox Style Specification, applies them to vector tiles that conform to the Mapbox Vector Tile Specification, and renders them using OpenGL. Mapbox GL JS is the WebGL-based counterpart, designed for use on the Web.
The Mapbox GL ecosystem
This repository hosts the cross-platform Mapbox GL Native library, plus convenient SDKs for several platforms. The cross-platform library comes with a GLFW-based demo application for Ubuntu Linux and macOS. The SDKs target the usual languages on their respective platforms:
| SDK | Languages | Build status |
|---|---|---|
| Mapbox GL Native | C++14 | |
| Mapbox Maps SDK for Android | Java | |
| Mapbox Maps SDK for iOS | Objective-C or Swift | |
| Mapbox Maps SDK for macOS | Objective-C, Swift, or AppleScript | |
| node-mapbox-gl-native | Node.js | |
| Mapbox Maps SDK for Qt | C++03 |
Additional Mapbox GL Native–based libraries for hybrid applications are developed outside of this repository:
| Toolkit | Android | iOS | Developer |
|---|---|---|---|
| React Native (npm) | ✅ | ✅ | Mapbox |
| Apache Cordova (npm) | ✅ | ✅ | Telerik |
| NativeScript (npm) | ✅ | ✅ | Telerik |
| Xamarin | ✅ | ✅ | Xamarin |
If your platform or hybrid application framework isn’t listed here, consider embedding Mapbox GL JS using the standard Web capabilities on your platform.
License
Mapbox GL Native is licensed under the 3-Clause BSD license. The licenses of its dependencies are tracked via FOSSA: