Minh Nguyễn e16ce7d879 Localize expressions more thoroughly (#11651)
* [ios] Removed changelog entry for Terrarium

The broader feature is new to v4.0.0 as well.

* [ios, macos] Localize expressions more thoroughly

Replaced the MGLStyle.localizesLabels property with a -localizeLabelsIntoLocale: method that allows the caller to specify the locale to localize into. Also exposed a per-expression localization method for developers who want to vary behavior from layer to layer.

* [macos] Offer English labels if preferred language is unsupported

* [ios, macos] Removed dead code

* [ios] Use new localization method in iosapp

* [ios, macos] Fixed local name labels

* [ios, macos] Convert tokens to key path expressions in stop dictionaries

* [ios, macos] Streamlined token upgrading

Separated token upgrading into a separate process that only happens as part of the MGLSymbolStyleLayer.text and MGLSymbolStyleLayer.iconImageName properties’ getters, so that it’s easy to remove later when mbgl changes obviate this workaround. Removed the replacesTokens parameter to the expression localization methods.

* [ios, macos] Preserve whitespace between tokens

* [ios, macos] Moved token replacement to a consistent category

Fixed a build warning.

* [ios, macos] Replace tokens in all string-typed getters

For consistency, replace tokens with key paths in all string-typed style paint and layout properties.

* [ios, macos] Test token replacement

Added tests for replacement of tokens with key paths in expressions. Fixed token replacement for raw strings in stop dictionaries. Avoid sticking a single string inside an mgl_join: call.

* [ios, macos] Test token replacement, localization

Added unit tests of token replacement and localization of expressions. Only NSExpression is responsible for resolving the preferred language now, since NSLocale tends to tack a region code onto the locale identifier and the NSExpression method can be called independently anyways. Added a private variation of +[MGLVectorTileSource preferredMapboxStreetsLanguage] that takes an array of preferred languages. Fixed localization of non-expressions in stop dictionaries.

* [ios, macos] Dictionary keys aren’t necessarily zoom levels
2018-04-16 15:24:33 -07:00
2018-01-22 08:51:15 -08:00
2017-03-30 03:44:56 -07:00
2016-03-31 15:45:51 -04:00
2018-01-03 18:41:25 +01:00
2018-03-26 18:08:03 -04:00

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 Circle CI build status Coverage Status
Mapbox Maps SDK for Android Java Circle CI build status
Mapbox Maps SDK for iOS Objective-C or Swift Circle CI build status
Mapbox Maps SDK for macOS Objective-C, Swift, or AppleScript Circle CI build status
node-mapbox-gl-native Node.js Circle CI build status
Mapbox Qt SDK C++03 Circle CI build status AppVeyor CI build status

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:

FOSSA Status

Description
No description provided
Readme 702 MiB
Languages
C++ 54%
Kotlin 11.8%
Java 11%
Objective-C++ 9.7%
Objective-C 5.8%
Other 7.5%