Update style spec references (#1150)
This commit is contained in:
@@ -28,7 +28,7 @@ Code and build scripts belonging to platform SDKs are contained in the `platform
|
||||
- iOS SDK runs benchmark test through a separate app named `BenchmarkApp`.
|
||||
- Android SDK does not have benchmark test.
|
||||
- `bin` contains the code for tools like `mbgl-cache`, `mbgl-offline`, and `mbgl-render`.
|
||||
- `expression-test` contains tests for the expression feature in the map style (see more details about expression [here](https://maplibre.org/maplibre-gl-js-docs/style-spec/expressions/).
|
||||
- `expression-test` contains tests for the expression feature in the map style (see more details about expression [here](https://maplibre.org/maplibre-style-spec/expressions/).
|
||||
- `metrics` contains test manifest files and ground truth for graphic comparison based render test.
|
||||
- `misc` contains protobuf for style, vector tile, and glyphs. It also icons and pictures used in documents.
|
||||
- `render-test` contains image diff based render tests. These tests verify if the rendering results match with expectations by capturing the rendering results and compare with the groundtruth images in the `metrics` directory.
|
||||
@@ -77,7 +77,7 @@ See the relevant platform-specific `README.md` / `INSTALL.md` for details.
|
||||
## Map
|
||||
## Style
|
||||
|
||||
The "Style" component of MapLibre Native contains an implementation of the [Mapbox Style Specification](https://www.mapbox.com/mapbox-gl-style-spec/), defining what data to draw, the order to draw it in, and how to style the data when drawing it.
|
||||
The "Style" component of MapLibre Native contains an implementation of the [MapLibre Style Spec](https://maplibre.org/maplibre-style-spec/), defining what data to draw, the order to draw it in, and how to style the data when drawing it.
|
||||
|
||||
In addition to supporting styles loaded from a URL, MapLibre Native includes a runtime styling API, which allows users to dynamically modify the current style: add and remove layers, modify layer properties, and so on. As appropriate for a C++ API, the runtime styling API API is _strongly typed_: there are subclasses for each layer type, with correctly-typed accessors for each style property. This results in a large API surface area. Fortunately, this is automated, by generating the API – and the regular portion of the implementation – from the style specification.
|
||||
|
||||
@@ -92,7 +92,7 @@ For each subclass of `Layer` or source, there's a corresponding `Impl` subclass.
|
||||
|
||||
The `Layer::Impl` and `Source::Impl` reference held by `Layer` and `Source` base classes is _immutable_: it's a shared reference to a `const` (read only) pointer. Immutability permits the `Impl` objects to be shared safely between threads when needed -- for example, between the main thread and worker thread that performs computation in the background, or between the main thread and a dedicated renderer thread. See the "Threading" section below for further details on the threading model.
|
||||
|
||||
Immutability is an alternative to several other strategies for safe intra-thread communication. One alternative strategy is to insert locks whenever data is shared between threads and at least one thread may be modifying the data. This strategy is prone to problems such as race conditions (if you forget to use a lock), deadlocks (if locks are acquired in conflicting orders), and poor performance due to lock contention. Another strategy is to copy data whenever it's needed by another thread. For complex structures such as a Mapbox Style, copying can be an expensive operation. With immutability, the approach is to share data without copying, but ensure that any data so shared cannot be modified by any thread, and that the data is not destroyed until the last thread using it relinquishes its reference.
|
||||
Immutability is an alternative to several other strategies for safe intra-thread communication. One alternative strategy is to insert locks whenever data is shared between threads and at least one thread may be modifying the data. This strategy is prone to problems such as race conditions (if you forget to use a lock), deadlocks (if locks are acquired in conflicting orders), and poor performance due to lock contention. Another strategy is to copy data whenever it's needed by another thread. For complex structures such as a MapLibre Style, copying can be an expensive operation. With immutability, the approach is to share data without copying, but ensure that any data so shared cannot be modified by any thread, and that the data is not destroyed until the last thread using it relinquishes its reference.
|
||||
|
||||
Immutability is implemented by the `Immutable<T>` template, which acts as a non-nullable shared reference to a `const T`. It has behavior similar to `std::shared_ptr<const T>`, but indicates its intent as an immutable reference that is safe to share between threads.
|
||||
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
*[MapLibre Native](https://github.com/maplibre/maplibre-native)* is a community led fork of *Mapbox GL Native*. It's a C++ library that powers
|
||||
vector maps in native applications on multiple platforms by taking stylesheets that conform to the *MapLibre Style Specification,* a fork of the
|
||||
Mapbox Style Specification. Since it is derived from Mapbox's original work it also uses *Mapbox Vector Tile Specification* as its choice of vector tile format.
|
||||
MapLibre Style Spec. Since it is derived from Mapbox's original work it also uses *Mapbox Vector Tile Specification* as its choice of vector tile format.
|
||||
|
||||
@@ -88,8 +88,8 @@ struct LayerTypeInfo {
|
||||
};
|
||||
|
||||
/**
|
||||
* The runtime representation of a [layer](https://www.mapbox.com/mapbox-gl-style-spec/#layers)
|
||||
* from the Mapbox Style Specification.
|
||||
* The runtime representation of a [layer](https://maplibre.org/maplibre-style-spec/#layers)
|
||||
* from the MapLibre Style Spec.
|
||||
*
|
||||
* `Layer` is an abstract base class; concrete derived classes are provided for
|
||||
* each layer type. `Layer` contains functionality that is common to all layer types:
|
||||
|
||||
@@ -26,7 +26,7 @@ struct LayerTypeInfo;
|
||||
|
||||
/**
|
||||
* The runtime representation of a
|
||||
* [source](https://maplibre.org/maplibre-gl-js-docs/style-spec/sources/) from
|
||||
* [source](https://maplibre.org/maplibre-style-spec/sources/) from
|
||||
* the MapLibre Style Specification.
|
||||
*
|
||||
* `Source` is an abstract base class; concrete derived classes are provided for
|
||||
|
||||
@@ -158,7 +158,7 @@ public final class LocationComponent {
|
||||
|
||||
/**
|
||||
* Indicates if Mapbox components are ready to be interacted with. This can differ from {@link #isComponentStarted}
|
||||
* if the Mapbox style is being reloaded.
|
||||
* if the MapLibre style is being reloaded.
|
||||
*/
|
||||
private boolean isLayerReady;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import static com.mapbox.mapboxsdk.utils.ColorUtils.rgbaToColor;
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#layers-location-indicator">The online documentation</a>
|
||||
* @see <a href="https://maplibre.org/maplibre-style-spec/#layers-location-indicator">The online documentation</a>
|
||||
*/
|
||||
@UiThread
|
||||
class LocationIndicatorLayer extends Layer {
|
||||
|
||||
@@ -15,7 +15,7 @@ import static com.mapbox.mapboxsdk.utils.ColorUtils.colorToRgbaString;
|
||||
/**
|
||||
* Constructs paint/layout properties for Layers
|
||||
*
|
||||
* @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#layers">Layer style documentation</a>
|
||||
* @see <a href="https://maplibre.org/maplibre-style-spec/#layers">Layer style documentation</a>
|
||||
*/
|
||||
class LocationPropertyFactory {
|
||||
|
||||
|
||||
@@ -30,31 +30,31 @@ public final class Resource {
|
||||
public static final int STYLE = 1;
|
||||
|
||||
/**
|
||||
* TileJSON file as specified in https://maplibre.org/maplibre-gl-js-docs/style-spec/#root-sources
|
||||
* TileJSON file as specified in https://maplibre.org/maplibre-style-spec/root/#sources
|
||||
*/
|
||||
public static final int SOURCE = 2;
|
||||
|
||||
/**
|
||||
* A vector or raster tile as described in the style sheet at
|
||||
* https://maplibre.org/maplibre-gl-js-docs/style-spec/#sources
|
||||
* https://maplibre.org/maplibre-style-spec/sources/
|
||||
*/
|
||||
public static final int TILE = 3;
|
||||
|
||||
/**
|
||||
* Signed distance field glyphs for text rendering. These are the URLs specified in the style
|
||||
* in https://maplibre.org/maplibre-gl-js-docs/style-spec/#root-glyphs
|
||||
* in https://maplibre.org/maplibre-style-spec/root/#glyphs
|
||||
*/
|
||||
public static final int GLYPHS = 4;
|
||||
|
||||
/**
|
||||
* Image part of a sprite sheet. It is constructed of the prefix in
|
||||
* https://maplibre.org/maplibre-gl-js-docs/style-spec/#root-sprite and a PNG file extension.
|
||||
* https://maplibre.org/maplibre-style-spec/root/#sprite and a PNG file extension.
|
||||
*/
|
||||
public static final int SPRITE_IMAGE = 5;
|
||||
|
||||
/**
|
||||
* JSON part of a sprite sheet. It is constructed of the prefix in
|
||||
* https://maplibre.org/maplibre-gl-js-docs/style-spec/#root-sprite and a JSON file extension.
|
||||
* https://maplibre.org/maplibre-style-spec/root/#sprite and a JSON file extension.
|
||||
*/
|
||||
public static final int SPRITE_JSON = 6;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -12,7 +12,7 @@ import static com.mapbox.mapboxsdk.utils.ColorUtils.rgbaToColor;
|
||||
/**
|
||||
* The background color or pattern of the map.
|
||||
*
|
||||
* @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#layers-background">The online documentation</a>
|
||||
* @see <a href="https://maplibre.org/maplibre-style-spec/#layers-background">The online documentation</a>
|
||||
*/
|
||||
@UiThread
|
||||
public class BackgroundLayer extends Layer {
|
||||
|
||||
@@ -16,7 +16,7 @@ import static com.mapbox.mapboxsdk.utils.ColorUtils.rgbaToColor;
|
||||
/**
|
||||
* A filled circle.
|
||||
*
|
||||
* @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#layers-circle">The online documentation</a>
|
||||
* @see <a href="https://maplibre.org/maplibre-style-spec/#layers-circle">The online documentation</a>
|
||||
*/
|
||||
@UiThread
|
||||
public class CircleLayer extends Layer {
|
||||
|
||||
@@ -16,7 +16,7 @@ import static com.mapbox.mapboxsdk.utils.ColorUtils.rgbaToColor;
|
||||
/**
|
||||
* An extruded (3D) polygon.
|
||||
*
|
||||
* @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#layers-fill-extrusion">The online documentation</a>
|
||||
* @see <a href="https://maplibre.org/maplibre-style-spec/#layers-fill-extrusion">The online documentation</a>
|
||||
*/
|
||||
@UiThread
|
||||
public class FillExtrusionLayer extends Layer {
|
||||
|
||||
@@ -16,7 +16,7 @@ import static com.mapbox.mapboxsdk.utils.ColorUtils.rgbaToColor;
|
||||
/**
|
||||
* A filled polygon with an optional stroked border.
|
||||
*
|
||||
* @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#layers-fill">The online documentation</a>
|
||||
* @see <a href="https://maplibre.org/maplibre-style-spec/#layers-fill">The online documentation</a>
|
||||
*/
|
||||
@UiThread
|
||||
public class FillLayer extends Layer {
|
||||
|
||||
@@ -16,7 +16,7 @@ import static com.mapbox.mapboxsdk.utils.ColorUtils.rgbaToColor;
|
||||
/**
|
||||
* A heatmap.
|
||||
*
|
||||
* @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#layers-heatmap">The online documentation</a>
|
||||
* @see <a href="https://maplibre.org/maplibre-style-spec/#layers-heatmap">The online documentation</a>
|
||||
*/
|
||||
@UiThread
|
||||
public class HeatmapLayer extends Layer {
|
||||
|
||||
@@ -12,7 +12,7 @@ import static com.mapbox.mapboxsdk.utils.ColorUtils.rgbaToColor;
|
||||
/**
|
||||
* Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.
|
||||
*
|
||||
* @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#layers-hillshade">The online documentation</a>
|
||||
* @see <a href="https://maplibre.org/maplibre-style-spec/#layers-hillshade">The online documentation</a>
|
||||
*/
|
||||
@UiThread
|
||||
public class HillshadeLayer extends Layer {
|
||||
|
||||
@@ -16,7 +16,7 @@ import static com.mapbox.mapboxsdk.utils.ColorUtils.rgbaToColor;
|
||||
/**
|
||||
* A stroked line.
|
||||
*
|
||||
* @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#layers-line">The online documentation</a>
|
||||
* @see <a href="https://maplibre.org/maplibre-style-spec/#layers-line">The online documentation</a>
|
||||
*/
|
||||
@UiThread
|
||||
public class LineLayer extends Layer {
|
||||
|
||||
@@ -12,7 +12,7 @@ import static com.mapbox.mapboxsdk.utils.ColorUtils.colorToRgbaString;
|
||||
/**
|
||||
* Constructs paint/layout properties for Layers
|
||||
*
|
||||
* @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#layers">Layer style documentation</a>
|
||||
* @see <a href="https://maplibre.org/maplibre-style-spec/#layers">Layer style documentation</a>
|
||||
*/
|
||||
public class PropertyFactory {
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import androidx.annotation.UiThread;
|
||||
/**
|
||||
* Raster map textures such as satellite imagery.
|
||||
*
|
||||
* @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#layers-raster">The online documentation</a>
|
||||
* @see <a href="https://maplibre.org/maplibre-style-spec/#layers-raster">The online documentation</a>
|
||||
*/
|
||||
@UiThread
|
||||
public class RasterLayer extends Layer {
|
||||
|
||||
@@ -17,7 +17,7 @@ import static com.mapbox.mapboxsdk.utils.ColorUtils.rgbaToColor;
|
||||
/**
|
||||
* An icon or a text label.
|
||||
*
|
||||
* @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#layers-symbol">The online documentation</a>
|
||||
* @see <a href="https://maplibre.org/maplibre-style-spec/#layers-symbol">The online documentation</a>
|
||||
*/
|
||||
@UiThread
|
||||
public class SymbolLayer extends Layer {
|
||||
|
||||
@@ -5,7 +5,7 @@ import androidx.annotation.Keep;
|
||||
/**
|
||||
* Resembles transition property from the style specification.
|
||||
*
|
||||
* @see <a href="https://maplibre.org/maplibre-gl-js-docs/style-spec/#transition">Transition documentation</a>
|
||||
* @see <a href="https://maplibre.org/maplibre-style-spec/transition/">Transition documentation</a>
|
||||
*/
|
||||
public class TransitionOptions {
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ import com.mapbox.mapboxsdk.style.layers.PropertyValue;
|
||||
/**
|
||||
* <%- doc %>
|
||||
*
|
||||
* @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#layers-<%- type %>">The online documentation</a>
|
||||
* @see <a href="https://maplibre.org/maplibre-style-spec/#layers-<%- type %>">The online documentation</a>
|
||||
*/
|
||||
@UiThread
|
||||
<% if (type === 'location-indicator') { -%>
|
||||
|
||||
@@ -26,7 +26,7 @@ import com.mapbox.mapboxsdk.style.layers.PropertyValue;
|
||||
/**
|
||||
* Constructs paint/layout properties for Layers
|
||||
*
|
||||
* @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#layers">Layer style documentation</a>
|
||||
* @see <a href="https://maplibre.org/maplibre-style-spec/#layers">Layer style documentation</a>
|
||||
*/
|
||||
<% if (locationIndicator) { -%>
|
||||
class LocationPropertyFactory {
|
||||
|
||||
@@ -15,7 +15,7 @@ import com.mapbox.mapboxsdk.utils.ThreadUtils;
|
||||
/**
|
||||
* The global light source.
|
||||
*
|
||||
* @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#light">The online documentation</a>
|
||||
* @see <a href="https://maplibre.org/maplibre-style-spec/#light">The online documentation</a>
|
||||
*/
|
||||
@UiThread
|
||||
public class Light {
|
||||
|
||||
@@ -19,7 +19,7 @@ import com.mapbox.mapboxsdk.utils.ThreadUtils;
|
||||
/**
|
||||
* The global light source.
|
||||
*
|
||||
* @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#light">The online documentation</a>
|
||||
* @see <a href="https://maplibre.org/maplibre-style-spec/#light">The online documentation</a>
|
||||
*/
|
||||
@UiThread
|
||||
public class Light {
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.mapbox.mapboxsdk.style.expressions.Expression.ExpressionLiteral
|
||||
*
|
||||
* @see GeoJsonSource
|
||||
*
|
||||
* @see [The online documentation](https://www.mapbox.com/mapbox-gl-style-spec/.sources-geojson)
|
||||
* @see [The online documentation](https://maplibre.org/maplibre-style-spec/.sources-geojson)
|
||||
*/
|
||||
class GeoJsonOptions : HashMap<String?, Any?>() {
|
||||
/**
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.util.*
|
||||
/**
|
||||
* GeoJson source, allows using FeatureCollections from Json.
|
||||
*
|
||||
* @see [the style specification](https://www.mapbox.com/mapbox-gl-style-spec/.sources-geojson)
|
||||
* @see [the style specification](https://maplibre.org/maplibre-style-spec/.sources-geojson)
|
||||
*/
|
||||
@UiThread
|
||||
class GeoJsonSource : Source {
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.net.URL
|
||||
* The geographic location of the raster image content, supplied with `LatLngQuad`,
|
||||
* can be non-axis aligned.
|
||||
*
|
||||
* * @see [the style specification](https://www.mapbox.com/mapbox-gl-style-spec/#sources-image)
|
||||
* * @see [the style specification](https://maplibre.org/maplibre-style-spec/#sources-image)
|
||||
*/
|
||||
@UiThread
|
||||
class ImageSource : Source {
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.net.URL
|
||||
/**
|
||||
* A raster DEM source.
|
||||
*
|
||||
* @see [The style specification](https://maplibre.org/maplibre-gl-js-docs/style-spec/.sources-raster-dem)
|
||||
* @see [The style specification](https://maplibre.org/maplibre-style-spec/.sources-raster-dem)
|
||||
*/
|
||||
|
||||
@UiThread
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.net.URL
|
||||
/**
|
||||
* Raster source, allows using raster tiles as source.
|
||||
*
|
||||
* @see [The style specification](https://www.mapbox.com/mapbox-gl-style-spec/.sources-raster)
|
||||
* @see [The style specification](https://maplibre.org/maplibre-style-spec/.sources-raster)
|
||||
*/
|
||||
class RasterSource : Source {
|
||||
/**
|
||||
|
||||
@@ -13,7 +13,7 @@ import kotlin.collections.ArrayList
|
||||
/**
|
||||
* Vector source, allows the use of vector tiles.
|
||||
*
|
||||
* @see [the style specification](https://www.mapbox.com/mapbox-gl-style-spec/.sources-vector)
|
||||
* @see [the style specification](https://maplibre.org/maplibre-style-spec/.sources-vector)
|
||||
*/
|
||||
@UiThread
|
||||
class VectorSource : Source {
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.util.*
|
||||
/**
|
||||
* Represents a string broken into sections annotated with separate formatting options.
|
||||
*
|
||||
* @see [Style specification](https://maplibre.org/maplibre-gl-js-docs/style-spec/.types-formatted)
|
||||
* @see [Style specification](https://maplibre.org/maplibre-style-spec/.types-formatted)
|
||||
*/
|
||||
@Keep
|
||||
class Formatted(vararg formattedSections: FormattedSection) {
|
||||
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
CTFontDescriptorRef createFontDescriptor(const FontStack& fontStack) {
|
||||
NSMutableArray *fontNames = [NSMutableArray arrayWithCapacity:fontStack.size() + fallbackFontNames.count];
|
||||
for (auto& fontName : fontStack) {
|
||||
// Per the Mapbox Style Specification, the text-font property comes
|
||||
// Per the MapLibre Style Spec, the text-font property comes
|
||||
// with these last resort fonts by default, but they shouldn’t take
|
||||
// precedence over any application or system fallback font that may
|
||||
// be more appropriate to the current device.
|
||||
|
||||
@@ -134,10 +134,10 @@ You set an `MLNMapView` object’s style either in code, by setting the
|
||||
`MLNMapView.styleURL` property, or in Interface Builder, by setting the “Style
|
||||
URL” inspectable. The URL must point to a local or remote style JSON file. The
|
||||
style JSON file format is defined by the
|
||||
[Mapbox Style Specification](https://www.mapbox.com/mapbox-gl-style-spec/). This
|
||||
[MapLibre Style Spec](https://maplibre.org/maplibre-style-spec/). This
|
||||
SDK supports the functionality defined by version 8 of the specification unless
|
||||
otherwise noted in the
|
||||
[style specification documentation](https://www.mapbox.com/mapbox-gl-style-spec/).
|
||||
[style specification documentation](https://maplibre.org/maplibre-style-spec/).
|
||||
|
||||
## Manipulating the style at runtime
|
||||
|
||||
@@ -269,7 +269,7 @@ In style JSON | In Objective-C | In Swift
|
||||
|
||||
Each property representing a layout or paint attribute is set to an
|
||||
`NSExpression` object. `NSExpression` objects play the same role as
|
||||
[expressions in the Mapbox Style Specification](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions),
|
||||
[expressions in the MapLibre Style Spec](https://maplibre.org/maplibre-style-spec/expressions/),
|
||||
but you create the former using a very different syntax. `NSExpression`’s format
|
||||
string syntax is reminiscent of a spreadsheet formula or an expression in a
|
||||
database query. See the
|
||||
|
||||
@@ -352,7 +352,7 @@ NSExpression(format: "MLN_LET(floorCount, 2, $floorCount + 1)")
|
||||
|
||||
## Mapbox-specific functions
|
||||
|
||||
For compatibility with the Mapbox Style Specification, the following functions
|
||||
For compatibility with the MapLibre Style Spec, the following functions
|
||||
are defined by this SDK. When setting a style layer property, you can call these
|
||||
functions just like the predefined functions above, using either the
|
||||
`+[NSExpression expressionForFunction:arguments:]` method or a convenient format
|
||||
@@ -431,8 +431,8 @@ expression containing the strings to concatenate.
|
||||
Returns the arccosine of the number.
|
||||
|
||||
This function corresponds to the
|
||||
[`acos`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-acos)
|
||||
operator in the Mapbox Style Specification.
|
||||
[`acos`](https://maplibre.org/maplibre-style-spec/expressions/#acos)
|
||||
operator in the MapLibre Style Spec.
|
||||
|
||||
### `mgl_asin:`
|
||||
|
||||
@@ -446,8 +446,8 @@ operator in the Mapbox Style Specification.
|
||||
Returns the arcsine of the number.
|
||||
|
||||
This function corresponds to the
|
||||
[`asin`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-asin)
|
||||
operator in the Mapbox Style Specification.
|
||||
[`asin`](https://maplibre.org/maplibre-style-spec/expressions/#asin)
|
||||
operator in the MapLibre Style Spec.
|
||||
|
||||
### `mgl_atan:`
|
||||
|
||||
@@ -461,8 +461,8 @@ operator in the Mapbox Style Specification.
|
||||
Returns the arctangent of the number.
|
||||
|
||||
This function corresponds to the
|
||||
[`atan`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-atan)
|
||||
operator in the Mapbox Style Specification.
|
||||
[`atan`](https://maplibre.org/maplibre-style-spec/expressions/#atan)
|
||||
operator in the MapLibre Style Spec.
|
||||
|
||||
### `mgl_cos:`
|
||||
|
||||
@@ -476,8 +476,8 @@ operator in the Mapbox Style Specification.
|
||||
Returns the cosine of the number.
|
||||
|
||||
This function corresponds to the
|
||||
[`cos`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-cos)
|
||||
operator in the Mapbox Style Specification.
|
||||
[`cos`](https://maplibre.org/maplibre-style-spec/expressions/#cos)
|
||||
operator in the MapLibre Style Spec.
|
||||
|
||||
### `mgl_log2:`
|
||||
|
||||
@@ -491,8 +491,8 @@ operator in the Mapbox Style Specification.
|
||||
Returns the base-2 logarithm of the number.
|
||||
|
||||
This function corresponds to the
|
||||
[`log2`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-log2)
|
||||
operator in the Mapbox Style Specification.
|
||||
[`log2`](https://maplibre.org/maplibre-style-spec/expressions/#log2)
|
||||
operator in the MapLibre Style Spec.
|
||||
|
||||
### `mgl_round:`
|
||||
|
||||
@@ -507,8 +507,8 @@ Returns the number rounded to the nearest integer. If the number is halfway
|
||||
between two integers, this function rounds it away from zero.
|
||||
|
||||
This function corresponds to the
|
||||
[`round`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-round)
|
||||
operator in the Mapbox Style Specification.
|
||||
[`round`](https://maplibre.org/maplibre-style-spec/expressions/#round)
|
||||
operator in the MapLibre Style Spec.
|
||||
|
||||
### `mgl_sin:`
|
||||
|
||||
@@ -522,8 +522,8 @@ operator in the Mapbox Style Specification.
|
||||
Returns the sine of the number.
|
||||
|
||||
This function corresponds to the
|
||||
[`sin`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-sin)
|
||||
operator in the Mapbox Style Specification.
|
||||
[`sin`](https://maplibre.org/maplibre-style-spec/expressions/#sin)
|
||||
operator in the MapLibre Style Spec.
|
||||
|
||||
### `mgl_tan:`
|
||||
|
||||
@@ -537,8 +537,8 @@ operator in the Mapbox Style Specification.
|
||||
Returns the tangent of the number.
|
||||
|
||||
This function corresponds to the
|
||||
[`tan`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-tan)
|
||||
operator in the Mapbox Style Specification.
|
||||
[`tan`](https://maplibre.org/maplibre-style-spec/expressions/#tan)
|
||||
operator in the MapLibre Style Spec.
|
||||
|
||||
### `mgl_distanceFrom:`
|
||||
|
||||
@@ -553,7 +553,7 @@ Returns the straight-line distance from the evaluated object to the given shape.
|
||||
|
||||
This function corresponds to the
|
||||
[`distance`](https://docs.mapbox.com/mapbox-gl-js/style-spec/expressions/#distance)
|
||||
operator in the Mapbox Style Specification.
|
||||
operator in the MapLibre Style Spec.
|
||||
|
||||
### `mgl_coalesce:`
|
||||
|
||||
@@ -567,8 +567,8 @@ operator in the Mapbox Style Specification.
|
||||
Returns the first non-`nil` value from an array of expressions.
|
||||
|
||||
This function corresponds to the
|
||||
[`coalesce`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-coalesce)
|
||||
operator in the Mapbox Style Specification.
|
||||
[`coalesce`](https://maplibre.org/maplibre-style-spec/expressions/#coalesce)
|
||||
operator in the MapLibre Style Spec.
|
||||
|
||||
### `mgl_attributed:`
|
||||
|
||||
@@ -591,8 +591,8 @@ with the `MLNSymbolStyleLayer.text` property.
|
||||
`MLNFontColorAttribute` | An `NSExpression` evaluating to an `UIColor` (iOS) or `NSColor` (macOS).
|
||||
|
||||
This function corresponds to the
|
||||
[`format`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-types-format)
|
||||
operator in the Mapbox Style Specification.
|
||||
[`format`](https://maplibre.org/maplibre-style-spec/expressions/#types-format)
|
||||
operator in the MapLibre Style Spec.
|
||||
|
||||
### `MLN_LET`
|
||||
|
||||
@@ -640,8 +640,8 @@ values.
|
||||
This function corresponds to the
|
||||
`+[NSExpression(MLNAdditions) mgl_expressionForMatchingExpression:inDictionary:defaultExpression:]`
|
||||
method and the
|
||||
[`match`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-match)
|
||||
operator in the Mapbox Style Specification.
|
||||
[`match`](https://maplibre.org/maplibre-style-spec/expressions/#match)
|
||||
operator in the MapLibre Style Spec.
|
||||
|
||||
### `MLN_IF`
|
||||
|
||||
@@ -667,8 +667,8 @@ passed into this function must be wrapped in a constant expression.
|
||||
This function corresponds to the
|
||||
`+[NSExpression(MLNAdditions) mgl_expressionForConditional:trueExpression:falseExpresssion:]`
|
||||
method and the
|
||||
[`case`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-case)
|
||||
operator in the Mapbox Style Specification.
|
||||
[`case`](https://maplibre.org/maplibre-style-spec/expressions/#case)
|
||||
operator in the MapLibre Style Spec.
|
||||
|
||||
### `MLN_FUNCTION`
|
||||
|
||||
@@ -684,7 +684,7 @@ operator in the Mapbox Style Specification.
|
||||
</dl>
|
||||
|
||||
An expression exactly as defined by the
|
||||
[Mapbox Style Specification](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions).
|
||||
[MapLibre Style Spec](https://maplibre.org/maplibre-style-spec/expressions/).
|
||||
|
||||
## Custom functions
|
||||
|
||||
@@ -697,7 +697,7 @@ classes, but you should not call them directly outside the context of an
|
||||
expression, because the result may differ from the evaluated expression’s result
|
||||
or may result in undefined behavior.
|
||||
|
||||
The Mapbox Style Specification defines some operators for which no custom
|
||||
The MapLibre Style Spec defines some operators for which no custom
|
||||
function is available. To use these operators in an `NSExpression`, call the
|
||||
[`MLN_FUNCTION()`](#code-mgl_function-code) function with the same arguments
|
||||
that the operator expects.
|
||||
@@ -745,8 +745,8 @@ otherwise <code>TRUE</code>.
|
||||
object has a value for the feature attribute.
|
||||
|
||||
This function corresponds to the
|
||||
[`has`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-has)
|
||||
operator in the Mapbox Style Specification. See also the
|
||||
[`has`](https://maplibre.org/maplibre-style-spec/expressions/#has)
|
||||
operator in the MapLibre Style Spec. See also the
|
||||
[`mgl_does:have:`](#code-mgl_does-have-code) function, which is used on its own
|
||||
without the `FUNCTION()` operator. You can also check whether an object has an
|
||||
attribute by comparing the key path to `NIL`, for example `cheeseburger != NIL`
|
||||
@@ -779,8 +779,8 @@ The target expression with variable subexpressions replaced with the values
|
||||
defined in the context dictionary.
|
||||
|
||||
This function corresponds to the
|
||||
[`let`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-let)
|
||||
operator in the Mapbox Style Specification. See also the
|
||||
[`let`](https://maplibre.org/maplibre-style-spec/expressions/#let)
|
||||
operator in the MapLibre Style Spec. See also the
|
||||
[`MLN_LET`](#code-mgl_let-code) function, which is used on its own without the
|
||||
`FUNCTION()` operator.
|
||||
|
||||
@@ -839,8 +839,8 @@ yellow, orange, and red as the values.
|
||||
This function corresponds to the
|
||||
`+[NSExpression(MLNAdditions) mgl_expressionForInterpolatingExpression:withCurveType:parameters:stops:]`
|
||||
method and the
|
||||
[`interpolate`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-interpolate)
|
||||
operator in the Mapbox Style Specification. See also the
|
||||
[`interpolate`](https://maplibre.org/maplibre-style-spec/expressions/#interpolate)
|
||||
operator in the MapLibre Style Spec. See also the
|
||||
[`mgl_interpolate:withCurveType:parameters:stops:`](#code-mgl_interpolate-withcurvetype-parameters-stops-code)
|
||||
function, which is used on its own without the `FUNCTION()` operator.
|
||||
|
||||
@@ -879,8 +879,8 @@ A numeric representation of the target:
|
||||
first successful conversion is obtained.
|
||||
|
||||
This function corresponds to the
|
||||
[`to-number`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-types-to-number)
|
||||
operator in the Mapbox Style Specification. You can also cast a value to a
|
||||
[`to-number`](https://maplibre.org/maplibre-style-spec/expressions/#types-to-number)
|
||||
operator in the MapLibre Style Spec. You can also cast a value to a
|
||||
number by passing the value and the string `NSNumber` into the `CAST()`
|
||||
operator.
|
||||
|
||||
@@ -923,8 +923,8 @@ yellow, orange, and red as the values.
|
||||
This function corresponds to the
|
||||
`+[NSExpression(MLNAdditions) mgl_expressionForSteppingExpression:fromExpression:stops:]`
|
||||
method and the
|
||||
[`step`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-step)
|
||||
operator in the Mapbox Style Specification.
|
||||
[`step`](https://maplibre.org/maplibre-style-spec/expressions/#step)
|
||||
operator in the MapLibre Style Spec.
|
||||
|
||||
### `stringByAppendingString:`
|
||||
|
||||
@@ -944,8 +944,8 @@ The target string with each of the argument strings appended in order.
|
||||
This function corresponds to the
|
||||
`-[NSExpression(MLNAdditions) mgl_expressionByAppendingExpression:]`
|
||||
method and is similar to the
|
||||
[`concat`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-concat)
|
||||
operator in the Mapbox Style Specification. See also the
|
||||
[`concat`](https://maplibre.org/maplibre-style-spec/expressions/#concat)
|
||||
operator in the MapLibre Style Spec. See also the
|
||||
[`mgl_join:`](#code-mgl_join-code) function, which concatenates multiple
|
||||
expressions and is used on its own without the `FUNCTION()` operator.
|
||||
|
||||
@@ -980,7 +980,7 @@ A string representation of the target:
|
||||
function of the ECMAScript Language Specification.
|
||||
|
||||
This function corresponds to the
|
||||
[`to-string`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-types-to-string)
|
||||
operator in the Mapbox Style Specification. You can also cast a value to a
|
||||
[`to-string`](https://maplibre.org/maplibre-style-spec/expressions/#types-to-string)
|
||||
operator in the MapLibre Style Spec. You can also cast a value to a
|
||||
string by passing the value and the string `NSString` into the `CAST()`
|
||||
operator.
|
||||
|
||||
@@ -23,9 +23,9 @@ evaluates based on the tile it needs to load. For example:
|
||||
evaluated as `http://www.example.com/tiles/14/6/9@2x.png`.
|
||||
|
||||
Tile URL templates are also used to define tilesets in TileJSON manifests or
|
||||
[`raster`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#sources-raster-tiles)
|
||||
[`raster`](https://maplibre.org/maplibre-style-spec/sources/#raster-tiles)
|
||||
and
|
||||
[`vector`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#sources-vector-tiles)
|
||||
[`vector`](https://maplibre.org/maplibre-style-spec/sources/#vector-tiles)
|
||||
sources in style JSON files. See the
|
||||
[TileJSON specification](https://github.com/mapbox/tilejson-spec/tree/master/2.2.0)
|
||||
for information about tile URL templates in the context of a TileJSON or style
|
||||
|
||||
@@ -398,7 +398,7 @@ global.propertyDoc = function (propertyName, property, layerType, kind) {
|
||||
anchor = `paint-${property.original}`;
|
||||
break;
|
||||
}
|
||||
doc += `\n\nThis attribute corresponds to the <a href="https://www.mapbox.com/mapbox-gl-style-spec/#${anchor}"><code>${property.original}</code></a> layout property in the Mapbox Style Specification.`;
|
||||
doc += `\n\nThis attribute corresponds to the <a href="https://maplibre.org/maplibre-style-spec/#${anchor}"><code>${property.original}</code></a> layout property in the MapLibre Style Spec.`;
|
||||
}
|
||||
doc += '\n\nYou can set this property to an expression containing any of the following:\n\n';
|
||||
doc += `* Constant ${describeType(property)} values`;
|
||||
|
||||
@@ -89,7 +89,7 @@ MLN_EXPORT
|
||||
/**
|
||||
Returns a custom shape data source initialized with an identifier, and a
|
||||
dictionary of options for the source according to the
|
||||
<a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-geojson">style
|
||||
<a href="https://maplibre.org/maplibre-style-spec/#sources-geojson">style
|
||||
specification</a>.
|
||||
|
||||
This class supports the following options:
|
||||
@@ -108,7 +108,7 @@ MLN_EXPORT
|
||||
/**
|
||||
Returns a custom shape data source initialized with an identifier, data source, and a
|
||||
dictionary of options for the source according to the
|
||||
<a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-geojson">style
|
||||
<a href="https://maplibre.org/maplibre-style-spec/#sources-geojson">style
|
||||
specification</a>.
|
||||
|
||||
This class supports the following options:
|
||||
|
||||
@@ -138,7 +138,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
listed above for each attribute value. In addition to the Foundation types, you
|
||||
may also set an attribute to an `NSColor` (macOS) or `UIColor` (iOS), which
|
||||
will be converted into its
|
||||
<a href="https://maplibre.org/maplibre-gl-js-docs/style-spec/#types-color">CSS string representation</a>
|
||||
<a href="https://maplibre.org/maplibre-style-spec/types/#color">CSS string representation</a>
|
||||
when the feature is added to an `MLNShapeSource`. This can be convenient when
|
||||
using the attribute to supply a value for a color-typed layout or paint
|
||||
attribute via a key path expression.
|
||||
|
||||
@@ -24,7 +24,7 @@ MLN_EXPORT
|
||||
appearance of content supplied by the image source.
|
||||
|
||||
Each
|
||||
<a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-image"><code>image</code></a>
|
||||
<a href="https://maplibre.org/maplibre-style-spec/#sources-image"><code>image</code></a>
|
||||
source defined by the style JSON file is represented at runtime by an
|
||||
`MLNImageSource` object that you can use to initialize new style layers. You
|
||||
can also add and remove sources dynamically using methods such as
|
||||
|
||||
@@ -74,8 +74,8 @@ MLN_EXPORT
|
||||
<%- propertyDoc(property.name, property, type, 'light').wrap(80, 1) %>
|
||||
|
||||
This property corresponds to the <a
|
||||
href="https://maplibre.org/maplibre-gl-js-docs/style-spec/#light-<%- originalPropertyName(property) %>"><code><%- originalPropertyName(property) %></code></a>
|
||||
light property in the Mapbox Style Specification.
|
||||
href="https://maplibre.org/maplibre-style-spec/light/#<%- originalPropertyName(property) %>"><code><%- originalPropertyName(property) %></code></a>
|
||||
light property in the MapLibre Style Spec.
|
||||
<% if (property.examples) { -%>
|
||||
|
||||
#### Related examples
|
||||
|
||||
@@ -159,19 +159,19 @@ typedef NS_ENUM(NSUInteger, MLNResourceKind) {
|
||||
MLNResourceKindUnknown,
|
||||
/** Style sheet JSON file */
|
||||
MLNResourceKindStyle,
|
||||
/** TileJSON file as specified in https://maplibre.org/maplibre-gl-js-docs/style-spec/#root-sources */
|
||||
/** TileJSON file as specified in https://maplibre.org/maplibre-style-spec/root/#sources */
|
||||
MLNResourceKindSource,
|
||||
/** A vector or raster tile as described in the style sheet at
|
||||
https://maplibre.org/maplibre-gl-js-docs/style-spec/#sources */
|
||||
https://maplibre.org/maplibre-style-spec/sources/ */
|
||||
MLNResourceKindTile,
|
||||
/** Signed distance field glyphs for text rendering. These are the URLs specified in the style
|
||||
in https://maplibre.org/maplibre-gl-js-docs/style-spec/#root-glyphs */
|
||||
in https://maplibre.org/maplibre-style-spec/root/#glyphs */
|
||||
MLNResourceKindGlyphs,
|
||||
/** Image part of a sprite sheet. It is constructed of the prefix in
|
||||
https://maplibre.org/maplibre-gl-js-docs/style-spec/#root-sprite and a PNG file extension. */
|
||||
https://maplibre.org/maplibre-style-spec/root/#sprite and a PNG file extension. */
|
||||
MLNResourceKindSpriteImage,
|
||||
/** JSON part of a sprite sheet. It is constructed of the prefix in
|
||||
https://maplibre.org/maplibre-gl-js-docs/style-spec/#root-sprite and a JSON file extension. */
|
||||
https://maplibre.org/maplibre-style-spec/root/#sprite and a JSON file extension. */
|
||||
MLNResourceKindSpriteJSON,
|
||||
/** Image data for a georeferenced image source. **/
|
||||
MLNResourceKindImage,
|
||||
|
||||
@@ -27,7 +27,7 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionDEMEnc
|
||||
appearance of content supplied by the raster DEM source.
|
||||
|
||||
Each
|
||||
<a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-raster-dem"><code>raster-dem</code></a>
|
||||
<a href="https://maplibre.org/maplibre-style-spec/#sources-raster-dem"><code>raster-dem</code></a>
|
||||
source defined by the style JSON file is represented at runtime by an
|
||||
`MLNRasterDEMSource` object that you can use to initialize new style layers.
|
||||
You can also add and remove sources dynamically using methods such as
|
||||
|
||||
@@ -33,7 +33,7 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionTileSi
|
||||
appearance of content supplied by the raster tile source.
|
||||
|
||||
Each
|
||||
<a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-raster"><code>raster</code></a>
|
||||
<a href="https://maplibre.org/maplibre-style-spec/#sources-raster"><code>raster</code></a>
|
||||
source defined by the style JSON file is represented at runtime by an
|
||||
`MLNRasterTileSource` object that you can use to initialize new style layers. You
|
||||
can also add and remove sources dynamically using methods such as
|
||||
|
||||
@@ -20,8 +20,8 @@ typedef NSString *MLNShapeSourceOption NS_STRING_ENUM;
|
||||
`YES` clusters the points by radius into groups. The default value is `NO`.
|
||||
|
||||
This option corresponds to the
|
||||
<a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-geojson-cluster"><code>cluster</code></a>
|
||||
source property in the Mapbox Style Specification.
|
||||
<a href="https://maplibre.org/maplibre-style-spec/#sources-geojson-cluster"><code>cluster</code></a>
|
||||
source property in the MapLibre Style Spec.
|
||||
|
||||
This option only affects point features within an `MLNShapeSource` object; it
|
||||
is ignored when creating an `MLNComputedShapeSource` object.
|
||||
@@ -66,8 +66,8 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionClus
|
||||
```
|
||||
|
||||
This option corresponds to the
|
||||
<a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-geojson-clusterProperties"><code>clusterProperties</code></a>
|
||||
source property in the Mapbox Style Specification.
|
||||
<a href="https://maplibre.org/maplibre-style-spec/#sources-geojson-clusterProperties"><code>clusterProperties</code></a>
|
||||
source property in the MapLibre Style Spec.
|
||||
|
||||
This option only affects point features within an `MLNShapeSource` object; it
|
||||
is ignored when creating an `MLNComputedShapeSource` object.
|
||||
@@ -80,8 +80,8 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionClus
|
||||
maximum zoom level, the shapes are not clustered.
|
||||
|
||||
This option corresponds to the
|
||||
<a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-geojson-clusterMaxZoom"><code>clusterMaxZoom</code></a>
|
||||
source property in the Mapbox Style Specification.
|
||||
<a href="https://maplibre.org/maplibre-style-spec/#sources-geojson-clusterMaxZoom"><code>clusterMaxZoom</code></a>
|
||||
source property in the MapLibre Style Spec.
|
||||
|
||||
This option only affects point features within an `MLNShapeSource` object; it
|
||||
is ignored when creating an `MLNComputedShapeSource` object.
|
||||
@@ -93,8 +93,8 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionMaxi
|
||||
which to create vector tiles. The default value is 0.
|
||||
|
||||
This option corresponds to the
|
||||
<a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-geojson-minzoom"><code>minzoom</code></a>
|
||||
source property in the Mapbox Style Specification.
|
||||
<a href="https://maplibre.org/maplibre-style-spec/#sources-geojson-minzoom"><code>minzoom</code></a>
|
||||
source property in the MapLibre Style Spec.
|
||||
*/
|
||||
FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionMinimumZoomLevel;
|
||||
|
||||
@@ -104,8 +104,8 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionMini
|
||||
zoom levels. The default value is 18.
|
||||
|
||||
This option corresponds to the
|
||||
<a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-geojson-maxzoom"><code>maxzoom</code></a>
|
||||
source property in the Mapbox Style Specification.
|
||||
<a href="https://maplibre.org/maplibre-style-spec/#sources-geojson-maxzoom"><code>maxzoom</code></a>
|
||||
source property in the MapLibre Style Spec.
|
||||
*/
|
||||
FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionMaximumZoomLevel;
|
||||
|
||||
@@ -116,8 +116,8 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionMaxi
|
||||
artifacts near tile edges and slower performance. The default value is 128.
|
||||
|
||||
This option corresponds to the
|
||||
<a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-geojson-buffer"><code>buffer</code></a>
|
||||
source property in the Mapbox Style Specification.
|
||||
<a href="https://maplibre.org/maplibre-style-spec/#sources-geojson-buffer"><code>buffer</code></a>
|
||||
source property in the MapLibre Style Spec.
|
||||
*/
|
||||
FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionBuffer;
|
||||
|
||||
@@ -127,8 +127,8 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionBuff
|
||||
improves performance. The default value is 0.375.
|
||||
|
||||
This option corresponds to the
|
||||
<a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-geojson-tolerance"><code>tolerance</code></a>
|
||||
source property in the Mapbox Style Specification.
|
||||
<a href="https://maplibre.org/maplibre-style-spec/#sources-geojson-tolerance"><code>tolerance</code></a>
|
||||
source property in the MapLibre Style Spec.
|
||||
*/
|
||||
FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionSimplificationTolerance;
|
||||
|
||||
@@ -139,8 +139,8 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionSimp
|
||||
The default value is `NO`.
|
||||
|
||||
This option corresponds to the
|
||||
<a href="https://maplibre.org/maplibre-gl-js-docs/style-spec/#sources-geojson-lineMetrics"><code>lineMetrics</code></a>
|
||||
source property in the Mapbox Style Specification.
|
||||
<a href="https://maplibre.org/maplibre-style-spec/sources/#geojson-lineMetrics"><code>lineMetrics</code></a>
|
||||
source property in the MapLibre Style Spec.
|
||||
*/
|
||||
FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionLineDistanceMetrics;
|
||||
|
||||
@@ -158,7 +158,7 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionLine
|
||||
use the `MLNComputedShapeSource` or `MLNVectorTileSource` class.
|
||||
|
||||
Each
|
||||
<a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-geojson"><code>geojson</code></a>
|
||||
<a href="https://maplibre.org/maplibre-style-spec/#sources-geojson"><code>geojson</code></a>
|
||||
source defined by the style JSON file is represented at runtime by an
|
||||
`MLNShapeSource` object that you can use to refine the map’s content and
|
||||
initialize new style layers. You can also add and remove sources dynamically
|
||||
|
||||
@@ -32,7 +32,7 @@ MLN_EXPORT
|
||||
Use the style layer’s predicate to include only the features in the source
|
||||
layer that satisfy a condition that you define. If the style layer initially
|
||||
comes from the style, its predicate corresponds to the
|
||||
<a href="https://www.mapbox.com/mapbox-gl-style-spec/#layer-filter">`filter`</a>
|
||||
<a href="https://maplibre.org/maplibre-style-spec/#layer-filter">`filter`</a>
|
||||
property in the style JSON.
|
||||
|
||||
See the “<a href="../predicates-and-expressions.html">Predicates and Expressions</a>”
|
||||
|
||||
@@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
class may be a suitable alternative.
|
||||
|
||||
Each
|
||||
<a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-vector"><code>vector</code></a>
|
||||
<a href="https://maplibre.org/maplibre-style-spec/#sources-vector"><code>vector</code></a>
|
||||
source defined by the style JSON file is represented at runtime by an
|
||||
`MLNVectorTileSource` object that you can use to initialize new style layers.
|
||||
You can also add and remove sources dynamically using methods such as
|
||||
|
||||
@@ -17,8 +17,8 @@ typedef NSString *MLNExpressionInterpolationMode NS_TYPED_ENUM;
|
||||
An `NSString` identifying the `linear` interpolation type in an `NSExpression`.
|
||||
|
||||
This attribute corresponds to the `linear` value in the
|
||||
<a href="https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-interpolate"><code>interpolate</code></a>
|
||||
expression operator in the Mapbox Style Specification.
|
||||
<a href="https://maplibre.org/maplibre-style-spec/expressions/#interpolate"><code>interpolate</code></a>
|
||||
expression operator in the MapLibre Style Spec.
|
||||
*/
|
||||
FOUNDATION_EXTERN MLN_EXPORT const MLNExpressionInterpolationMode MLNExpressionInterpolationModeLinear;
|
||||
|
||||
@@ -26,8 +26,8 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNExpressionInterpolationMode MLNExpressionI
|
||||
An `NSString` identifying the `expotential` interpolation type in an `NSExpression`.
|
||||
|
||||
This attribute corresponds to the `exponential` value in the
|
||||
<a href="https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-interpolate"><code>interpolate</code></a>
|
||||
expression operator in the Mapbox Style Specification.
|
||||
<a href="https://maplibre.org/maplibre-style-spec/expressions/#interpolate"><code>interpolate</code></a>
|
||||
expression operator in the MapLibre Style Spec.
|
||||
*/
|
||||
FOUNDATION_EXTERN MLN_EXPORT const MLNExpressionInterpolationMode MLNExpressionInterpolationModeExponential;
|
||||
|
||||
@@ -35,15 +35,15 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNExpressionInterpolationMode MLNExpressionI
|
||||
An `NSString` identifying the `cubic-bezier` interpolation type in an `NSExpression`.
|
||||
|
||||
This attribute corresponds to the `cubic-bezier` value in the
|
||||
<a href="https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-interpolate"><code>interpolate</code></a>
|
||||
expression operator in the Mapbox Style Specification.
|
||||
<a href="https://maplibre.org/maplibre-style-spec/expressions/#interpolate"><code>interpolate</code></a>
|
||||
expression operator in the MapLibre Style Spec.
|
||||
*/
|
||||
FOUNDATION_EXTERN MLN_EXPORT const MLNExpressionInterpolationMode MLNExpressionInterpolationModeCubicBezier;
|
||||
|
||||
/**
|
||||
Methods for creating expressions that use Mapbox-specific functionality and for
|
||||
converting to and from the JSON format defined in the
|
||||
<a href="https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions">Mapbox Style Specification</a>.
|
||||
<a href="https://maplibre.org/maplibre-style-spec/expressions/">MapLibre Style Spec</a>.
|
||||
*/
|
||||
@interface NSExpression (MLNAdditions)
|
||||
|
||||
@@ -51,50 +51,50 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNExpressionInterpolationMode MLNExpressionI
|
||||
|
||||
/**
|
||||
`NSExpression` variable that corresponds to the
|
||||
<a href="https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-zoom"><code>zoom</code></a>
|
||||
expression operator in the Mapbox Style Specification.
|
||||
<a href="https://maplibre.org/maplibre-style-spec/expressions/#zoom"><code>zoom</code></a>
|
||||
expression operator in the MapLibre Style Spec.
|
||||
*/
|
||||
@property (class, nonatomic, readonly) NSExpression *zoomLevelVariableExpression;
|
||||
|
||||
/**
|
||||
`NSExpression` variable that corresponds to the
|
||||
<a href="https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-heatmap-density"><code>heatmap-density</code></a>
|
||||
expression operator in the Mapbox Style Specification.
|
||||
<a href="https://maplibre.org/maplibre-style-spec/expressions/#heatmap-density"><code>heatmap-density</code></a>
|
||||
expression operator in the MapLibre Style Spec.
|
||||
*/
|
||||
@property (class, nonatomic, readonly) NSExpression *heatmapDensityVariableExpression;
|
||||
|
||||
/**
|
||||
`NSExpression` variable that corresponds to the
|
||||
<a href="https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-line-progress"><code>line-progress</code></a>
|
||||
expression operator in the Mapbox Style Specification.
|
||||
<a href="https://maplibre.org/maplibre-style-spec/expressions/#line-progress"><code>line-progress</code></a>
|
||||
expression operator in the MapLibre Style Spec.
|
||||
*/
|
||||
@property (class, nonatomic, readonly) NSExpression *lineProgressVariableExpression;
|
||||
|
||||
/**
|
||||
`NSExpression` variable that corresponds to the
|
||||
<a href="https://maplibre.org/maplibre-gl-js-docs/style-spec/#eexpressions-geometry-type"><code>geometry-type</code></a>
|
||||
expression operator in the Mapbox Style Specification.
|
||||
<a href="https://maplibre.org/maplibre-style-spec/expressions/#geometry-type"><code>geometry-type</code></a>
|
||||
expression operator in the MapLibre Style Spec.
|
||||
*/
|
||||
@property (class, nonatomic, readonly) NSExpression *geometryTypeVariableExpression;
|
||||
|
||||
/**
|
||||
`NSExpression` variable that corresponds to the
|
||||
<a href="https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-id"><code>id</code></a>
|
||||
expression operator in the Mapbox Style Specification.
|
||||
<a href="https://maplibre.org/maplibre-style-spec/expressions/#id"><code>id</code></a>
|
||||
expression operator in the MapLibre Style Spec.
|
||||
*/
|
||||
@property (class, nonatomic, readonly) NSExpression *featureIdentifierVariableExpression;
|
||||
|
||||
/**
|
||||
`NSExpression` variable that corresponds to the
|
||||
<a href="https://docs.mapbox.com/mapbox-gl-js/style-spec/#accumulated"><code>id</code></a>
|
||||
expression operator in the Mapbox Style Specification.
|
||||
expression operator in the MapLibre Style Spec.
|
||||
*/
|
||||
@property (class, nonatomic, readonly) NSExpression *featureAccumulatedVariableExpression;
|
||||
|
||||
/**
|
||||
`NSExpression` variable that corresponds to the
|
||||
<a href="https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-properties"><code>properties</code></a>
|
||||
expression operator in the Mapbox Style Specification.
|
||||
<a href="https://maplibre.org/maplibre-style-spec/expressions/#properties"><code>properties</code></a>
|
||||
expression operator in the MapLibre Style Spec.
|
||||
*/
|
||||
@property (class, nonatomic, readonly) NSExpression *featureAttributesVariableExpression;
|
||||
|
||||
@@ -186,7 +186,7 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNExpressionInterpolationMode MLNExpressionI
|
||||
from JSON data.
|
||||
|
||||
The Foundation object is interpreted according to the
|
||||
[Mapbox Style Specification](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions).
|
||||
[MapLibre Style Spec](https://maplibre.org/maplibre-style-spec/expressions/).
|
||||
See the
|
||||
“[Information for Style Authors](../for-style-authors.html#setting-attribute-values)”
|
||||
guide for a correspondence of operators and types between the style
|
||||
@@ -203,7 +203,7 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNExpressionInterpolationMode MLNExpressionI
|
||||
An equivalent Foundation object that can be serialized as JSON.
|
||||
|
||||
The Foundation object conforms to the
|
||||
[Mapbox Style Specification](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions).
|
||||
[MapLibre Style Spec](https://maplibre.org/maplibre-style-spec/expressions/).
|
||||
See the
|
||||
“[Information for Style Authors](../for-style-authors.html#setting-attribute-values)”
|
||||
guide for a correspondence of operators and types between the style
|
||||
|
||||
@@ -250,7 +250,7 @@ const MLNExpressionInterpolationMode MLNExpressionInterpolationModeCubicBezier =
|
||||
|
||||
/**
|
||||
A placeholder for a catch-all method that evaluates an arbitrary number of
|
||||
arguments as an expression according to the Mapbox Style Specification’s
|
||||
arguments as an expression according to the MapLibre Style Spec’s
|
||||
expression language.
|
||||
*/
|
||||
- (id)MLN_FUNCTION:(id)firstArgument, ... {
|
||||
|
||||
@@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
from JSON data.
|
||||
|
||||
The Foundation object is interpreted according to the
|
||||
[Mapbox Style Specification](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions).
|
||||
[MapLibre Style Spec](https://maplibre.org/maplibre-style-spec/expressions/).
|
||||
See the
|
||||
“[Predicates and Expressions](../predicates-and-expressions.html)”
|
||||
guide for a correspondence of operators and types between the style
|
||||
@@ -28,7 +28,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
An equivalent Foundation object that can be serialized as JSON.
|
||||
|
||||
The Foundation object conforms to the
|
||||
[Mapbox Style Specification](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions).
|
||||
[MapLibre Style Spec](https://maplibre.org/maplibre-style-spec/expressions/).
|
||||
See the
|
||||
“[Predicates and Expressions](../predicates-and-expressions.html)”
|
||||
guide for a correspondence of operators and types between the style
|
||||
|
||||
@@ -1393,7 +1393,7 @@ This is the final scheduled version of the Mapbox iOS SDK that supports iOS 7. (
|
||||
- A two-finger vertical swipe now tilts the map into perspective mode. ([#2116](https://github.com/mapbox/mapbox-gl-native/pull/2116))
|
||||
- A new `MLNMapCamera` API allows you to transition multiple viewpoint properties, including rotation and pitch, simultaneously with an optional custom duration and timing function. ([#2193](https://github.com/mapbox/mapbox-gl-native/pull/2193))
|
||||
- A new user tracking mode, `MLNUserTrackingModeFollowWithCourse`, has been added for indicating the current direction of travel. ([#2068](https://github.com/mapbox/mapbox-gl-native/pull/2068))
|
||||
- Version 8 (`v8`) of the [Mapbox GL style spec](https://www.mapbox.com/mapbox-gl-style-spec/) is now required. If you are using a custom `v7` style, it needs to be upgraded using [this migrator script](https://github.com/mapbox/mapbox-gl-style-spec/blob/mb-pages/migrations/v7.js). ([#2052](https://github.com/mapbox/mapbox-gl-native/pull/2052))
|
||||
- Version 8 (`v8`) of the [Mapbox GL style spec](https://maplibre.org/maplibre-style-spec/) is now required. If you are using a custom `v7` style, it needs to be upgraded using [this migrator script](https://github.com/mapbox/mapbox-gl-style-spec/blob/mb-pages/migrations/v7.js). ([#2052](https://github.com/mapbox/mapbox-gl-native/pull/2052))
|
||||
- Applications built with Mapbox GL no longer crash when Location Services launches them in background mode. ([#1821](https://github.com/mapbox/mapbox-gl-native/pull/1821), [#1869](https://github.com/mapbox/mapbox-gl-native/pull/1869))
|
||||
- Fixed a crash when adding annotations to an `MLNMapView` inside `-viewDidLoad`. ([#1874](https://github.com/mapbox/mapbox-gl-native/pull/1874))
|
||||
- The user location annotation view now indicates the location reading’s accuracy and the device’s heading. ([#2010](https://github.com/mapbox/mapbox-gl-native/pull/2010))
|
||||
|
||||
@@ -1909,7 +1909,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) {
|
||||
[self.styleNames addObject:@"MapLibre Basic"];
|
||||
[self.styleURLs addObject:[NSURL URLWithString:@"https://demotiles.maplibre.org/style.json"]];
|
||||
|
||||
/// Add Mapbox Styles if an `apiKey` exists
|
||||
/// Add MapLibre Styles if an `apiKey` exists
|
||||
NSString* apiKey = [MLNSettings apiKey];
|
||||
if (apiKey.length)
|
||||
{
|
||||
@@ -2189,7 +2189,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) {
|
||||
|
||||
- (void)mapView:(MLNMapView *)mapView didFinishLoadingStyle:(MLNStyle *)style
|
||||
{
|
||||
// Default Mapbox styles use {name_en} as their label language, which means
|
||||
// Default MapLibre styles use {name_en} as their label language, which means
|
||||
// that a device with an English-language locale is already effectively
|
||||
// using locale-based country labels.
|
||||
_localizingLabels = [[self bestLanguageForUser] isEqualToString:@"en"];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# MapLibre Native for iOS
|
||||
|
||||
MapLibre Native for iOS is an open-source framework for embedding interactive map views with scalable, customizable vector maps into Cocoa Touch applications on iOS 9.0 and above using Objective-C, Swift, or Interface Builder. It takes stylesheets that conform to the [MapLibre Style Specification](https://maplibre.org/maplibre-gl-js-docs/style-spec/), applies them to vector tiles that conform to the [Mapbox Vector Tile Specification](https://docs.mapbox.com/data/tilesets/guides/vector-tiles-standards/), and renders them using OpenGL.
|
||||
MapLibre Native for iOS is an open-source framework for embedding interactive map views with scalable, customizable vector maps into Cocoa Touch applications on iOS 9.0 and above using Objective-C, Swift, or Interface Builder. It takes stylesheets that conform to the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/), applies them to vector tiles that conform to the [Mapbox Vector Tile Specification](https://docs.mapbox.com/data/tilesets/guides/vector-tiles-standards/), and renders them using OpenGL.
|
||||
|
||||
For more information, check out the [MapLibre Native for iOS repository](https://github.com/maplibre/maplibre-native) and the [full changelog](https://github.com/maplibre/maplibre-native/blob/main/platform/ios/platform/ios/CHANGELOG.md) online.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# MapLibre Native for iOS
|
||||
|
||||
MapLibre Native for iOS is an open-source framework for embedding interactive map views with scalable, customizable vector maps into Cocoa Touch applications on iOS 9.0 and above using Objective-C, Swift, or Interface Builder. It takes stylesheets that conform to the [MapLibre Style Specification](https://maplibre.org/maplibre-gl-js-docs/style-spec/), applies them to vector tiles that conform to the [Mapbox Vector Tile Specification](https://docs.mapbox.com/data/tilesets/guides/vector-tiles-standards/), and renders them using OpenGL.
|
||||
MapLibre Native for iOS is an open-source framework for embedding interactive map views with scalable, customizable vector maps into Cocoa Touch applications on iOS 9.0 and above using Objective-C, Swift, or Interface Builder. It takes stylesheets that conform to the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/), applies them to vector tiles that conform to the [Mapbox Vector Tile Specification](https://docs.mapbox.com/data/tilesets/guides/vector-tiles-standards/), and renders them using OpenGL.
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNUserLocationAnnotationTyp
|
||||
The map view loads scalable vector tiles that conform to the
|
||||
<a href="https://github.com/mapbox/vector-tile-spec">Mapbox Vector Tile Specification</a>.
|
||||
It styles them with a style that conforms to the
|
||||
<a href="https://www.mapbox.com/mapbox-gl-style-spec/">Mapbox Style Specification</a>.
|
||||
<a href="https://maplibre.org/maplibre-style-spec/">MapLibre Style Spec</a>.
|
||||
Such styles can be designed in
|
||||
<a href="https://www.mapbox.com/studio/">Mapbox Studio</a> and hosted on
|
||||
mapbox.com.
|
||||
|
||||
@@ -19,7 +19,7 @@ MapLibre Native for macOS is compatible with macOS 10.10.0 and above for Cocoa a
|
||||
|
||||
* [Build the MapLibre Native for macOS from source](INSTALL.md)
|
||||
* [Contribute to MapLibre Native for macOS](CONTRIBUTING.md)
|
||||
* [Mapbox Style Specification](https://www.mapbox.com/mapbox-gl-style-spec/)
|
||||
* [MapLibre Style Spec](https://maplibre.org/maplibre-style-spec/)
|
||||
* [Mapbox Vector Tile Specification](https://www.mapbox.com/developers/vector-tiles/)
|
||||
|
||||
The MapLibre Organization does not officially support the macOS to the same extent as iOS (see [project tiers](https://github.com/maplibre/maplibre/blob/main/PROJECT_TIERS.md)); however, bug reports and pull requests are certainly welcome.
|
||||
|
||||
@@ -330,7 +330,7 @@ NSArray<id <MLNAnnotation>> *MBXFlattenedShapes(NSArray<id <MLNAnnotation>> *sha
|
||||
- (IBAction)chooseCustomStyle:(id)sender {
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
alert.messageText = @"Apply custom style";
|
||||
alert.informativeText = @"Enter the URL to a JSON file that conforms to the Mapbox Style Specification, such as a style designed in Mapbox Studio:";
|
||||
alert.informativeText = @"Enter the URL to a JSON file that conforms to the MapLibre Style Spec, such as a style designed in Mapbox Studio:";
|
||||
NSTextField *textField = [[NSTextField alloc] initWithFrame:NSZeroRect];
|
||||
[textField sizeToFit];
|
||||
NSRect textFieldFrame = textField.frame;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# [Mapbox Maps SDK for macOS](https://github.com/mapbox/mapbox-gl-native-ios/tree/master/platform/macos/)
|
||||
|
||||
The Mapbox Maps SDK for macOS is an open-source framework for embedding interactive map views with scalable, customizable vector maps into Cocoa applications on macOS 10.11.0 and above using Objective-C, Swift, Interface Builder, or AppleScript. The SDK takes stylesheets that conform to the [Mapbox Style Specification](https://www.mapbox.com/mapbox-gl-style-spec/), applies them to vector tiles that conform to the [Mapbox Vector Tile Specification](https://www.mapbox.com/developers/vector-tiles/), and renders them using OpenGL.
|
||||
The Mapbox Maps SDK for macOS is an open-source framework for embedding interactive map views with scalable, customizable vector maps into Cocoa applications on macOS 10.11.0 and above using Objective-C, Swift, Interface Builder, or AppleScript. The SDK takes stylesheets that conform to the [MapLibre Style Spec](https://maplibre.org/maplibre-style-spec/), applies them to vector tiles that conform to the [Mapbox Vector Tile Specification](https://www.mapbox.com/developers/vector-tiles/), and renders them using OpenGL.
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# [MapLibre Maps SDK for macos]
|
||||
|
||||
The MapLibre Maps SDK for macos is an open-source framework for embedding interactive map views with scalable, customizable vector maps into Cocoa Touch applications on iOS 9.0 and above using Objective-C, Swift, or Interface Builder. It takes stylesheets that conform to the [Mapbox Style Specification](https://www.mapbox.com/mapbox-gl-style-spec/), applies them to vector tiles that conform to the [Mapbox Vector Tile Specification](https://www.mapbox.com/developers/vector-tiles/), and renders them using OpenGL.
|
||||
The MapLibre Maps SDK for macos is an open-source framework for embedding interactive map views with scalable, customizable vector maps into Cocoa Touch applications on iOS 9.0 and above using Objective-C, Swift, or Interface Builder. It takes stylesheets that conform to the [MapLibre Style Spec](https://maplibre.org/maplibre-style-spec/), applies them to vector tiles that conform to the [Mapbox Vector Tile Specification](https://www.mapbox.com/developers/vector-tiles/), and renders them using OpenGL.
|
||||
|
||||
## Changes in version <%-CURRENTVERSION%>
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
The map view loads scalable vector tiles that conform to the
|
||||
<a href="https://github.com/mapbox/vector-tile-spec">Mapbox Vector Tile Specification</a>.
|
||||
It styles them with a style that conforms to the
|
||||
<a href="https://www.mapbox.com/mapbox-gl-style-spec/">Mapbox Style Specification</a>.
|
||||
<a href="https://maplibre.org/maplibre-style-spec/">MapLibre Style Spec</a>.
|
||||
Such styles can be designed in
|
||||
<a href="https://www.mapbox.com/studio/">Mapbox Studio</a> and hosted on
|
||||
mapbox.com.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
- (mbgl::Color)mgl_color {
|
||||
CGFloat r, g, b, a;
|
||||
|
||||
// The Mapbox Style Specification does not specify a color space, but it is
|
||||
// The MapLibre Style Spec does not specify a color space, but it is
|
||||
// assumed to be sRGB for consistency with CSS.
|
||||
NSColor *srgbColor = self;
|
||||
if ([NSColor redColor].colorSpaceName == NSCalibratedRGBColorSpace) {
|
||||
@@ -24,7 +24,7 @@
|
||||
- (mbgl::Color)mgl_colorForPremultipliedValue {
|
||||
CGFloat r, g, b, a;
|
||||
|
||||
// The Mapbox Style Specification does not specify a color space, but it is
|
||||
// The MapLibre Style Spec does not specify a color space, but it is
|
||||
// assumed to be sRGB for consistency with CSS.
|
||||
NSColor *srgbColor = self;
|
||||
if ([NSColor redColor].colorSpaceName == NSCalibratedRGBColorSpace) {
|
||||
@@ -130,7 +130,7 @@
|
||||
blue:components[2]
|
||||
alpha:components[3]];
|
||||
}
|
||||
// The Mapbox Style Specification does not specify a color space, but it is
|
||||
// The MapLibre Style Spec does not specify a color space, but it is
|
||||
// assumed to be sRGB for consistency with CSS.
|
||||
return [NSColor colorWithColorSpace:[NSColorSpace sRGBColorSpace]
|
||||
components:&components[0]
|
||||
|
||||
@@ -329,8 +329,8 @@ Map::~Map() {
|
||||
\brief the map style JSON.
|
||||
|
||||
Sets a new \a style from a JSON that must conform to the
|
||||
\l {https://www.mapbox.com/mapbox-gl-style-spec/}
|
||||
{Mapbox style specification}.
|
||||
\l {https://maplibre.org/maplibre-style-spec/}
|
||||
{MapLibre Style spec}.
|
||||
|
||||
\note In case of a invalid style it will trigger a mapChanged
|
||||
signal with QMapLibreGL::Map::MapChangeDidFailLoadingMap as argument.
|
||||
@@ -633,7 +633,7 @@ void Map::removeAnnotation(AnnotationID id) {
|
||||
/*!
|
||||
Sets a layout \a property_ \a value to an existing \a layer. The \a
|
||||
property_ string can be any as defined by the \l
|
||||
{https://www.mapbox.com/mapbox-gl-style-spec/} {Mapbox style specification}
|
||||
{https://maplibre.org/maplibre-style-spec/} {MapLibre Style Spec}
|
||||
for layout properties. Returns true if the operation succeeds, and false
|
||||
otherwise.
|
||||
|
||||
@@ -648,12 +648,12 @@ void Map::removeAnnotation(AnnotationID id) {
|
||||
\endcode
|
||||
|
||||
This table describes the mapping between \l
|
||||
{https://www.mapbox.com/mapbox-gl-style-spec/#types} {style types} and Qt
|
||||
{https://maplibre.org/maplibre-style-spec/#types} {style types} and Qt
|
||||
types accepted by setLayoutProperty():
|
||||
|
||||
\table
|
||||
\header
|
||||
\li Mapbox style type
|
||||
\li MapLibre style type
|
||||
\li Qt type
|
||||
\row
|
||||
\li Enum
|
||||
@@ -679,7 +679,7 @@ bool Map::setLayoutProperty(const QString &layer, const QString &propertyName, c
|
||||
/*!
|
||||
Sets a paint \a property_ \a value to an existing \a layer. The \a property_
|
||||
string can be any as defined by the \l
|
||||
{https://www.mapbox.com/mapbox-gl-style-spec/} {Mapbox style specification}
|
||||
{https://maplibre.org/maplibre-style-spec/} {MapLibre Style Spec}
|
||||
for paint properties. Returns true if the operation succeeds, and false
|
||||
otherwise.
|
||||
|
||||
@@ -695,12 +695,12 @@ bool Map::setLayoutProperty(const QString &layer, const QString &propertyName, c
|
||||
\endcode
|
||||
|
||||
This table describes the mapping between \l
|
||||
{https://www.mapbox.com/mapbox-gl-style-spec/#types} {style types} and Qt
|
||||
{https://maplibre.org/maplibre-style-spec/#types} {style types} and Qt
|
||||
types accepted by setPaintProperty():
|
||||
|
||||
\table
|
||||
\header
|
||||
\li Mapbox style type
|
||||
\li MapLibre style type
|
||||
\li Qt type
|
||||
\row
|
||||
\li Color
|
||||
@@ -878,8 +878,8 @@ QMargins Map::margins() const {
|
||||
|
||||
/*!
|
||||
Adds a source \a id to the map as specified by the \l
|
||||
{https://www.mapbox.com/mapbox-gl-style-spec/#root-sources}{Mapbox style
|
||||
specification} with \a params.
|
||||
{https://maplibre.org/maplibre-style-spec/#root-sources}{MapLibre Style
|
||||
Specification} with \a params.
|
||||
|
||||
This example reads a GeoJSON from the Qt resource system and adds it as
|
||||
source:
|
||||
@@ -1007,7 +1007,7 @@ void Map::addCustomLayer(const QString &id, std::unique_ptr<CustomLayerHostInter
|
||||
|
||||
/*!
|
||||
Adds a style layer to the map as specified by the \l
|
||||
{https://www.mapbox.com/mapbox-gl-style-spec/#root-layers}{Mapbox style
|
||||
{https://maplibre.org/maplibre-style-spec/#root-layers}{MapLibre style
|
||||
specification} with \a params. The layer will be added under the layer
|
||||
specified by \a before, if specified. Otherwise it will be added as the
|
||||
topmost layer.
|
||||
@@ -1098,8 +1098,8 @@ void Map::removeImage(const QString &id) {
|
||||
|
||||
/*!
|
||||
Adds a \a filter to a style \a layer using the format described in the \l
|
||||
{https://maplibre.org/maplibre-gl-js-docs/style-spec/#other-filter}{Mapbox
|
||||
style specification}.
|
||||
{https://maplibre.org/maplibre-style-spec/deprecations/#other-filter}{Mapbox
|
||||
Style Spec}.
|
||||
|
||||
Given a layer \c marker from an arbitrary GeoJSON source containing features
|
||||
of type \b "Point" and \b "LineString", this example shows how to make sure
|
||||
@@ -1168,8 +1168,8 @@ QVariant QVariantFromValue(const mbgl::Value &value) {
|
||||
\layer, if any.
|
||||
|
||||
Filter value types are described in the
|
||||
{https://maplibre.org/maplibre-gl-js-docs/style-spec/#types}{Mapbox style
|
||||
specification}.
|
||||
{https://maplibre.org/maplibre-style-spec/types/}{MapLibre Style
|
||||
Spec}.
|
||||
*/
|
||||
QVariant Map::getFilter(const QString &layer) const {
|
||||
using namespace mbgl::style;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
variant/extension/privateuse/grandfathered information in a BCP 47 tag.
|
||||
|
||||
Why implement this?
|
||||
Mapbox Style Spec specifies locales with BCP 47
|
||||
MapLibre Style Spec specifies locales with BCP 47
|
||||
Android and Intl.Collator implementations speak BCP 47 out of the box
|
||||
Darwin implementation requires translation to "Language Identifier"
|
||||
We're OK with not supporting extensions, but we want to succesfully
|
||||
|
||||
Reference in New Issue
Block a user