summaryrefslogtreecommitdiff
path: root/platform/darwin/docs/guides/For Style Authors.md.ejs
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/docs/guides/For Style Authors.md.ejs')
-rw-r--r--platform/darwin/docs/guides/For Style Authors.md.ejs31
1 files changed, 28 insertions, 3 deletions
diff --git a/platform/darwin/docs/guides/For Style Authors.md.ejs b/platform/darwin/docs/guides/For Style Authors.md.ejs
index 254a7cf219..92ce4c1594 100644
--- a/platform/darwin/docs/guides/For Style Authors.md.ejs
+++ b/platform/darwin/docs/guides/For Style Authors.md.ejs
@@ -8,7 +8,7 @@
-%>
<!--
This file is generated.
- Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
+ Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
-->
# Information for Style Authors
@@ -41,7 +41,7 @@ underneath.
<% if (iOS) { -%>
The user location annotation view, the attribution button, any buttons in
callout views, and any items in the navigation bar are influenced by your
-application’s tint color, so choose a tint color that constrasts well with your
+application’s tint color, so choose a tint color that contrasts well with your
map style.
<% } -%>
If you intend your style to be used in the dark, consider the impact that Night
@@ -160,6 +160,7 @@ In the style specification | In the SDK
---------------------------|---------
class | style class
filter | predicate
+function type | interpolation mode
id | identifier
image | style image
layer | style layer
@@ -239,6 +240,30 @@ whose names differ from the style specification are listed below:
<% for (const type in renamedProperties) { -%>
<% if (renamedProperties.hasOwnProperty(type)) { -%>
+### <%- camelize(type) %> style functions
+
+The runtime styling API introduces `MGLStyleFunction` to the <%- os %> SDK.
+[Data-driven styling](data-driven-styling.html) expands `MGLStyleFunction`.
+Individual style property documentation includes which subclasses of
+`MGLStyleFunction` are enabled for that property. You can use `MGLStyleValue`
+methods to create a `MGLStyleFunction`.
+
+In style specification | In the SDK | [MGLStyleValue valueWithInterpolationMode:...]
+-----------------------|-------------------------------|-------------
+`zoom function` | `MGLCameraStyleFunction` | `cameraStops:options:`
+`property function` | `MGLSourceStyleFunction` | `sourceStops:attributeName:options:`
+`zoom-and-property functions`| `MGLCompositeStyleFunction` | `compositeStops:attributeName:options:`
+
+Data-driven styling also introduces interpolation mode, which defines the
+relationship between style values and attributes or zoom levels.
+
+In style specification | In the SDK
+-----------------------------|-----------
+`exponential` | `MGLInterpolationModeExponential`
+`interval` | `MGLInterpolationModeInterval`
+`categorical` | `MGLInterpolationModeCategorical`
+`identity` | `MGLInterpolationModeIdentity`
+
### <%- camelize(type) %> style layers
In style JSON | In Objective-C | In Swift
@@ -254,7 +279,7 @@ In style JSON | In Objective-C | In Swift
## Setting attribute values
Each property representing a layout or paint attribute is set to an
-`MGLStyleValue` object, which is either an `MGLStyleConstantValue` object (for
+`MGLStyleValue` object, which is either an `MGLConstantStyleValue` object (for
constant values) or an `MGLStyleFunction` object (for zoom level functions). The
style value object is a container for the raw value or function parameters that
you want the attribute to be set to.