summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin R. Miller <incanus@users.noreply.github.com>2016-09-30 15:55:46 -0700
committerGitHub <noreply@github.com>2016-09-30 15:55:46 -0700
commitee4715a821437e6ed374231fad2ca6193eeac499 (patch)
treea1572535dae544aea91c963d3577a4ecb99c5e2c
parent5b28ebbeca8f28e4a8d415911c51eb5070c3362a (diff)
downloadqtlocation-mapboxgl-ee4715a821437e6ed374231fad2ca6193eeac499.tar.gz
update style generation code for new style spec enum values docs (#6508)
Documentation for enum values landed in mapbox/mapbox-gl-style-spec#510. This updates Android, iOS, and macOS documentation code gen scripts to capitalize on them.
-rw-r--r--package.json2
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/CircleLayer.java2
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/FillLayer.java4
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/LineLayer.java2
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Property.java205
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java70
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/RasterLayer.java2
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/SymbolLayer.java4
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs2
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property.java.ejs19
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs10
-rw-r--r--platform/android/scripts/generate-style-code.js14
-rw-r--r--platform/android/src/style/conversion/types_string_values.hpp6
-rw-r--r--platform/android/src/style/conversion/types_string_values.hpp.ejs2
-rw-r--r--platform/darwin/scripts/generate-style-code.js46
-rw-r--r--platform/darwin/src/MGLBaseStyleLayer.h2
-rw-r--r--platform/darwin/src/MGLCircleStyleLayer.h22
-rw-r--r--platform/darwin/src/MGLFillStyleLayer.h17
-rw-r--r--platform/darwin/src/MGLLineStyleLayer.h35
-rw-r--r--platform/darwin/src/MGLStyleLayer.h.ejs20
-rw-r--r--platform/darwin/src/MGLSymbolStyleLayer.h156
-rw-r--r--platform/darwin/test/MGLSymbolStyleLayerTests.m8
-rw-r--r--scripts/generate-style-code.js2
23 files changed, 533 insertions, 119 deletions
diff --git a/package.json b/package.json
index 914a47d7ca..0c27cbe95d 100644
--- a/package.json
+++ b/package.json
@@ -21,7 +21,7 @@
"ejs": "^2.4.1",
"express": "^4.11.1",
"mapbox-gl-shaders": "mapbox/mapbox-gl-shaders#de2ab007455aa2587c552694c68583f94c9f2747",
- "mapbox-gl-style-spec": "mapbox/mapbox-gl-style-spec#23155c0f34e1e6833ca772dc8b19111ee6cd40e9",
+ "mapbox-gl-style-spec": "mapbox/mapbox-gl-style-spec#7f62a4fc9f21e619824d68abbc4b03cbc1685572",
"mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#694f0d0728f229d64d1639dc5ee7aff7f4b8ca41",
"mkdirp": "^0.5.1",
"node-cmake": "^1.2.1",
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/CircleLayer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/CircleLayer.java
index 2db084e730..79e5257ae9 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/CircleLayer.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/CircleLayer.java
@@ -34,7 +34,7 @@ public class CircleLayer extends Layer {
protected native void initialize(String layerId, String sourceId);
- /**
+ /**
* Set the source layer.
*
* @param sourceLayer the source layer to set
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/FillLayer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/FillLayer.java
index 92813f58ef..8c3bb01c39 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/FillLayer.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/FillLayer.java
@@ -34,7 +34,7 @@ public class FillLayer extends Layer {
protected native void initialize(String layerId, String sourceId);
- /**
+ /**
* Set the source layer.
*
* @param sourceLayer the source layer to set
@@ -143,7 +143,7 @@ public class FillLayer extends Layer {
return (PropertyValue<String>) new PropertyValue(nativeGetFillColor());
}
/**
- * The color of the filled part of this layer. This color can be specified as rgba with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.
+ * The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.
*
* @return int representation of a rgba string color
* @throws RuntimeException thrown if property isn't a value
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/LineLayer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/LineLayer.java
index 50f43fdb90..14bf21de84 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/LineLayer.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/LineLayer.java
@@ -34,7 +34,7 @@ public class LineLayer extends Layer {
protected native void initialize(String layerId, String sourceId);
- /**
+ /**
* Set the source layer.
*
* @param sourceLayer the source layer to set
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Property.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Property.java
index bae91313a6..aecfb3ab58 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Property.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Property.java
@@ -11,8 +11,15 @@ import java.lang.annotation.RetentionPolicy;
*/
public abstract class Property<T> {
- //visibility
+ //VISIBILITY: Whether this layer is displayed.
+
+ /**
+ * The layer is shown.
+ */
public static final String VISIBLE = "visible";
+ /**
+ * The layer is hidden.
+ */
public static final String NONE = "none";
@StringDef({
@@ -22,9 +29,19 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface VISIBILITY {}
- //line-cap
+ //LINE_CAP: The display of line endings.
+
+ /**
+ * A cap with a squared-off end which is drawn to the exact endpoint of the line.
+ */
public static final String LINE_CAP_BUTT = "butt";
+ /**
+ * A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line.
+ */
public static final String LINE_CAP_ROUND = "round";
+ /**
+ * A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width.
+ */
public static final String LINE_CAP_SQUARE = "square";
@StringDef({
@@ -35,9 +52,19 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface LINE_CAP {}
- //line-join
+ //LINE_JOIN: The display of lines when joining.
+
+ /**
+ * A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width.
+ */
public static final String LINE_JOIN_BEVEL = "bevel";
+ /**
+ * A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line.
+ */
public static final String LINE_JOIN_ROUND = "round";
+ /**
+ * A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet.
+ */
public static final String LINE_JOIN_MITER = "miter";
@StringDef({
@@ -48,8 +75,15 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface LINE_JOIN {}
- //symbol-placement
+ //SYMBOL_PLACEMENT: Label placement relative to its geometry.
+
+ /**
+ * The label is placed at the point where the geometry is located.
+ */
public static final String SYMBOL_PLACEMENT_POINT = "point";
+ /**
+ * The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries.
+ */
public static final String SYMBOL_PLACEMENT_LINE = "line";
@StringDef({
@@ -59,9 +93,19 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface SYMBOL_PLACEMENT {}
- //icon-rotation-alignment
+ //ICON_ROTATION_ALIGNMENT: In combination with `symbol-placement`, determines the rotation behavior of icons.
+
+ /**
+ * When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line`, aligns icon x-axes with the line.
+ */
public static final String ICON_ROTATION_ALIGNMENT_MAP = "map";
+ /**
+ * Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`.
+ */
public static final String ICON_ROTATION_ALIGNMENT_VIEWPORT = "viewport";
+ /**
+ * When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line`, this is equivalent to `map`.
+ */
public static final String ICON_ROTATION_ALIGNMENT_AUTO = "auto";
@StringDef({
@@ -72,24 +116,47 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface ICON_ROTATION_ALIGNMENT {}
- //icon-text-fit
+ //ICON_TEXT_FIT: Scales the icon to fit around the associated text.
+
+ /**
+ * The icon is displayed at its intrinsic aspect ratio.
+ */
public static final String ICON_TEXT_FIT_NONE = "none";
- public static final String ICON_TEXT_FIT_BOTH = "both";
+ /**
+ * The icon is scaled in the x-dimension to fit the width of the text.
+ */
public static final String ICON_TEXT_FIT_WIDTH = "width";
+ /**
+ * The icon is scaled in the y-dimension to fit the height of the text.
+ */
public static final String ICON_TEXT_FIT_HEIGHT = "height";
+ /**
+ * The icon is scaled in both x- and y-dimensions.
+ */
+ public static final String ICON_TEXT_FIT_BOTH = "both";
@StringDef({
ICON_TEXT_FIT_NONE,
- ICON_TEXT_FIT_BOTH,
ICON_TEXT_FIT_WIDTH,
ICON_TEXT_FIT_HEIGHT,
+ ICON_TEXT_FIT_BOTH,
})
@Retention(RetentionPolicy.SOURCE)
public @interface ICON_TEXT_FIT {}
- //text-pitch-alignment
+ //TEXT_PITCH_ALIGNMENT: Orientation of text when map is pitched.
+
+ /**
+ * The text is aligned to the plane of the map.
+ */
public static final String TEXT_PITCH_ALIGNMENT_MAP = "map";
+ /**
+ * The text is aligned to the plane of the viewport.
+ */
public static final String TEXT_PITCH_ALIGNMENT_VIEWPORT = "viewport";
+ /**
+ * Automatically matches the value of `text-rotation-alignment`.
+ */
public static final String TEXT_PITCH_ALIGNMENT_AUTO = "auto";
@StringDef({
@@ -100,9 +167,19 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface TEXT_PITCH_ALIGNMENT {}
- //text-rotation-alignment
+ //TEXT_ROTATION_ALIGNMENT: In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.
+
+ /**
+ * When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line`, aligns text x-axes with the line.
+ */
public static final String TEXT_ROTATION_ALIGNMENT_MAP = "map";
+ /**
+ * Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`.
+ */
public static final String TEXT_ROTATION_ALIGNMENT_VIEWPORT = "viewport";
+ /**
+ * When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line`, this is equivalent to `map`.
+ */
public static final String TEXT_ROTATION_ALIGNMENT_AUTO = "auto";
@StringDef({
@@ -113,9 +190,19 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface TEXT_ROTATION_ALIGNMENT {}
- //text-justify
+ //TEXT_JUSTIFY: Text justification options.
+
+ /**
+ * The text is aligned to the left.
+ */
public static final String TEXT_JUSTIFY_LEFT = "left";
+ /**
+ * The text is centered.
+ */
public static final String TEXT_JUSTIFY_CENTER = "center";
+ /**
+ * The text is aligned to the right.
+ */
public static final String TEXT_JUSTIFY_RIGHT = "right";
@StringDef({
@@ -126,15 +213,43 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface TEXT_JUSTIFY {}
- //text-anchor
+ //TEXT_ANCHOR: Part of the text placed closest to the anchor.
+
+ /**
+ * The center of the text is placed closest to the anchor.
+ */
public static final String TEXT_ANCHOR_CENTER = "center";
+ /**
+ * The left side of the text is placed closest to the anchor.
+ */
public static final String TEXT_ANCHOR_LEFT = "left";
+ /**
+ * The right side of the text is placed closest to the anchor.
+ */
public static final String TEXT_ANCHOR_RIGHT = "right";
+ /**
+ * The top of the text is placed closest to the anchor.
+ */
public static final String TEXT_ANCHOR_TOP = "top";
+ /**
+ * The bottom of the text is placed closest to the anchor.
+ */
public static final String TEXT_ANCHOR_BOTTOM = "bottom";
+ /**
+ * The top left corner of the text is placed closest to the anchor.
+ */
public static final String TEXT_ANCHOR_TOP_LEFT = "top-left";
+ /**
+ * The top right corner of the text is placed closest to the anchor.
+ */
public static final String TEXT_ANCHOR_TOP_RIGHT = "top-right";
+ /**
+ * The bottom left corner of the text is placed closest to the anchor.
+ */
public static final String TEXT_ANCHOR_BOTTOM_LEFT = "bottom-left";
+ /**
+ * The bottom right corner of the text is placed closest to the anchor.
+ */
public static final String TEXT_ANCHOR_BOTTOM_RIGHT = "bottom-right";
@StringDef({
@@ -151,9 +266,19 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface TEXT_ANCHOR {}
- //text-transform
+ //TEXT_TRANSFORM: Specifies how to capitalize text, similar to the CSS `text-transform` property.
+
+ /**
+ * The text is not altered.
+ */
public static final String TEXT_TRANSFORM_NONE = "none";
+ /**
+ * Forces all letters to be displayed in uppercase.
+ */
public static final String TEXT_TRANSFORM_UPPERCASE = "uppercase";
+ /**
+ * Forces all letters to be displayed in lowercase.
+ */
public static final String TEXT_TRANSFORM_LOWERCASE = "lowercase";
@StringDef({
@@ -164,8 +289,15 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface TEXT_TRANSFORM {}
- //fill-translate-anchor
+ //FILL_TRANSLATE_ANCHOR: Controls the translation reference point.
+
+ /**
+ * The fill is translated relative to the map.
+ */
public static final String FILL_TRANSLATE_ANCHOR_MAP = "map";
+ /**
+ * The fill is translated relative to the viewport.
+ */
public static final String FILL_TRANSLATE_ANCHOR_VIEWPORT = "viewport";
@StringDef({
@@ -175,8 +307,15 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface FILL_TRANSLATE_ANCHOR {}
- //line-translate-anchor
+ //LINE_TRANSLATE_ANCHOR: Controls the translation reference point.
+
+ /**
+ * The line is translated relative to the map.
+ */
public static final String LINE_TRANSLATE_ANCHOR_MAP = "map";
+ /**
+ * The line is translated relative to the viewport.
+ */
public static final String LINE_TRANSLATE_ANCHOR_VIEWPORT = "viewport";
@StringDef({
@@ -186,8 +325,15 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface LINE_TRANSLATE_ANCHOR {}
- //icon-translate-anchor
+ //ICON_TRANSLATE_ANCHOR: Controls the translation reference point.
+
+ /**
+ * Icons are translated relative to the map.
+ */
public static final String ICON_TRANSLATE_ANCHOR_MAP = "map";
+ /**
+ * Icons are translated relative to the viewport.
+ */
public static final String ICON_TRANSLATE_ANCHOR_VIEWPORT = "viewport";
@StringDef({
@@ -197,8 +343,15 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface ICON_TRANSLATE_ANCHOR {}
- //text-translate-anchor
+ //TEXT_TRANSLATE_ANCHOR: Controls the translation reference point.
+
+ /**
+ * The text is translated relative to the map.
+ */
public static final String TEXT_TRANSLATE_ANCHOR_MAP = "map";
+ /**
+ * The text is translated relative to the viewport.
+ */
public static final String TEXT_TRANSLATE_ANCHOR_VIEWPORT = "viewport";
@StringDef({
@@ -208,8 +361,15 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface TEXT_TRANSLATE_ANCHOR {}
- //circle-translate-anchor
+ //CIRCLE_TRANSLATE_ANCHOR: Controls the translation reference point.
+
+ /**
+ * The circle is translated relative to the map.
+ */
public static final String CIRCLE_TRANSLATE_ANCHOR_MAP = "map";
+ /**
+ * The circle is translated relative to the viewport.
+ */
public static final String CIRCLE_TRANSLATE_ANCHOR_VIEWPORT = "viewport";
@StringDef({
@@ -219,8 +379,15 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface CIRCLE_TRANSLATE_ANCHOR {}
- //circle-pitch-scale
+ //CIRCLE_PITCH_SCALE: Controls the scaling behavior of the circle when the map is pitched.
+
+ /**
+ * Circles are scaled according to their apparent distance to the camera.
+ */
public static final String CIRCLE_PITCH_SCALE_MAP = "map";
+ /**
+ * Circles are not scaled.
+ */
public static final String CIRCLE_PITCH_SCALE_VIEWPORT = "viewport";
@StringDef({
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java
index f5ffbb83a6..7b408448ce 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java
@@ -52,7 +52,7 @@ public class PropertyFactory {
}
/**
- * The opacity of the entire fill layer. In contrast to the fill-color, this value will also affect the 1px stroke around the fill, if the stroke is used.
+ * The opacity of the entire fill layer. In contrast to the `fillColor`, this value will also affect the 1px stroke around the fill, if the stroke is used.
*
* @param value a Float value
* @return property wrapper around Float
@@ -62,7 +62,7 @@ public class PropertyFactory {
}
/**
- * The opacity of the entire fill layer. In contrast to the fill-color, this value will also affect the 1px stroke around the fill, if the stroke is used.
+ * The opacity of the entire fill layer. In contrast to the `fillColor`, this value will also affect the 1px stroke around the fill, if the stroke is used.
*
* @param function a wrapper function for Float
* @return property wrapper around a Float function
@@ -72,7 +72,7 @@ public class PropertyFactory {
}
/**
- * The color of the filled part of this layer. This color can be specified as rgba with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.
+ * The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.
*
* @param value a int color value
* @return property wrapper around String color
@@ -82,7 +82,7 @@ public class PropertyFactory {
}
/**
- * The color of the filled part of this layer. This color can be specified as rgba with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.
+ * The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.
*
* @param value a String value
* @return property wrapper around String
@@ -92,7 +92,7 @@ public class PropertyFactory {
}
/**
- * The color of the filled part of this layer. This color can be specified as rgba with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.
+ * The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.
*
* @param function a wrapper function for String
* @return property wrapper around a String function
@@ -102,7 +102,7 @@ public class PropertyFactory {
}
/**
- * The outline color of the fill. Matches the value of `fill-color` if unspecified.
+ * The outline color of the fill. Matches the value of `fillColor` if unspecified.
*
* @param value a int color value
* @return property wrapper around String color
@@ -112,7 +112,7 @@ public class PropertyFactory {
}
/**
- * The outline color of the fill. Matches the value of `fill-color` if unspecified.
+ * The outline color of the fill. Matches the value of `fillColor` if unspecified.
*
* @param value a String value
* @return property wrapper around String
@@ -122,7 +122,7 @@ public class PropertyFactory {
}
/**
- * The outline color of the fill. Matches the value of `fill-color` if unspecified.
+ * The outline color of the fill. Matches the value of `fillColor` if unspecified.
*
* @param function a wrapper function for String
* @return property wrapper around a String function
@@ -152,7 +152,7 @@ public class PropertyFactory {
}
/**
- * Control whether the translation is relative to the map (north) or viewport (screen)
+ * Controls the translation reference point.
*
* @param value a String value
* @return property wrapper around String
@@ -162,7 +162,7 @@ public class PropertyFactory {
}
/**
- * Control whether the translation is relative to the map (north) or viewport (screen)
+ * Controls the translation reference point.
*
* @param function a wrapper function for String
* @return property wrapper around a String function
@@ -262,7 +262,7 @@ public class PropertyFactory {
}
/**
- * Control whether the translation is relative to the map (north) or viewport (screen)
+ * Controls the translation reference point.
*
* @param value a String value
* @return property wrapper around String
@@ -272,7 +272,7 @@ public class PropertyFactory {
}
/**
- * Control whether the translation is relative to the map (north) or viewport (screen)
+ * Controls the translation reference point.
*
* @param function a wrapper function for String
* @return property wrapper around a String function
@@ -452,7 +452,7 @@ public class PropertyFactory {
}
/**
- * The color of the icon's halo. Icon halos can only be used with sdf icons.
+ * The color of the icon's halo. Icon halos can only be used with SDF icons.
*
* @param value a int color value
* @return property wrapper around String color
@@ -462,7 +462,7 @@ public class PropertyFactory {
}
/**
- * The color of the icon's halo. Icon halos can only be used with sdf icons.
+ * The color of the icon's halo. Icon halos can only be used with SDF icons.
*
* @param value a String value
* @return property wrapper around String
@@ -472,7 +472,7 @@ public class PropertyFactory {
}
/**
- * The color of the icon's halo. Icon halos can only be used with sdf icons.
+ * The color of the icon's halo. Icon halos can only be used with SDF icons.
*
* @param function a wrapper function for String
* @return property wrapper around a String function
@@ -542,7 +542,7 @@ public class PropertyFactory {
}
/**
- * Control whether the translation is relative to the map (north) or viewport (screen).
+ * Controls the translation reference point.
*
* @param value a String value
* @return property wrapper around String
@@ -552,7 +552,7 @@ public class PropertyFactory {
}
/**
- * Control whether the translation is relative to the map (north) or viewport (screen).
+ * Controls the translation reference point.
*
* @param function a wrapper function for String
* @return property wrapper around a String function
@@ -702,7 +702,7 @@ public class PropertyFactory {
}
/**
- * Control whether the translation is relative to the map (north) or viewport (screen).
+ * Controls the translation reference point.
*
* @param value a String value
* @return property wrapper around String
@@ -712,7 +712,7 @@ public class PropertyFactory {
}
/**
- * Control whether the translation is relative to the map (north) or viewport (screen).
+ * Controls the translation reference point.
*
* @param function a wrapper function for String
* @return property wrapper around a String function
@@ -832,7 +832,7 @@ public class PropertyFactory {
}
/**
- * Control whether the translation is relative to the map (north) or viewport (screen)
+ * Controls the translation reference point.
*
* @param value a String value
* @return property wrapper around String
@@ -842,7 +842,7 @@ public class PropertyFactory {
}
/**
- * Control whether the translation is relative to the map (north) or viewport (screen)
+ * Controls the translation reference point.
*
* @param function a wrapper function for String
* @return property wrapper around a String function
@@ -852,7 +852,7 @@ public class PropertyFactory {
}
/**
- * Controls the scaling behavior of the circle when the map is pitched. The value `map` scales circles according to their apparent distance to the camera. The value `viewport` results in no pitch-related scaling.
+ * Controls the scaling behavior of the circle when the map is pitched.
*
* @param value a String value
* @return property wrapper around String
@@ -862,7 +862,7 @@ public class PropertyFactory {
}
/**
- * Controls the scaling behavior of the circle when the map is pitched. The value `map` scales circles according to their apparent distance to the camera. The value `viewport` results in no pitch-related scaling.
+ * Controls the scaling behavior of the circle when the map is pitched.
*
* @param function a wrapper function for String
* @return property wrapper around a String function
@@ -1162,7 +1162,7 @@ public class PropertyFactory {
}
/**
- * Label placement relative to its geometry. `line` can only be used on LineStrings and Polygons.
+ * Label placement relative to its geometry.
*
* @param value a String value
* @return property wrapper around String
@@ -1172,7 +1172,7 @@ public class PropertyFactory {
}
/**
- * Label placement relative to its geometry. `line` can only be used on LineStrings and Polygons.
+ * Label placement relative to its geometry.
*
* @param function a wrapper function for String
* @return property wrapper around a String function
@@ -1282,7 +1282,7 @@ public class PropertyFactory {
}
/**
- * In combination with `symbol-placement`, determines the rotation behavior of icons. The value `viewport` produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`. When `symbol-placement` is set to `point`, the value `map` produces icons whose x-axes are aligned east-west, and the value `auto` is equivalent to `viewport`. When `symbol-placement` is set to `line`, the value `map` produces icons whose x-axes are aligned with the line, and the value `auto` is equivalent to `map`.
+ * In combination with `symbolPlacement`, determines the rotation behavior of icons.
*
* @param value a String value
* @return property wrapper around String
@@ -1292,7 +1292,7 @@ public class PropertyFactory {
}
/**
- * In combination with `symbol-placement`, determines the rotation behavior of icons. The value `viewport` produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`. When `symbol-placement` is set to `point`, the value `map` produces icons whose x-axes are aligned east-west, and the value `auto` is equivalent to `viewport`. When `symbol-placement` is set to `line`, the value `map` produces icons whose x-axes are aligned with the line, and the value `auto` is equivalent to `map`.
+ * In combination with `symbolPlacement`, determines the rotation behavior of icons.
*
* @param function a wrapper function for String
* @return property wrapper around a String function
@@ -1322,7 +1322,7 @@ public class PropertyFactory {
}
/**
- * Scales the icon to fit around the associated text. The value `none` performs no scaling. The values `width` and `height` scale the x- or y-dimension, respectively, to fit the text's dimensions. The value `both` scales in both dimensions.
+ * Scales the icon to fit around the associated text.
*
* @param value a String value
* @return property wrapper around String
@@ -1332,7 +1332,7 @@ public class PropertyFactory {
}
/**
- * Scales the icon to fit around the associated text. The value `none` performs no scaling. The values `width` and `height` scale the x- or y-dimension, respectively, to fit the text's dimensions. The value `both` scales in both dimensions.
+ * Scales the icon to fit around the associated text.
*
* @param function a wrapper function for String
* @return property wrapper around a String function
@@ -1342,7 +1342,7 @@ public class PropertyFactory {
}
/**
- * Size of the additional area added to dimensions determined by `icon-text-fix`, in clockwise order: top, right, bottom, left.
+ * Size of the additional area added to dimensions determined by `iconTextFit`, in clockwise order: top, right, bottom, left.
*
* @param value a Float[] value
* @return property wrapper around Float[]
@@ -1352,7 +1352,7 @@ public class PropertyFactory {
}
/**
- * Size of the additional area added to dimensions determined by `icon-text-fix`, in clockwise order: top, right, bottom, left.
+ * Size of the additional area added to dimensions determined by `iconTextFit`, in clockwise order: top, right, bottom, left.
*
* @param function a wrapper function for Float[]
* @return property wrapper around a Float[] function
@@ -1462,7 +1462,7 @@ public class PropertyFactory {
}
/**
- * Orientation of text when map is pitched. Aligns text to the plane of the viewport when set to `viewport` or the plane of the map when set to `map`. Matches `text-rotation-alignment` if `auto`.
+ * Orientation of text when map is pitched.
*
* @param value a String value
* @return property wrapper around String
@@ -1472,7 +1472,7 @@ public class PropertyFactory {
}
/**
- * Orientation of text when map is pitched. Aligns text to the plane of the viewport when set to `viewport` or the plane of the map when set to `map`. Matches `text-rotation-alignment` if `auto`.
+ * Orientation of text when map is pitched.
*
* @param function a wrapper function for String
* @return property wrapper around a String function
@@ -1482,7 +1482,7 @@ public class PropertyFactory {
}
/**
- * In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text. The value `viewport` produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`. When `symbol-placement` is set to `point`, the value `map` produces glyphs whose x-axes are aligned east-west, and the value `auto` is equivalent to `viewport`. When `symbol-placement` is set to `line`, the value `map` produces glyphs whose x-axes are aligned with the line at the point where each glyph is placed, and the value `auto` is equivalent to `map`.
+ * In combination with `symbolPlacement`, determines the rotation behavior of the individual glyphs forming the text.
*
* @param value a String value
* @return property wrapper around String
@@ -1492,7 +1492,7 @@ public class PropertyFactory {
}
/**
- * In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text. The value `viewport` produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`. When `symbol-placement` is set to `point`, the value `map` produces glyphs whose x-axes are aligned east-west, and the value `auto` is equivalent to `viewport`. When `symbol-placement` is set to `line`, the value `map` produces glyphs whose x-axes are aligned with the line at the point where each glyph is placed, and the value `auto` is equivalent to `map`.
+ * In combination with `symbolPlacement`, determines the rotation behavior of the individual glyphs forming the text.
*
* @param function a wrapper function for String
* @return property wrapper around a String function
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/RasterLayer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/RasterLayer.java
index c2f4dffac8..c3abb11b68 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/RasterLayer.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/RasterLayer.java
@@ -34,7 +34,7 @@ public class RasterLayer extends Layer {
protected native void initialize(String layerId, String sourceId);
- /**
+ /**
* Set the source layer.
*
* @param sourceLayer the source layer to set
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/SymbolLayer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/SymbolLayer.java
index d1f0ed0a6a..0597828bc2 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/SymbolLayer.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/SymbolLayer.java
@@ -34,7 +34,7 @@ public class SymbolLayer extends Layer {
protected native void initialize(String layerId, String sourceId);
- /**
+ /**
* Set the source layer.
*
* @param sourceLayer the source layer to set
@@ -534,7 +534,7 @@ public class SymbolLayer extends Layer {
return (PropertyValue<String>) new PropertyValue(nativeGetIconHaloColor());
}
/**
- * The color of the icon's halo. Icon halos can only be used with sdf icons.
+ * The color of the icon's halo. Icon halos can only be used with SDF icons.
*
* @return int representation of a rgba string color
* @throws RuntimeException thrown if property isn't a value
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs
index 2695478dd8..b6c732b045 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs
@@ -50,7 +50,7 @@ public class <%- camelize(type) %>Layer extends Layer {
protected native void initialize(String layerId, String sourceId);
- /**
+ /**
* Set the source layer.
*
* @param sourceLayer the source layer to set
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property.java.ejs b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property.java.ejs
index e734a9ff11..de5330bd9c 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property.java.ejs
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property.java.ejs
@@ -14,8 +14,15 @@ import java.lang.annotation.RetentionPolicy;
*/
public abstract class Property<T> {
- //visibility
+ //VISIBILITY: Whether this layer is displayed.
+
+ /**
+ * The layer is shown.
+ */
public static final String VISIBLE = "visible";
+ /**
+ * The layer is hidden.
+ */
public static final String NONE = "none";
@StringDef({
@@ -26,13 +33,17 @@ public abstract class Property<T> {
public @interface VISIBILITY {}
<% for (const property of properties) { -%>
- //<%- property.name %>
-<% for (const value of property.values) { -%>
+ //<%- snakeCaseUpper(property.name) %>: <%- property.doc %>
+
+<% for (const value in property.values) { -%>
+ /**
+ * <%- property.values[value].doc %>
+ */
public static final String <%- snakeCaseUpper(property.name) %>_<%- snakeCaseUpper(value) %> = "<%- value %>";
<% } -%>
@StringDef({
- <% for (const value of property.values) { -%>
+ <% for (const value of Object.keys(property.values)) { -%>
<%- snakeCaseUpper(property.name) %>_<%- snakeCaseUpper(value) %>,
<% } -%>
})
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs
index 8508a735e6..cc829e9e96 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs
@@ -38,7 +38,7 @@ public class PropertyFactory {
<% for (const property of paintProperties) { -%>
<% if (property.type == 'color') { -%>
/**
- * <%- property.doc %>
+ * <%- propertyDoc(property.name, property) %>
*
* @param value a int color value
* @return property wrapper around String color
@@ -49,7 +49,7 @@ public class PropertyFactory {
<% } -%>
/**
- * <%- property.doc %>
+ * <%- propertyDoc(property.name, property) %>
*
* @param value a <%- propertyType(property) %> value
* @return property wrapper around <%- propertyType(property) %>
@@ -59,7 +59,7 @@ public class PropertyFactory {
}
/**
- * <%- property.doc %>
+ * <%- propertyDoc(property.name, property) %>
*
* @param function a wrapper function for <%- propertyType(property) %>
* @return property wrapper around a <%- propertyType(property) %> function
@@ -71,7 +71,7 @@ public class PropertyFactory {
<% } -%>
<% for (const property of layoutProperties) { -%>
/**
- * <%- property.doc %>
+ * <%- propertyDoc(property.name, property) %>
*
* @param value a <%- propertyType(property) %> value
* @return property wrapper around <%- propertyType(property) %>
@@ -81,7 +81,7 @@ public class PropertyFactory {
}
/**
- * <%- property.doc %>
+ * <%- propertyDoc(property.name, property) %>
*
* @param function a wrapper function for <%- propertyType(property) %>
* @return property wrapper around a <%- propertyType(property) %> function
diff --git a/platform/android/scripts/generate-style-code.js b/platform/android/scripts/generate-style-code.js
index 0abc4969be..80a8e12db6 100644
--- a/platform/android/scripts/generate-style-code.js
+++ b/platform/android/scripts/generate-style-code.js
@@ -116,7 +116,7 @@ global.defaultValueJava = function(property) {
case 'string':
return '"' + property['default'] + '"';
case 'enum':
- return snakeCaseUpper(property.name) + "_" + snakeCaseUpper(property.values[0]);
+ return snakeCaseUpper(property.name) + "_" + snakeCaseUpper(Object.keys(property.values)[0]);
case 'color':
return '"rgba(0, 0, 0, 1)"';
case 'array':
@@ -137,8 +137,18 @@ global.defaultValueJava = function(property) {
}
}
+global.propertyDoc = function (propertyName, property) {
+ let doc = property.doc.replace(/`(.+?)`/g, function (m, symbol, offset, str) {
+ if (str.substr(offset - 4, 3) !== 'CSS') {
+ symbol = camelizeWithLeadingLowercase(symbol);
+ }
+ return '`' + symbol + '`';
+ });
+ return doc;
+};
+
//Process Layers
-const layers = spec.layer.type.values.map((type) => {
+const layers = Object.keys(spec.layer.type.values).map((type) => {
const layoutProperties = Object.keys(spec[`layout_${type}`]).reduce((memo, name) => {
if (name !== 'visibility') {
spec[`layout_${type}`][name].name = name;
diff --git a/platform/android/src/style/conversion/types_string_values.hpp b/platform/android/src/style/conversion/types_string_values.hpp
index d44de733d4..b42ca52acd 100644
--- a/platform/android/src/style/conversion/types_string_values.hpp
+++ b/platform/android/src/style/conversion/types_string_values.hpp
@@ -95,15 +95,15 @@ namespace conversion {
case mbgl::style::IconTextFitType::None:
return "none";
break;
- case mbgl::style::IconTextFitType::Both:
- return "both";
- break;
case mbgl::style::IconTextFitType::Width:
return "width";
break;
case mbgl::style::IconTextFitType::Height:
return "height";
break;
+ case mbgl::style::IconTextFitType::Both:
+ return "both";
+ break;
default:
throw std::runtime_error("Not implemented");
}
diff --git a/platform/android/src/style/conversion/types_string_values.hpp.ejs b/platform/android/src/style/conversion/types_string_values.hpp.ejs
index db90a614f5..39021d390d 100644
--- a/platform/android/src/style/conversion/types_string_values.hpp.ejs
+++ b/platform/android/src/style/conversion/types_string_values.hpp.ejs
@@ -31,7 +31,7 @@ namespace conversion {
//<%- property.name %>
inline std::string toString(mbgl::style::<%- propertyNativeType(property) %> value) {
switch (value) {
-<% for (const value of property.values) { -%>
+<% for (const value in property.values) { -%>
case mbgl::style::<%- propertyNativeType(property) %>::<%- camelize(value) %>:
return "<%- value %>";
break;
diff --git a/platform/darwin/scripts/generate-style-code.js b/platform/darwin/scripts/generate-style-code.js
index 33ac014295..7fca6021df 100644
--- a/platform/darwin/scripts/generate-style-code.js
+++ b/platform/darwin/scripts/generate-style-code.js
@@ -20,7 +20,13 @@ global.camelizeWithLeadingLowercase = function (str) {
});
};
-global.objCName = function (property) { return camelizeWithLeadingLowercase(property.name); }
+global.objCName = function (property) {
+ return camelizeWithLeadingLowercase(property.name);
+}
+
+global.objCType = function (layerType, propertyName) {
+ return `${prefix}${camelize(layerType)}${suffix}${camelize(propertyName)}`;
+}
global.arrayType = function (property) {
return property.type === 'array' ? property.name.split('-').pop() : false;
@@ -53,8 +59,8 @@ global.testHelperMessage = function (property, layerType, isFunction) {
case 'string':
return 'testString' + fnSuffix;
case 'enum':
- let objCType = `${prefix}${camelize(layerType)}${suffix}${camelize(property.name)}`;
- let objCEnum = `${objCType}${camelize(property.values[property.values.length-1])}`;
+ let objCType = global.objCType(layerType, property.name);
+ let objCEnum = `${objCType}${camelize(Object.keys(property.values)[Object.keys(property.values).length-1])}`;
return `testEnum${fnSuffix}:${objCEnum} type:@encode(${objCType})`;
case 'color':
return 'testColor' + fnSuffix;
@@ -77,10 +83,25 @@ global.testHelperMessage = function (property, layerType, isFunction) {
}
};
-global.propertyDoc = function (property, layerType) {
- let doc = property.doc.replace(/`(.+?)`/g, function (m, symbol, offset, str) {
- if ('values' in property && property.values.indexOf(symbol) !== -1) {
- let objCType = `${prefix}${camelize(layerType)}${suffix}${camelize(property.name)}`;
+global.propertyDoc = function (propertyName, property, layerType) {
+ // Match references to other property names & values.
+ // Requires the format 'When `foo` is set to `bar`,'.
+ let doc = property.doc.replace(/When `(.+?)` is set to `(.+?)`,/g, function (m, peerPropertyName, propertyValue, offset, str) {
+ let otherProperty = camelizeWithLeadingLowercase(peerPropertyName);
+ let otherValue = objCType(layerType, peerPropertyName) + camelize(propertyValue);
+ return 'When `' + `${otherProperty}` + '` is set to `' + `${otherValue}` + '`,';
+ });
+ // Match references to our own property values.
+ // Requires the format 'is equivalent to `bar`'.
+ doc = doc.replace(/is equivalent to `(.+?)`/g, function(m, propertyValue, offset, str) {
+ propertyValue = objCType(layerType, propertyName) + camelize(propertyValue);
+ return 'is equivalent to `' + propertyValue + '`';
+ });
+ // Format everything else: our property name & its possible values.
+ // Requires symbols to be surrounded by backticks.
+ doc = doc.replace(/`(.+?)`/g, function (m, symbol, offset, str) {
+ if ('values' in property && Object.keys(property.values).indexOf(symbol) !== -1) {
+ let objCType = objCType(layerType, property.name);
return '`' + `${objCType}${camelize(symbol)}` + '`';
}
if (str.substr(offset - 4, 3) !== 'CSS') {
@@ -88,6 +109,7 @@ global.propertyDoc = function (property, layerType) {
}
return '`' + symbol + '`';
});
+ // Format references to units.
if ('units' in property) {
if (!property.units.match(/s$/)) {
property.units += 's';
@@ -138,11 +160,11 @@ global.describeValue = function (value, property, layerType) {
let conjunction = '';
if (value.length === 2 && i === 0) conjunction = 'either ';
if (i === value.length - 1) conjunction = 'or ';
- let objCType = `${prefix}${camelize(layerType)}${suffix}${camelize(property.name)}`;
+ let objCType = global.objCType(layerType, property.name);
return `${conjunction}\`${objCType}${camelize(possibleValue)}\``;
}).join(separator);
} else {
- let objCType = `${prefix}${camelize(layerType)}${suffix}${camelize(property.name)}`;
+ let objCType = global.objCType(layerType, property.name);
displayValue = `\`${objCType}${camelize(value)}\``;
}
return `an \`NSValue\` object containing ${displayValue}`;
@@ -222,7 +244,7 @@ global.setterImplementation = function(property, layerType) {
implementation = `self.layer->set${camelize(property.name)}(${objCName(property)}.mbgl_stringPropertyValue);`;
break;
case 'enum':
- let objCType = `${prefix}${camelize(layerType)}${suffix}${camelize(property.name)}`;
+ let objCType = global.objCType(layerType, property.name);
implementation = `MGLSetEnumProperty(${objCName(property)}, ${camelize(property.name)}, ${mbglType(property)}, ${objCType});`;
break;
case 'color':
@@ -272,7 +294,7 @@ global.styleAttributeFactory = function (property, layerType) {
global.getterImplementation = function(property, layerType) {
if (property.type === 'enum') {
- let objCType = `${prefix}${camelize(layerType)}${suffix}${camelize(property.name)}`;
+ let objCType = global.objCType(layerType, property.name);
return `MGLGetEnumProperty(${camelize(property.name)}, ${mbglType(property)}, ${objCType});`;
}
let rawValue = `self.layer->get${camelize(property.name)}() ?: self.layer->getDefault${camelize(property.name)}()`;
@@ -299,7 +321,7 @@ const layerH = ejs.compile(fs.readFileSync('platform/darwin/src/MGLStyleLayer.h.
const layerM = ejs.compile(fs.readFileSync('platform/darwin/src/MGLStyleLayer.mm.ejs', 'utf8'), { strict: true});
const testLayers = ejs.compile(fs.readFileSync('platform/darwin/src/MGLRuntimeStylingTests.m.ejs', 'utf8'), { strict: true});
-const layers = spec.layer.type.values.map((type) => {
+const layers = Object.keys(spec.layer.type.values).map((type) => {
const layoutProperties = Object.keys(spec[`layout_${type}`]).reduce((memo, name) => {
if (name !== 'visibility') {
spec[`layout_${type}`][name].name = name;
diff --git a/platform/darwin/src/MGLBaseStyleLayer.h b/platform/darwin/src/MGLBaseStyleLayer.h
index 6cd525a0fd..fee7707c64 100644
--- a/platform/darwin/src/MGLBaseStyleLayer.h
+++ b/platform/darwin/src/MGLBaseStyleLayer.h
@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface MGLBaseStyleLayer : NSObject
/**
- The display of the layer. A value of `NO` hides the layer.
+ Whether this layer is displayed. A value of `NO` hides the layer.
*/
@property (nonatomic, assign, getter=isVisible) BOOL visible;
diff --git a/platform/darwin/src/MGLCircleStyleLayer.h b/platform/darwin/src/MGLCircleStyleLayer.h
index 2cda065b52..9e620eeeec 100644
--- a/platform/darwin/src/MGLCircleStyleLayer.h
+++ b/platform/darwin/src/MGLCircleStyleLayer.h
@@ -6,13 +6,31 @@
NS_ASSUME_NONNULL_BEGIN
+/**
+ Controls the translation reference point.
+ */
typedef NS_ENUM(NSUInteger, MGLCircleStyleLayerCircleTranslateAnchor) {
+ /**
+ The circle is translated relative to the map.
+ */
MGLCircleStyleLayerCircleTranslateAnchorMap,
+ /**
+ The circle is translated relative to the viewport.
+ */
MGLCircleStyleLayerCircleTranslateAnchorViewport,
};
+/**
+ Controls the scaling behavior of the circle when the map is pitched.
+ */
typedef NS_ENUM(NSUInteger, MGLCircleStyleLayerCirclePitchScale) {
+ /**
+ Circles are scaled according to their apparent distance to the camera.
+ */
MGLCircleStyleLayerCirclePitchScaleMap,
+ /**
+ Circles are not scaled.
+ */
MGLCircleStyleLayerCirclePitchScaleViewport,
};
@@ -87,7 +105,7 @@ typedef NS_ENUM(NSUInteger, MGLCircleStyleLayerCirclePitchScale) {
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> circleTranslate;
/**
- Control whether the translation is relative to the map (north) or viewport (screen)
+ Controls the translation reference point.
The default value of this property is an `NSValue` object containing `MGLCircleStyleLayerCircleTranslateAnchorMap`. Set this property to `nil` to reset it to the default value.
@@ -96,7 +114,7 @@ typedef NS_ENUM(NSUInteger, MGLCircleStyleLayerCirclePitchScale) {
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> circleTranslateAnchor;
/**
- Controls the scaling behavior of the circle when the map is pitched. The value `MGLCircleStyleLayerCirclePitchScaleMap` scales circles according to their apparent distance to the camera. The value `MGLCircleStyleLayerCirclePitchScaleViewport` results in no pitch-related scaling.
+ Controls the scaling behavior of the circle when the map is pitched.
The default value of this property is an `NSValue` object containing `MGLCircleStyleLayerCirclePitchScaleMap`. Set this property to `nil` to reset it to the default value.
*/
diff --git a/platform/darwin/src/MGLFillStyleLayer.h b/platform/darwin/src/MGLFillStyleLayer.h
index ab30efff5c..9adfd7c432 100644
--- a/platform/darwin/src/MGLFillStyleLayer.h
+++ b/platform/darwin/src/MGLFillStyleLayer.h
@@ -6,8 +6,17 @@
NS_ASSUME_NONNULL_BEGIN
+/**
+ Controls the translation reference point.
+ */
typedef NS_ENUM(NSUInteger, MGLFillStyleLayerFillTranslateAnchor) {
+ /**
+ The fill is translated relative to the map.
+ */
MGLFillStyleLayerFillTranslateAnchorMap,
+ /**
+ The fill is translated relative to the viewport.
+ */
MGLFillStyleLayerFillTranslateAnchorViewport,
};
@@ -41,7 +50,7 @@ typedef NS_ENUM(NSUInteger, MGLFillStyleLayerFillTranslateAnchor) {
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> fillAntialias;
/**
- The opacity of the entire fill layer. In contrast to the fill-color, this value will also affect the 1pt stroke around the fill, if the stroke is used.
+ The opacity of the entire fill layer. In contrast to the `fillColor`, this value will also affect the 1pt stroke around the fill, if the stroke is used.
The default value of this property is an `NSNumber` object containing the float `1`. Set this property to `nil` to reset it to the default value.
*/
@@ -49,7 +58,7 @@ typedef NS_ENUM(NSUInteger, MGLFillStyleLayerFillTranslateAnchor) {
#if TARGET_OS_IPHONE
/**
- The color of the filled part of this layer. This color can be specified as rgba with an alpha component and the color's opacity will not affect the opacity of the 1pt stroke, if it is used.
+ The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1pt stroke, if it is used.
The default value of this property is `UIColor.blackColor`. Set this property to `nil` to reset it to the default value.
@@ -58,7 +67,7 @@ typedef NS_ENUM(NSUInteger, MGLFillStyleLayerFillTranslateAnchor) {
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> fillColor;
#else
/**
- The color of the filled part of this layer. This color can be specified as rgba with an alpha component and the color's opacity will not affect the opacity of the 1pt stroke, if it is used.
+ The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1pt stroke, if it is used.
The default value of this property is `NSColor.blackColor`. Set this property to `nil` to reset it to the default value.
@@ -84,7 +93,7 @@ typedef NS_ENUM(NSUInteger, MGLFillStyleLayerFillTranslateAnchor) {
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> fillTranslate;
/**
- Control whether the translation is relative to the map (north) or viewport (screen)
+ Controls the translation reference point.
The default value of this property is an `NSValue` object containing `MGLFillStyleLayerFillTranslateAnchorMap`. Set this property to `nil` to reset it to the default value.
diff --git a/platform/darwin/src/MGLLineStyleLayer.h b/platform/darwin/src/MGLLineStyleLayer.h
index 58c601d53c..d0a341d024 100644
--- a/platform/darwin/src/MGLLineStyleLayer.h
+++ b/platform/darwin/src/MGLLineStyleLayer.h
@@ -6,20 +6,53 @@
NS_ASSUME_NONNULL_BEGIN
+/**
+ The display of line endings.
+ */
typedef NS_ENUM(NSUInteger, MGLLineStyleLayerLineCap) {
+ /**
+ A cap with a squared-off end which is drawn to the exact endpoint of the line.
+ */
MGLLineStyleLayerLineCapButt,
+ /**
+ A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line.
+ */
MGLLineStyleLayerLineCapRound,
+ /**
+ A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width.
+ */
MGLLineStyleLayerLineCapSquare,
};
+/**
+ The display of lines when joining.
+ */
typedef NS_ENUM(NSUInteger, MGLLineStyleLayerLineJoin) {
+ /**
+ A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width.
+ */
MGLLineStyleLayerLineJoinBevel,
+ /**
+ A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line.
+ */
MGLLineStyleLayerLineJoinRound,
+ /**
+ A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet.
+ */
MGLLineStyleLayerLineJoinMiter,
};
+/**
+ Controls the translation reference point.
+ */
typedef NS_ENUM(NSUInteger, MGLLineStyleLayerLineTranslateAnchor) {
+ /**
+ The line is translated relative to the map.
+ */
MGLLineStyleLayerLineTranslateAnchorMap,
+ /**
+ The line is translated relative to the viewport.
+ */
MGLLineStyleLayerLineTranslateAnchorViewport,
};
@@ -116,7 +149,7 @@ typedef NS_ENUM(NSUInteger, MGLLineStyleLayerLineTranslateAnchor) {
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> lineTranslate;
/**
- Control whether the translation is relative to the map (north) or viewport (screen)
+ Controls the translation reference point.
The default value of this property is an `NSValue` object containing `MGLLineStyleLayerLineTranslateAnchorMap`. Set this property to `nil` to reset it to the default value.
diff --git a/platform/darwin/src/MGLStyleLayer.h.ejs b/platform/darwin/src/MGLStyleLayer.h.ejs
index 054adcb32e..40b750e73c 100644
--- a/platform/darwin/src/MGLStyleLayer.h.ejs
+++ b/platform/darwin/src/MGLStyleLayer.h.ejs
@@ -15,8 +15,14 @@ NS_ASSUME_NONNULL_BEGIN
<% for (const property of layoutProperties) { -%>
<% if (property.type == "enum") { -%>
+/**
+ <%- propertyDoc(property.name, property, type) %>
+ */
typedef NS_ENUM(NSUInteger, MGL<%- camelize(type) %>StyleLayer<%- camelize(property.name) %>) {
-<% for (const value of property.values) { -%>
+<% for (const value in property.values) { -%>
+ /**
+ <%- propertyDoc(property.name, property.values[value], type) %>
+ */
MGL<%- camelize(type) %>StyleLayer<%- camelize(property.name) %><%- camelize(value) %>,
<% } -%>
};
@@ -25,8 +31,14 @@ typedef NS_ENUM(NSUInteger, MGL<%- camelize(type) %>StyleLayer<%- camelize(prope
<% } -%>
<% for (const property of paintProperties) { -%>
<% if (property.type == "enum") { -%>
+/**
+ <%- propertyDoc(property.name, property, type) %>
+ */
typedef NS_ENUM(NSUInteger, MGL<%- camelize(type) %>StyleLayer<%- camelize(property.name) %>) {
-<% for (const value of property.values) { -%>
+<% for (const value in property.values) { -%>
+ /**
+ <%- propertyDoc(property.name, property.values[value], type) %>
+ */
MGL<%- camelize(type) %>StyleLayer<%- camelize(property.name) %><%- camelize(value) %>,
<% } -%>
};
@@ -75,7 +87,7 @@ typedef NS_ENUM(NSUInteger, MGL<%- camelize(type) %>StyleLayer<%- camelize(prope
<% for (const property of layoutProperties) { -%>
/**
- <%- propertyDoc(property, type) %>
+ <%- propertyDoc(property.name, property, type) %>
<% if ('default' in property) { -%>
The default value of this property is <%- propertyDefault(property, type) %>.<% if (!property.required) { %> Set this property to `nil` to reset it to the default value.<% } %>
@@ -93,7 +105,7 @@ typedef NS_ENUM(NSUInteger, MGL<%- camelize(type) %>StyleLayer<%- camelize(prope
<% for (const property of paintProperties) { -%>
/**
- <%- propertyDoc(property, type) %>
+ <%- propertyDoc(property.name, property, type) %>
<% if ('default' in property) { -%>
The default value of this property is <%- propertyDefault(property, type) %>.<% if (!property.required) { %> Set this property to `nil` to reset it to the default value.<% } %>
diff --git a/platform/darwin/src/MGLSymbolStyleLayer.h b/platform/darwin/src/MGLSymbolStyleLayer.h
index c501f512e8..b805ee18da 100644
--- a/platform/darwin/src/MGLSymbolStyleLayer.h
+++ b/platform/darwin/src/MGLSymbolStyleLayer.h
@@ -6,67 +6,199 @@
NS_ASSUME_NONNULL_BEGIN
+/**
+ Label placement relative to its geometry.
+ */
typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerSymbolPlacement) {
+ /**
+ The label is placed at the point where the geometry is located.
+ */
MGLSymbolStyleLayerSymbolPlacementPoint,
+ /**
+ The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries.
+ */
MGLSymbolStyleLayerSymbolPlacementLine,
};
+/**
+ In combination with `symbolPlacement`, determines the rotation behavior of icons.
+ */
typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerIconRotationAlignment) {
+ /**
+ When `symbolPlacement` is set to `MGLSymbolStyleLayerSymbolPlacementPoint`, aligns icons east-west. When `symbolPlacement` is set to `MGLSymbolStyleLayerSymbolPlacementLine`, aligns icon x-axes with the line.
+ */
MGLSymbolStyleLayerIconRotationAlignmentMap,
+ /**
+ Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbolPlacement`.
+ */
MGLSymbolStyleLayerIconRotationAlignmentViewport,
+ /**
+ When `symbolPlacement` is set to `MGLSymbolStyleLayerSymbolPlacementPoint`, this is equivalent to `MGLSymbolStyleLayerIconRotationAlignmentViewport`. When `symbolPlacement` is set to `MGLSymbolStyleLayerSymbolPlacementLine`, this is equivalent to `MGLSymbolStyleLayerIconRotationAlignmentMap`.
+ */
MGLSymbolStyleLayerIconRotationAlignmentAuto,
};
+/**
+ Scales the icon to fit around the associated text.
+ */
typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerIconTextFit) {
+ /**
+ The icon is displayed at its intrinsic aspect ratio.
+ */
MGLSymbolStyleLayerIconTextFitNone,
- MGLSymbolStyleLayerIconTextFitBoth,
+ /**
+ The icon is scaled in the x-dimension to fit the width of the text.
+ */
MGLSymbolStyleLayerIconTextFitWidth,
+ /**
+ The icon is scaled in the y-dimension to fit the height of the text.
+ */
MGLSymbolStyleLayerIconTextFitHeight,
+ /**
+ The icon is scaled in both x- and y-dimensions.
+ */
+ MGLSymbolStyleLayerIconTextFitBoth,
};
+/**
+ Orientation of text when map is pitched.
+ */
typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextPitchAlignment) {
+ /**
+ The text is aligned to the plane of the map.
+ */
MGLSymbolStyleLayerTextPitchAlignmentMap,
+ /**
+ The text is aligned to the plane of the viewport.
+ */
MGLSymbolStyleLayerTextPitchAlignmentViewport,
+ /**
+ Automatically matches the value of `textRotationAlignment`.
+ */
MGLSymbolStyleLayerTextPitchAlignmentAuto,
};
+/**
+ In combination with `symbolPlacement`, determines the rotation behavior of the individual glyphs forming the text.
+ */
typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextRotationAlignment) {
+ /**
+ When `symbolPlacement` is set to `MGLSymbolStyleLayerSymbolPlacementPoint`, aligns text east-west. When `symbolPlacement` is set to `MGLSymbolStyleLayerSymbolPlacementLine`, aligns text x-axes with the line.
+ */
MGLSymbolStyleLayerTextRotationAlignmentMap,
+ /**
+ Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbolPlacement`.
+ */
MGLSymbolStyleLayerTextRotationAlignmentViewport,
+ /**
+ When `symbolPlacement` is set to `MGLSymbolStyleLayerSymbolPlacementPoint`, this is equivalent to `MGLSymbolStyleLayerTextRotationAlignmentViewport`. When `symbolPlacement` is set to `MGLSymbolStyleLayerSymbolPlacementLine`, this is equivalent to `MGLSymbolStyleLayerTextRotationAlignmentMap`.
+ */
MGLSymbolStyleLayerTextRotationAlignmentAuto,
};
+/**
+ Text justification options.
+ */
typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextJustify) {
+ /**
+ The text is aligned to the left.
+ */
MGLSymbolStyleLayerTextJustifyLeft,
+ /**
+ The text is centered.
+ */
MGLSymbolStyleLayerTextJustifyCenter,
+ /**
+ The text is aligned to the right.
+ */
MGLSymbolStyleLayerTextJustifyRight,
};
+/**
+ Part of the text placed closest to the anchor.
+ */
typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextAnchor) {
+ /**
+ The center of the text is placed closest to the anchor.
+ */
MGLSymbolStyleLayerTextAnchorCenter,
+ /**
+ The left side of the text is placed closest to the anchor.
+ */
MGLSymbolStyleLayerTextAnchorLeft,
+ /**
+ The right side of the text is placed closest to the anchor.
+ */
MGLSymbolStyleLayerTextAnchorRight,
+ /**
+ The top of the text is placed closest to the anchor.
+ */
MGLSymbolStyleLayerTextAnchorTop,
+ /**
+ The bottom of the text is placed closest to the anchor.
+ */
MGLSymbolStyleLayerTextAnchorBottom,
+ /**
+ The top left corner of the text is placed closest to the anchor.
+ */
MGLSymbolStyleLayerTextAnchorTopLeft,
+ /**
+ The top right corner of the text is placed closest to the anchor.
+ */
MGLSymbolStyleLayerTextAnchorTopRight,
+ /**
+ The bottom left corner of the text is placed closest to the anchor.
+ */
MGLSymbolStyleLayerTextAnchorBottomLeft,
+ /**
+ The bottom right corner of the text is placed closest to the anchor.
+ */
MGLSymbolStyleLayerTextAnchorBottomRight,
};
+/**
+ Specifies how to capitalize text, similar to the CSS `text-transform` property.
+ */
typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTransform) {
+ /**
+ The text is not altered.
+ */
MGLSymbolStyleLayerTextTransformNone,
+ /**
+ Forces all letters to be displayed in uppercase.
+ */
MGLSymbolStyleLayerTextTransformUppercase,
+ /**
+ Forces all letters to be displayed in lowercase.
+ */
MGLSymbolStyleLayerTextTransformLowercase,
};
+/**
+ Controls the translation reference point.
+ */
typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerIconTranslateAnchor) {
+ /**
+ Icons are translated relative to the map.
+ */
MGLSymbolStyleLayerIconTranslateAnchorMap,
+ /**
+ Icons are translated relative to the viewport.
+ */
MGLSymbolStyleLayerIconTranslateAnchorViewport,
};
+/**
+ Controls the translation reference point.
+ */
typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
+ /**
+ The text is translated relative to the map.
+ */
MGLSymbolStyleLayerTextTranslateAnchorMap,
+ /**
+ The text is translated relative to the viewport.
+ */
MGLSymbolStyleLayerTextTranslateAnchorViewport,
};
@@ -93,7 +225,7 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
#pragma mark - Accessing the Layout Attributes
/**
- Label placement relative to its geometry. `MGLSymbolStyleLayerSymbolPlacementLine` can only be used on LineStrings and Polygons.
+ Label placement relative to its geometry.
The default value of this property is an `NSValue` object containing `MGLSymbolStyleLayerSymbolPlacementPoint`. Set this property to `nil` to reset it to the default value.
*/
@@ -145,7 +277,7 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconOptional;
/**
- In combination with `symbolPlacement`, determines the rotation behavior of icons. The value `MGLSymbolStyleLayerIconRotationAlignmentViewport` produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbolPlacement`. When `symbolPlacement` is set to `point`, the value `MGLSymbolStyleLayerIconRotationAlignmentMap` produces icons whose x-axes are aligned east-west, and the value `MGLSymbolStyleLayerIconRotationAlignmentAuto` is equivalent to `MGLSymbolStyleLayerIconRotationAlignmentViewport`. When `symbolPlacement` is set to `line`, the value `MGLSymbolStyleLayerIconRotationAlignmentMap` produces icons whose x-axes are aligned with the line, and the value `MGLSymbolStyleLayerIconRotationAlignmentAuto` is equivalent to `MGLSymbolStyleLayerIconRotationAlignmentMap`.
+ In combination with `symbolPlacement`, determines the rotation behavior of icons.
The default value of this property is an `NSValue` object containing `MGLSymbolStyleLayerIconRotationAlignmentAuto`. Set this property to `nil` to reset it to the default value.
@@ -163,7 +295,7 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconSize;
/**
- Scales the icon to fit around the associated text. The value `MGLSymbolStyleLayerIconTextFitNone` performs no scaling. The values `MGLSymbolStyleLayerIconTextFitWidth` and `MGLSymbolStyleLayerIconTextFitHeight` scale the x- or y-dimension, respectively, to fit the text's dimensions. The value `MGLSymbolStyleLayerIconTextFitBoth` scales in both dimensions.
+ Scales the icon to fit around the associated text.
The default value of this property is an `NSValue` object containing `MGLSymbolStyleLayerIconTextFitNone`. Set this property to `nil` to reset it to the default value.
@@ -172,13 +304,13 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconTextFit;
/**
- Size of the additional area added to dimensions determined by `iconTextFix`, in clockwise order: top, right, bottom, left.
+ Size of the additional area added to dimensions determined by `iconTextFit`, in clockwise order: top, right, bottom, left.
This property is measured in points.
The default value of this property is an `NSValue` object containing `NSEdgeInsetsZero` or `UIEdgeInsetsZero`. Set this property to `nil` to reset it to the default value.
- This property is only applied to the style if `iconImage` is non-`nil`, and `iconTextFit` is non-`nil`, and `textField` is non-`nil`. Otherwise, it is ignored.
+ This property is only applied to the style if `iconImage` is non-`nil`, and `textField` is non-`nil`, and `iconTextFit` is set to an `NSValue` object containing `MGLSymbolStyleLayerIconTextFitBoth`, `MGLSymbolStyleLayerIconTextFitWidth`, or `MGLSymbolStyleLayerIconTextFitHeight`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconTextFitPadding;
@@ -228,7 +360,7 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconOffset;
/**
- Orientation of text when map is pitched. Aligns text to the plane of the viewport when set to `MGLSymbolStyleLayerTextPitchAlignmentViewport` or the plane of the map when set to `MGLSymbolStyleLayerTextPitchAlignmentMap`. Matches `textRotationAlignment` if `MGLSymbolStyleLayerTextPitchAlignmentAuto`.
+ Orientation of text when map is pitched.
The default value of this property is an `NSValue` object containing `MGLSymbolStyleLayerTextPitchAlignmentAuto`. Set this property to `nil` to reset it to the default value.
@@ -237,7 +369,7 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textPitchAlignment;
/**
- In combination with `symbolPlacement`, determines the rotation behavior of the individual glyphs forming the text. The value `MGLSymbolStyleLayerTextRotationAlignmentViewport` produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbolPlacement`. When `symbolPlacement` is set to `point`, the value `MGLSymbolStyleLayerTextRotationAlignmentMap` produces glyphs whose x-axes are aligned east-west, and the value `MGLSymbolStyleLayerTextRotationAlignmentAuto` is equivalent to `MGLSymbolStyleLayerTextRotationAlignmentViewport`. When `symbolPlacement` is set to `line`, the value `MGLSymbolStyleLayerTextRotationAlignmentMap` produces glyphs whose x-axes are aligned with the line at the point where each glyph is placed, and the value `MGLSymbolStyleLayerTextRotationAlignmentAuto` is equivalent to `MGLSymbolStyleLayerTextRotationAlignmentMap`.
+ In combination with `symbolPlacement`, determines the rotation behavior of the individual glyphs forming the text.
The default value of this property is an `NSValue` object containing `MGLSymbolStyleLayerTextRotationAlignmentAuto`. Set this property to `nil` to reset it to the default value.
@@ -445,7 +577,7 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
#if TARGET_OS_IPHONE
/**
- The color of the icon's halo. Icon halos can only be used with sdf icons.
+ The color of the icon's halo. Icon halos can only be used with SDF icons.
The default value of this property is `UIColor.clearColor`. Set this property to `nil` to reset it to the default value.
@@ -454,7 +586,7 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconHaloColor;
#else
/**
- The color of the icon's halo. Icon halos can only be used with sdf icons.
+ The color of the icon's halo. Icon halos can only be used with SDF icons.
The default value of this property is `NSColor.clearColor`. Set this property to `nil` to reset it to the default value.
@@ -497,7 +629,7 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconTranslate;
/**
- Control whether the translation is relative to the map (north) or viewport (screen).
+ Controls the translation reference point.
The default value of this property is an `NSValue` object containing `MGLSymbolStyleLayerIconTranslateAnchorMap`. Set this property to `nil` to reset it to the default value.
@@ -588,7 +720,7 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textTranslate;
/**
- Control whether the translation is relative to the map (north) or viewport (screen).
+ Controls the translation reference point.
The default value of this property is an `NSValue` object containing `MGLSymbolStyleLayerTextTranslateAnchorMap`. Set this property to `nil` to reset it to the default value.
diff --git a/platform/darwin/test/MGLSymbolStyleLayerTests.m b/platform/darwin/test/MGLSymbolStyleLayerTests.m
index deee9f47ed..096a49b571 100644
--- a/platform/darwin/test/MGLSymbolStyleLayerTests.m
+++ b/platform/darwin/test/MGLSymbolStyleLayerTests.m
@@ -24,7 +24,7 @@ MGLSymbolStyleLayer *layer = [[MGLSymbolStyleLayer alloc] initWithLayerIdentifie
layer.iconOptional = [MGLRuntimeStylingHelper testBool];
layer.iconRotationAlignment = [MGLRuntimeStylingHelper testEnum:MGLSymbolStyleLayerIconRotationAlignmentAuto type:@encode(MGLSymbolStyleLayerIconRotationAlignment)];
layer.iconSize = [MGLRuntimeStylingHelper testNumber];
- layer.iconTextFit = [MGLRuntimeStylingHelper testEnum:MGLSymbolStyleLayerIconTextFitHeight type:@encode(MGLSymbolStyleLayerIconTextFit)];
+ layer.iconTextFit = [MGLRuntimeStylingHelper testEnum:MGLSymbolStyleLayerIconTextFitBoth type:@encode(MGLSymbolStyleLayerIconTextFit)];
layer.iconTextFitPadding = [MGLRuntimeStylingHelper testPadding];
layer.iconImage = [MGLRuntimeStylingHelper testString];
layer.iconRotate = [MGLRuntimeStylingHelper testNumber];
@@ -74,7 +74,7 @@ MGLSymbolStyleLayer *layer = [[MGLSymbolStyleLayer alloc] initWithLayerIdentifie
XCTAssertEqualObjects(gLayer.iconOptional, [MGLRuntimeStylingHelper testBool]);
XCTAssert([(NSValue *)gLayer.iconRotationAlignment isEqualToValue:[MGLRuntimeStylingHelper testEnum:MGLSymbolStyleLayerIconRotationAlignmentAuto type:@encode(MGLSymbolStyleLayerIconRotationAlignment)]], @"%@ is not equal to %@", gLayer.iconRotationAlignment, [MGLRuntimeStylingHelper testEnum:MGLSymbolStyleLayerIconRotationAlignmentAuto type:@encode(MGLSymbolStyleLayerIconRotationAlignment)]);
XCTAssertEqualObjects(gLayer.iconSize, [MGLRuntimeStylingHelper testNumber]);
- XCTAssert([(NSValue *)gLayer.iconTextFit isEqualToValue:[MGLRuntimeStylingHelper testEnum:MGLSymbolStyleLayerIconTextFitHeight type:@encode(MGLSymbolStyleLayerIconTextFit)]], @"%@ is not equal to %@", gLayer.iconTextFit, [MGLRuntimeStylingHelper testEnum:MGLSymbolStyleLayerIconTextFitHeight type:@encode(MGLSymbolStyleLayerIconTextFit)]);
+ XCTAssert([(NSValue *)gLayer.iconTextFit isEqualToValue:[MGLRuntimeStylingHelper testEnum:MGLSymbolStyleLayerIconTextFitBoth type:@encode(MGLSymbolStyleLayerIconTextFit)]], @"%@ is not equal to %@", gLayer.iconTextFit, [MGLRuntimeStylingHelper testEnum:MGLSymbolStyleLayerIconTextFitBoth type:@encode(MGLSymbolStyleLayerIconTextFit)]);
XCTAssertEqualObjects(gLayer.iconTextFitPadding, [MGLRuntimeStylingHelper testPadding]);
XCTAssertEqualObjects(gLayer.iconImage, [MGLRuntimeStylingHelper testString]);
XCTAssertEqualObjects(gLayer.iconRotate, [MGLRuntimeStylingHelper testNumber]);
@@ -123,7 +123,7 @@ MGLSymbolStyleLayer *layer = [[MGLSymbolStyleLayer alloc] initWithLayerIdentifie
layer.iconOptional = [MGLRuntimeStylingHelper testBoolFunction];
layer.iconRotationAlignment = [MGLRuntimeStylingHelper testEnumFunction:MGLSymbolStyleLayerIconRotationAlignmentAuto type:@encode(MGLSymbolStyleLayerIconRotationAlignment)];
layer.iconSize = [MGLRuntimeStylingHelper testNumberFunction];
- layer.iconTextFit = [MGLRuntimeStylingHelper testEnumFunction:MGLSymbolStyleLayerIconTextFitHeight type:@encode(MGLSymbolStyleLayerIconTextFit)];
+ layer.iconTextFit = [MGLRuntimeStylingHelper testEnumFunction:MGLSymbolStyleLayerIconTextFitBoth type:@encode(MGLSymbolStyleLayerIconTextFit)];
layer.iconTextFitPadding = [MGLRuntimeStylingHelper testPaddingFunction];
layer.iconImage = [MGLRuntimeStylingHelper testStringFunction];
layer.iconRotate = [MGLRuntimeStylingHelper testNumberFunction];
@@ -172,7 +172,7 @@ MGLSymbolStyleLayer *layer = [[MGLSymbolStyleLayer alloc] initWithLayerIdentifie
XCTAssertEqualObjects(gLayer.iconOptional, [MGLRuntimeStylingHelper testBoolFunction]);
XCTAssertEqualObjects(gLayer.iconRotationAlignment, [MGLRuntimeStylingHelper testEnumFunction:MGLSymbolStyleLayerIconRotationAlignmentAuto type:@encode(MGLSymbolStyleLayerIconRotationAlignment)]);
XCTAssertEqualObjects(gLayer.iconSize, [MGLRuntimeStylingHelper testNumberFunction]);
- XCTAssertEqualObjects(gLayer.iconTextFit, [MGLRuntimeStylingHelper testEnumFunction:MGLSymbolStyleLayerIconTextFitHeight type:@encode(MGLSymbolStyleLayerIconTextFit)]);
+ XCTAssertEqualObjects(gLayer.iconTextFit, [MGLRuntimeStylingHelper testEnumFunction:MGLSymbolStyleLayerIconTextFitBoth type:@encode(MGLSymbolStyleLayerIconTextFit)]);
XCTAssertEqualObjects(gLayer.iconTextFitPadding, [MGLRuntimeStylingHelper testPaddingFunction]);
XCTAssertEqualObjects(gLayer.iconImage, [MGLRuntimeStylingHelper testStringFunction]);
XCTAssertEqualObjects(gLayer.iconRotate, [MGLRuntimeStylingHelper testNumberFunction]);
diff --git a/scripts/generate-style-code.js b/scripts/generate-style-code.js
index 4c5f148a00..77aecbe18c 100644
--- a/scripts/generate-style-code.js
+++ b/scripts/generate-style-code.js
@@ -102,7 +102,7 @@ const layerCpp = ejs.compile(fs.readFileSync('src/mbgl/style/layers/layer.cpp.ej
const propertiesHpp = ejs.compile(fs.readFileSync('src/mbgl/style/layers/layer_properties.hpp.ejs', 'utf8'), {strict: true});
const propertiesCpp = ejs.compile(fs.readFileSync('src/mbgl/style/layers/layer_properties.cpp.ejs', 'utf8'), {strict: true});
-const layers = spec.layer.type.values.map((type) => {
+const layers = Object.keys(spec.layer.type.values).map((type) => {
const layoutProperties = Object.keys(spec[`layout_${type}`]).reduce((memo, name) => {
if (name !== 'visibility') {
spec[`layout_${type}`][name].name = name;