summaryrefslogtreecommitdiff
path: root/platform/android
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 /platform/android
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.
Diffstat (limited to 'platform/android')
-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
13 files changed, 265 insertions, 77 deletions
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;