hide the LocationIndicatorLayer impl
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
#include "background_layer.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
#include "circle_layer.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
#include "fill_extrusion_layer.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
#include "fill_layer.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
#include "heatmap_layer.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
#include "hillshade_layer.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
const type = locals.type;
|
||||
const properties = locals.properties;
|
||||
-%>
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
#include "<%- type.replace('-', '_') %>_layer.hpp"
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
const type = locals.type;
|
||||
const properties = locals.properties;
|
||||
-%>
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
#pragma once
|
||||
|
||||
@@ -18,7 +18,11 @@ namespace android {
|
||||
class <%- camelize(type) %>Layer : public Layer {
|
||||
public:
|
||||
using SuperTag = Layer;
|
||||
<% if (type === 'location-indicator') { -%>
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/location/<%- camelize(type) %>Layer"; };
|
||||
<% } else { -%>
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/layers/<%- camelize(type) %>Layer"; };
|
||||
<% } -%>
|
||||
|
||||
<% if (type === 'background' || type === 'location-indicator') { -%>
|
||||
<%- camelize(type) %>Layer(jni::JNIEnv&, jni::String&);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
#include "line_layer.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
#include "location_indicator_layer.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
#pragma once
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace android {
|
||||
class LocationIndicatorLayer : public Layer {
|
||||
public:
|
||||
using SuperTag = Layer;
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/layers/LocationIndicatorLayer"; };
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/location/LocationIndicatorLayer"; };
|
||||
|
||||
LocationIndicatorLayer(jni::JNIEnv&, jni::String&);
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
#include "raster_layer.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
#include "symbol_layer.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@ import com.mapbox.mapboxsdk.geometry.LatLng;
|
||||
import com.mapbox.mapboxsdk.location.modes.RenderMode;
|
||||
import com.mapbox.mapboxsdk.maps.Style;
|
||||
import com.mapbox.mapboxsdk.style.expressions.Expression;
|
||||
import com.mapbox.mapboxsdk.style.layers.LocationIndicatorLayer;
|
||||
import com.mapbox.mapboxsdk.style.layers.PropertyFactory;
|
||||
import com.mapbox.mapboxsdk.utils.BitmapUtils;
|
||||
import com.mapbox.mapboxsdk.utils.ColorUtils;
|
||||
|
||||
@@ -23,7 +21,6 @@ import static com.mapbox.mapboxsdk.location.LocationComponentConstants.SHADOW_IC
|
||||
import static com.mapbox.mapboxsdk.style.expressions.Expression.rgba;
|
||||
import static com.mapbox.mapboxsdk.style.layers.Property.NONE;
|
||||
import static com.mapbox.mapboxsdk.style.layers.Property.VISIBLE;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.visibility;
|
||||
|
||||
class IndicatorLocationLayerRenderer implements LocationLayerRenderer {
|
||||
|
||||
@@ -84,8 +81,8 @@ class IndicatorLocationLayerRenderer implements LocationLayerRenderer {
|
||||
colorArray[3] = accuracyAlpha;
|
||||
Expression rgbaExpression = rgba(colorArray[0], colorArray[1], colorArray[2], colorArray[3]);
|
||||
layer.setProperties(
|
||||
PropertyFactory.accuracyRadiusColor(rgbaExpression),
|
||||
PropertyFactory.accuracyRadiusBorderColor(rgbaExpression)
|
||||
LocationPropertyFactory.accuracyRadiusColor(rgbaExpression),
|
||||
LocationPropertyFactory.accuracyRadiusBorderColor(rgbaExpression)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -107,16 +104,16 @@ class IndicatorLocationLayerRenderer implements LocationLayerRenderer {
|
||||
@Override
|
||||
public void setAccuracyRadius(Float accuracy) {
|
||||
layer.setProperties(
|
||||
PropertyFactory.accuracyRadius(accuracy)
|
||||
LocationPropertyFactory.accuracyRadius(accuracy)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void styleScaling(Expression scaleExpression) {
|
||||
layer.setProperties(
|
||||
PropertyFactory.shadowImageSize(scaleExpression),
|
||||
PropertyFactory.bearingImageSize(scaleExpression),
|
||||
PropertyFactory.topImageSize(scaleExpression)
|
||||
LocationPropertyFactory.shadowImageSize(scaleExpression),
|
||||
LocationPropertyFactory.bearingImageSize(scaleExpression),
|
||||
LocationPropertyFactory.topImageSize(scaleExpression)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -160,7 +157,7 @@ class IndicatorLocationLayerRenderer implements LocationLayerRenderer {
|
||||
}
|
||||
|
||||
private void setLayerVisibility(boolean visible) {
|
||||
layer.setProperties(visibility(visible ? VISIBLE : NONE));
|
||||
layer.setProperties(LocationPropertyFactory.visibility(visible ? VISIBLE : NONE));
|
||||
}
|
||||
|
||||
private void setLayerLocation(@Nullable LatLng latLng) {
|
||||
@@ -168,14 +165,14 @@ class IndicatorLocationLayerRenderer implements LocationLayerRenderer {
|
||||
if (latLng != null) {
|
||||
Double[] values = new Double[] {latLng.getLatitude(), latLng.getLongitude(), 0d};
|
||||
layer.setProperties(
|
||||
PropertyFactory.location(values)
|
||||
LocationPropertyFactory.location(values)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private void setLayerBearing(double bearing) {
|
||||
layer.setProperties(
|
||||
PropertyFactory.bearing(bearing)
|
||||
LocationPropertyFactory.bearing(bearing)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -203,9 +200,9 @@ class IndicatorLocationLayerRenderer implements LocationLayerRenderer {
|
||||
break;
|
||||
}
|
||||
layer.setProperties(
|
||||
PropertyFactory.topImage(topImage),
|
||||
PropertyFactory.bearingImage(bearingImage),
|
||||
PropertyFactory.shadowImage(shadowImage)
|
||||
LocationPropertyFactory.topImage(topImage),
|
||||
LocationPropertyFactory.bearingImage(bearingImage),
|
||||
LocationPropertyFactory.shadowImage(shadowImage)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,9 +5,7 @@ import androidx.annotation.NonNull;
|
||||
import com.mapbox.geojson.Feature;
|
||||
import com.mapbox.mapboxsdk.style.layers.CircleLayer;
|
||||
import com.mapbox.mapboxsdk.style.layers.Layer;
|
||||
import com.mapbox.mapboxsdk.style.layers.LocationIndicatorLayer;
|
||||
import com.mapbox.mapboxsdk.style.layers.Property;
|
||||
import com.mapbox.mapboxsdk.style.layers.PropertyFactory;
|
||||
import com.mapbox.mapboxsdk.style.layers.SymbolLayer;
|
||||
import com.mapbox.mapboxsdk.style.sources.GeoJsonOptions;
|
||||
import com.mapbox.mapboxsdk.style.sources.GeoJsonSource;
|
||||
@@ -122,8 +120,8 @@ class LayerSourceProvider {
|
||||
LocationIndicatorLayer generateLocationComponentLayer() {
|
||||
LocationIndicatorLayer layer = new LocationIndicatorLayer(FOREGROUND_LAYER);
|
||||
layer.setProperties(
|
||||
PropertyFactory.perspectiveCompensation(0.9f),
|
||||
PropertyFactory.imageTiltDisplacement(4f)
|
||||
LocationPropertyFactory.perspectiveCompensation(0.9f),
|
||||
LocationPropertyFactory.imageTiltDisplacement(4f)
|
||||
);
|
||||
return layer;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
package com.mapbox.mapboxsdk.style.layers;
|
||||
package com.mapbox.mapboxsdk.location;
|
||||
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.Keep;
|
||||
@@ -14,6 +14,8 @@ import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.mapbox.mapboxsdk.style.expressions.Expression;
|
||||
import com.mapbox.mapboxsdk.style.layers.TransitionOptions;
|
||||
import com.mapbox.mapboxsdk.style.layers.Layer;
|
||||
import com.mapbox.mapboxsdk.style.layers.PropertyValue;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -21,7 +23,7 @@ import com.mapbox.mapboxsdk.style.layers.TransitionOptions;
|
||||
* @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#layers-location-indicator">The online documentation</a>
|
||||
*/
|
||||
@UiThread
|
||||
public class LocationIndicatorLayer extends Layer {
|
||||
class LocationIndicatorLayer extends Layer {
|
||||
|
||||
/**
|
||||
* Creates a LocationIndicatorLayer.
|
||||
@@ -46,66 +48,6 @@ public class LocationIndicatorLayer extends Layer {
|
||||
@Keep
|
||||
protected native void initialize(String layerId);
|
||||
|
||||
/**
|
||||
* Get the source id.
|
||||
*
|
||||
* @return id of the source
|
||||
*/
|
||||
@NonNull
|
||||
public String getSourceId() {
|
||||
checkThread();
|
||||
return nativeGetSourceId();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the source layer.
|
||||
*
|
||||
* @return sourceLayer the source layer to get
|
||||
*/
|
||||
@NonNull
|
||||
public String getSourceLayer() {
|
||||
checkThread();
|
||||
return nativeGetSourceLayer();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a single expression filter.
|
||||
*
|
||||
* @param filter the expression filter to set
|
||||
*/
|
||||
public void setFilter(@NonNull Expression filter) {
|
||||
checkThread();
|
||||
nativeSetFilter(filter.toArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a single expression filter.
|
||||
*
|
||||
* @param filter the expression filter to set
|
||||
* @return This
|
||||
*/
|
||||
@NonNull
|
||||
public LocationIndicatorLayer withFilter(@NonNull Expression filter) {
|
||||
setFilter(filter);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a single expression filter.
|
||||
*
|
||||
* @return the expression filter to get
|
||||
*/
|
||||
@Nullable
|
||||
public Expression getFilter() {
|
||||
checkThread();
|
||||
JsonElement jsonElement = nativeGetFilter();
|
||||
if (jsonElement != null) {
|
||||
return Expression.Converter.convert(jsonElement);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a property or properties.
|
||||
*
|
||||
@@ -0,0 +1,312 @@
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
package com.mapbox.mapboxsdk.location;
|
||||
|
||||
import androidx.annotation.ColorInt;
|
||||
|
||||
import com.mapbox.mapboxsdk.style.expressions.Expression;
|
||||
import com.mapbox.mapboxsdk.style.types.Formatted;
|
||||
import static com.mapbox.mapboxsdk.utils.ColorUtils.colorToRgbaString;
|
||||
import com.mapbox.mapboxsdk.style.layers.LayoutPropertyValue;
|
||||
import com.mapbox.mapboxsdk.style.layers.PaintPropertyValue;
|
||||
import com.mapbox.mapboxsdk.style.layers.Property;
|
||||
import com.mapbox.mapboxsdk.style.layers.PropertyValue;
|
||||
|
||||
/**
|
||||
* Constructs paint/layout properties for Layers
|
||||
*
|
||||
* @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#layers">Layer style documentation</a>
|
||||
*/
|
||||
class LocationPropertyFactory {
|
||||
|
||||
/**
|
||||
* Set the property visibility.
|
||||
*
|
||||
* @param value the visibility value
|
||||
* @return property wrapper around visibility
|
||||
*/
|
||||
public static PropertyValue<String> visibility(@Property.VISIBILITY String value) {
|
||||
return new LayoutPropertyValue<>("visibility", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* The amount of the perspective compensation, between 0 and 1. A value of 1 produces a location indicator of constant width across the screen. A value of 0 makes it scale naturally according to the viewing projection.
|
||||
*
|
||||
* @param value a Float value
|
||||
* @return property wrapper around Float
|
||||
*/
|
||||
public static PropertyValue<Float> perspectiveCompensation(Float value) {
|
||||
return new PaintPropertyValue<>("perspective-compensation", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* The amount of the perspective compensation, between 0 and 1. A value of 1 produces a location indicator of constant width across the screen. A value of 0 makes it scale naturally according to the viewing projection.
|
||||
*
|
||||
* @param expression an expression statement
|
||||
* @return property wrapper around an expression statement
|
||||
*/
|
||||
public static PropertyValue<Expression> perspectiveCompensation(Expression expression) {
|
||||
return new PaintPropertyValue<>("perspective-compensation", expression);
|
||||
}
|
||||
|
||||
/**
|
||||
* The displacement off the center of the top image and the shadow image when the pitch of the map is greater than 0. This helps producing a three-dimensional appearence.
|
||||
*
|
||||
* @param value a Float value
|
||||
* @return property wrapper around Float
|
||||
*/
|
||||
public static PropertyValue<Float> imageTiltDisplacement(Float value) {
|
||||
return new PaintPropertyValue<>("image-tilt-displacement", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* The displacement off the center of the top image and the shadow image when the pitch of the map is greater than 0. This helps producing a three-dimensional appearence.
|
||||
*
|
||||
* @param expression an expression statement
|
||||
* @return property wrapper around an expression statement
|
||||
*/
|
||||
public static PropertyValue<Expression> imageTiltDisplacement(Expression expression) {
|
||||
return new PaintPropertyValue<>("image-tilt-displacement", expression);
|
||||
}
|
||||
|
||||
/**
|
||||
* The bearing of the location indicator.
|
||||
*
|
||||
* @param value a Double value
|
||||
* @return property wrapper around Double
|
||||
*/
|
||||
public static PropertyValue<Double> bearing(Double value) {
|
||||
return new PaintPropertyValue<>("bearing", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* The bearing of the location indicator.
|
||||
*
|
||||
* @param expression an expression statement
|
||||
* @return property wrapper around an expression statement
|
||||
*/
|
||||
public static PropertyValue<Expression> bearing(Expression expression) {
|
||||
return new PaintPropertyValue<>("bearing", expression);
|
||||
}
|
||||
|
||||
/**
|
||||
* An array of [latitude, longitude, altitude] position of the location indicator.
|
||||
*
|
||||
* @param value a Double[] value
|
||||
* @return property wrapper around Double[]
|
||||
*/
|
||||
public static PropertyValue<Double[]> location(Double[] value) {
|
||||
return new PaintPropertyValue<>("location", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* An array of [latitude, longitude, altitude] position of the location indicator.
|
||||
*
|
||||
* @param expression an expression statement
|
||||
* @return property wrapper around an expression statement
|
||||
*/
|
||||
public static PropertyValue<Expression> location(Expression expression) {
|
||||
return new PaintPropertyValue<>("location", expression);
|
||||
}
|
||||
|
||||
/**
|
||||
* The accuracy, in meters, of the position source used to retrieve the position of the location indicator.
|
||||
*
|
||||
* @param value a Float value
|
||||
* @return property wrapper around Float
|
||||
*/
|
||||
public static PropertyValue<Float> accuracyRadius(Float value) {
|
||||
return new PaintPropertyValue<>("accuracy-radius", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* The accuracy, in meters, of the position source used to retrieve the position of the location indicator.
|
||||
*
|
||||
* @param expression an expression statement
|
||||
* @return property wrapper around an expression statement
|
||||
*/
|
||||
public static PropertyValue<Expression> accuracyRadius(Expression expression) {
|
||||
return new PaintPropertyValue<>("accuracy-radius", expression);
|
||||
}
|
||||
|
||||
/**
|
||||
* The size of the top image, as a scale factor applied to the size of the specified image.
|
||||
*
|
||||
* @param value a Float value
|
||||
* @return property wrapper around Float
|
||||
*/
|
||||
public static PropertyValue<Float> topImageSize(Float value) {
|
||||
return new PaintPropertyValue<>("top-image-size", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* The size of the top image, as a scale factor applied to the size of the specified image.
|
||||
*
|
||||
* @param expression an expression statement
|
||||
* @return property wrapper around an expression statement
|
||||
*/
|
||||
public static PropertyValue<Expression> topImageSize(Expression expression) {
|
||||
return new PaintPropertyValue<>("top-image-size", expression);
|
||||
}
|
||||
|
||||
/**
|
||||
* The size of the bearing image, as a scale factor applied to the size of the specified image.
|
||||
*
|
||||
* @param value a Float value
|
||||
* @return property wrapper around Float
|
||||
*/
|
||||
public static PropertyValue<Float> bearingImageSize(Float value) {
|
||||
return new PaintPropertyValue<>("bearing-image-size", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* The size of the bearing image, as a scale factor applied to the size of the specified image.
|
||||
*
|
||||
* @param expression an expression statement
|
||||
* @return property wrapper around an expression statement
|
||||
*/
|
||||
public static PropertyValue<Expression> bearingImageSize(Expression expression) {
|
||||
return new PaintPropertyValue<>("bearing-image-size", expression);
|
||||
}
|
||||
|
||||
/**
|
||||
* The size of the shadow image, as a scale factor applied to the size of the specified image.
|
||||
*
|
||||
* @param value a Float value
|
||||
* @return property wrapper around Float
|
||||
*/
|
||||
public static PropertyValue<Float> shadowImageSize(Float value) {
|
||||
return new PaintPropertyValue<>("shadow-image-size", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* The size of the shadow image, as a scale factor applied to the size of the specified image.
|
||||
*
|
||||
* @param expression an expression statement
|
||||
* @return property wrapper around an expression statement
|
||||
*/
|
||||
public static PropertyValue<Expression> shadowImageSize(Expression expression) {
|
||||
return new PaintPropertyValue<>("shadow-image-size", expression);
|
||||
}
|
||||
|
||||
/**
|
||||
* The color for drawing the accuracy radius, as a circle. To adjust transparency, set the alpha component of the color accordingly.
|
||||
*
|
||||
* @param value a int color value
|
||||
* @return property wrapper around String color
|
||||
*/
|
||||
public static PropertyValue<String> accuracyRadiusColor(@ColorInt int value) {
|
||||
return new PaintPropertyValue<>("accuracy-radius-color", colorToRgbaString(value));
|
||||
}
|
||||
|
||||
/**
|
||||
* The color for drawing the accuracy radius, as a circle. To adjust transparency, set the alpha component of the color accordingly.
|
||||
*
|
||||
* @param value a String value
|
||||
* @return property wrapper around String
|
||||
*/
|
||||
public static PropertyValue<String> accuracyRadiusColor(String value) {
|
||||
return new PaintPropertyValue<>("accuracy-radius-color", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* The color for drawing the accuracy radius, as a circle. To adjust transparency, set the alpha component of the color accordingly.
|
||||
*
|
||||
* @param expression an expression statement
|
||||
* @return property wrapper around an expression statement
|
||||
*/
|
||||
public static PropertyValue<Expression> accuracyRadiusColor(Expression expression) {
|
||||
return new PaintPropertyValue<>("accuracy-radius-color", expression);
|
||||
}
|
||||
|
||||
/**
|
||||
* The color for drawing the accuracy radius border. To adjust transparency, set the alpha component of the color accordingly.
|
||||
*
|
||||
* @param value a int color value
|
||||
* @return property wrapper around String color
|
||||
*/
|
||||
public static PropertyValue<String> accuracyRadiusBorderColor(@ColorInt int value) {
|
||||
return new PaintPropertyValue<>("accuracy-radius-border-color", colorToRgbaString(value));
|
||||
}
|
||||
|
||||
/**
|
||||
* The color for drawing the accuracy radius border. To adjust transparency, set the alpha component of the color accordingly.
|
||||
*
|
||||
* @param value a String value
|
||||
* @return property wrapper around String
|
||||
*/
|
||||
public static PropertyValue<String> accuracyRadiusBorderColor(String value) {
|
||||
return new PaintPropertyValue<>("accuracy-radius-border-color", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* The color for drawing the accuracy radius border. To adjust transparency, set the alpha component of the color accordingly.
|
||||
*
|
||||
* @param expression an expression statement
|
||||
* @return property wrapper around an expression statement
|
||||
*/
|
||||
public static PropertyValue<Expression> accuracyRadiusBorderColor(Expression expression) {
|
||||
return new PaintPropertyValue<>("accuracy-radius-border-color", expression);
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of image in sprite to use as the top of the location indicator.
|
||||
*
|
||||
* @param value a String value
|
||||
* @return property wrapper around String
|
||||
*/
|
||||
public static PropertyValue<String> topImage(String value) {
|
||||
return new LayoutPropertyValue<>("top-image", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of image in sprite to use as the top of the location indicator.
|
||||
*
|
||||
* @param value a String value
|
||||
* @return property wrapper around String
|
||||
*/
|
||||
public static PropertyValue<Expression> topImage(Expression value) {
|
||||
return new LayoutPropertyValue<>("top-image", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of image in sprite to use as the middle of the location indicator.
|
||||
*
|
||||
* @param value a String value
|
||||
* @return property wrapper around String
|
||||
*/
|
||||
public static PropertyValue<String> bearingImage(String value) {
|
||||
return new LayoutPropertyValue<>("bearing-image", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of image in sprite to use as the middle of the location indicator.
|
||||
*
|
||||
* @param value a String value
|
||||
* @return property wrapper around String
|
||||
*/
|
||||
public static PropertyValue<Expression> bearingImage(Expression value) {
|
||||
return new LayoutPropertyValue<>("bearing-image", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of image in sprite to use as the background of the location indicator.
|
||||
*
|
||||
* @param value a String value
|
||||
* @return property wrapper around String
|
||||
*/
|
||||
public static PropertyValue<String> shadowImage(String value) {
|
||||
return new LayoutPropertyValue<>("shadow-image", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of image in sprite to use as the background of the location indicator.
|
||||
*
|
||||
* @param value a String value
|
||||
* @return property wrapper around String
|
||||
*/
|
||||
public static PropertyValue<Expression> shadowImage(Expression value) {
|
||||
return new LayoutPropertyValue<>("shadow-image", value);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
package com.mapbox.mapboxsdk.style.layers;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
package com.mapbox.mapboxsdk.style.layers;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
package com.mapbox.mapboxsdk.style.layers;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
package com.mapbox.mapboxsdk.style.layers;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
package com.mapbox.mapboxsdk.style.layers;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
package com.mapbox.mapboxsdk.style.layers;
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ package com.mapbox.mapboxsdk.style.layers;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
class LayoutPropertyValue<T> extends PropertyValue<T> {
|
||||
public class LayoutPropertyValue<T> extends PropertyValue<T> {
|
||||
|
||||
LayoutPropertyValue(@NonNull String name, T value) {
|
||||
public LayoutPropertyValue(@NonNull String name, T value) {
|
||||
super(name, value);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
package com.mapbox.mapboxsdk.style.layers;
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ package com.mapbox.mapboxsdk.style.layers;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
class PaintPropertyValue<T> extends PropertyValue<T> {
|
||||
public class PaintPropertyValue<T> extends PropertyValue<T> {
|
||||
|
||||
PaintPropertyValue(@NonNull String name, T value) {
|
||||
public PaintPropertyValue(@NonNull String name, T value) {
|
||||
super(name, value);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
package com.mapbox.mapboxsdk.style.layers;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
package com.mapbox.mapboxsdk.style.layers;
|
||||
|
||||
@@ -1645,226 +1645,6 @@ public class PropertyFactory {
|
||||
return new PaintPropertyValue<>("background-opacity", expression);
|
||||
}
|
||||
|
||||
/**
|
||||
* The amount of the perspective compensation, between 0 and 1. A value of 1 produces a location indicator of constant width across the screen. A value of 0 makes it scale naturally according to the viewing projection.
|
||||
*
|
||||
* @param value a Float value
|
||||
* @return property wrapper around Float
|
||||
*/
|
||||
public static PropertyValue<Float> perspectiveCompensation(Float value) {
|
||||
return new PaintPropertyValue<>("perspective-compensation", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* The amount of the perspective compensation, between 0 and 1. A value of 1 produces a location indicator of constant width across the screen. A value of 0 makes it scale naturally according to the viewing projection.
|
||||
*
|
||||
* @param expression an expression statement
|
||||
* @return property wrapper around an expression statement
|
||||
*/
|
||||
public static PropertyValue<Expression> perspectiveCompensation(Expression expression) {
|
||||
return new PaintPropertyValue<>("perspective-compensation", expression);
|
||||
}
|
||||
|
||||
/**
|
||||
* The displacement off the center of the top image and the shadow image when the pitch of the map is greater than 0. This helps producing a three-dimensional appearence.
|
||||
*
|
||||
* @param value a Float value
|
||||
* @return property wrapper around Float
|
||||
*/
|
||||
public static PropertyValue<Float> imageTiltDisplacement(Float value) {
|
||||
return new PaintPropertyValue<>("image-tilt-displacement", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* The displacement off the center of the top image and the shadow image when the pitch of the map is greater than 0. This helps producing a three-dimensional appearence.
|
||||
*
|
||||
* @param expression an expression statement
|
||||
* @return property wrapper around an expression statement
|
||||
*/
|
||||
public static PropertyValue<Expression> imageTiltDisplacement(Expression expression) {
|
||||
return new PaintPropertyValue<>("image-tilt-displacement", expression);
|
||||
}
|
||||
|
||||
/**
|
||||
* The bearing of the location indicator.
|
||||
*
|
||||
* @param value a Double value
|
||||
* @return property wrapper around Double
|
||||
*/
|
||||
public static PropertyValue<Double> bearing(Double value) {
|
||||
return new PaintPropertyValue<>("bearing", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* The bearing of the location indicator.
|
||||
*
|
||||
* @param expression an expression statement
|
||||
* @return property wrapper around an expression statement
|
||||
*/
|
||||
public static PropertyValue<Expression> bearing(Expression expression) {
|
||||
return new PaintPropertyValue<>("bearing", expression);
|
||||
}
|
||||
|
||||
/**
|
||||
* An array of [latitude, longitude, altitude] position of the location indicator.
|
||||
*
|
||||
* @param value a Double[] value
|
||||
* @return property wrapper around Double[]
|
||||
*/
|
||||
public static PropertyValue<Double[]> location(Double[] value) {
|
||||
return new PaintPropertyValue<>("location", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* An array of [latitude, longitude, altitude] position of the location indicator.
|
||||
*
|
||||
* @param expression an expression statement
|
||||
* @return property wrapper around an expression statement
|
||||
*/
|
||||
public static PropertyValue<Expression> location(Expression expression) {
|
||||
return new PaintPropertyValue<>("location", expression);
|
||||
}
|
||||
|
||||
/**
|
||||
* The accuracy, in meters, of the position source used to retrieve the position of the location indicator.
|
||||
*
|
||||
* @param value a Float value
|
||||
* @return property wrapper around Float
|
||||
*/
|
||||
public static PropertyValue<Float> accuracyRadius(Float value) {
|
||||
return new PaintPropertyValue<>("accuracy-radius", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* The accuracy, in meters, of the position source used to retrieve the position of the location indicator.
|
||||
*
|
||||
* @param expression an expression statement
|
||||
* @return property wrapper around an expression statement
|
||||
*/
|
||||
public static PropertyValue<Expression> accuracyRadius(Expression expression) {
|
||||
return new PaintPropertyValue<>("accuracy-radius", expression);
|
||||
}
|
||||
|
||||
/**
|
||||
* The size of the top image, as a scale factor applied to the size of the specified image.
|
||||
*
|
||||
* @param value a Float value
|
||||
* @return property wrapper around Float
|
||||
*/
|
||||
public static PropertyValue<Float> topImageSize(Float value) {
|
||||
return new PaintPropertyValue<>("top-image-size", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* The size of the top image, as a scale factor applied to the size of the specified image.
|
||||
*
|
||||
* @param expression an expression statement
|
||||
* @return property wrapper around an expression statement
|
||||
*/
|
||||
public static PropertyValue<Expression> topImageSize(Expression expression) {
|
||||
return new PaintPropertyValue<>("top-image-size", expression);
|
||||
}
|
||||
|
||||
/**
|
||||
* The size of the bearing image, as a scale factor applied to the size of the specified image.
|
||||
*
|
||||
* @param value a Float value
|
||||
* @return property wrapper around Float
|
||||
*/
|
||||
public static PropertyValue<Float> bearingImageSize(Float value) {
|
||||
return new PaintPropertyValue<>("bearing-image-size", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* The size of the bearing image, as a scale factor applied to the size of the specified image.
|
||||
*
|
||||
* @param expression an expression statement
|
||||
* @return property wrapper around an expression statement
|
||||
*/
|
||||
public static PropertyValue<Expression> bearingImageSize(Expression expression) {
|
||||
return new PaintPropertyValue<>("bearing-image-size", expression);
|
||||
}
|
||||
|
||||
/**
|
||||
* The size of the shadow image, as a scale factor applied to the size of the specified image.
|
||||
*
|
||||
* @param value a Float value
|
||||
* @return property wrapper around Float
|
||||
*/
|
||||
public static PropertyValue<Float> shadowImageSize(Float value) {
|
||||
return new PaintPropertyValue<>("shadow-image-size", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* The size of the shadow image, as a scale factor applied to the size of the specified image.
|
||||
*
|
||||
* @param expression an expression statement
|
||||
* @return property wrapper around an expression statement
|
||||
*/
|
||||
public static PropertyValue<Expression> shadowImageSize(Expression expression) {
|
||||
return new PaintPropertyValue<>("shadow-image-size", expression);
|
||||
}
|
||||
|
||||
/**
|
||||
* The color for drawing the accuracy radius, as a circle. To adjust transparency, set the alpha component of the color accordingly.
|
||||
*
|
||||
* @param value a int color value
|
||||
* @return property wrapper around String color
|
||||
*/
|
||||
public static PropertyValue<String> accuracyRadiusColor(@ColorInt int value) {
|
||||
return new PaintPropertyValue<>("accuracy-radius-color", colorToRgbaString(value));
|
||||
}
|
||||
|
||||
/**
|
||||
* The color for drawing the accuracy radius, as a circle. To adjust transparency, set the alpha component of the color accordingly.
|
||||
*
|
||||
* @param value a String value
|
||||
* @return property wrapper around String
|
||||
*/
|
||||
public static PropertyValue<String> accuracyRadiusColor(String value) {
|
||||
return new PaintPropertyValue<>("accuracy-radius-color", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* The color for drawing the accuracy radius, as a circle. To adjust transparency, set the alpha component of the color accordingly.
|
||||
*
|
||||
* @param expression an expression statement
|
||||
* @return property wrapper around an expression statement
|
||||
*/
|
||||
public static PropertyValue<Expression> accuracyRadiusColor(Expression expression) {
|
||||
return new PaintPropertyValue<>("accuracy-radius-color", expression);
|
||||
}
|
||||
|
||||
/**
|
||||
* The color for drawing the accuracy radius border. To adjust transparency, set the alpha component of the color accordingly.
|
||||
*
|
||||
* @param value a int color value
|
||||
* @return property wrapper around String color
|
||||
*/
|
||||
public static PropertyValue<String> accuracyRadiusBorderColor(@ColorInt int value) {
|
||||
return new PaintPropertyValue<>("accuracy-radius-border-color", colorToRgbaString(value));
|
||||
}
|
||||
|
||||
/**
|
||||
* The color for drawing the accuracy radius border. To adjust transparency, set the alpha component of the color accordingly.
|
||||
*
|
||||
* @param value a String value
|
||||
* @return property wrapper around String
|
||||
*/
|
||||
public static PropertyValue<String> accuracyRadiusBorderColor(String value) {
|
||||
return new PaintPropertyValue<>("accuracy-radius-border-color", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* The color for drawing the accuracy radius border. To adjust transparency, set the alpha component of the color accordingly.
|
||||
*
|
||||
* @param expression an expression statement
|
||||
* @return property wrapper around an expression statement
|
||||
*/
|
||||
public static PropertyValue<Expression> accuracyRadiusBorderColor(Expression expression) {
|
||||
return new PaintPropertyValue<>("accuracy-radius-border-color", expression);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.
|
||||
*
|
||||
@@ -2835,64 +2615,4 @@ public class PropertyFactory {
|
||||
return new LayoutPropertyValue<>("circle-sort-key", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of image in sprite to use as the top of the location indicator.
|
||||
*
|
||||
* @param value a String value
|
||||
* @return property wrapper around String
|
||||
*/
|
||||
public static PropertyValue<String> topImage(String value) {
|
||||
return new LayoutPropertyValue<>("top-image", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of image in sprite to use as the top of the location indicator.
|
||||
*
|
||||
* @param value a String value
|
||||
* @return property wrapper around String
|
||||
*/
|
||||
public static PropertyValue<Expression> topImage(Expression value) {
|
||||
return new LayoutPropertyValue<>("top-image", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of image in sprite to use as the middle of the location indicator.
|
||||
*
|
||||
* @param value a String value
|
||||
* @return property wrapper around String
|
||||
*/
|
||||
public static PropertyValue<String> bearingImage(String value) {
|
||||
return new LayoutPropertyValue<>("bearing-image", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of image in sprite to use as the middle of the location indicator.
|
||||
*
|
||||
* @param value a String value
|
||||
* @return property wrapper around String
|
||||
*/
|
||||
public static PropertyValue<Expression> bearingImage(Expression value) {
|
||||
return new LayoutPropertyValue<>("bearing-image", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of image in sprite to use as the background of the location indicator.
|
||||
*
|
||||
* @param value a String value
|
||||
* @return property wrapper around String
|
||||
*/
|
||||
public static PropertyValue<String> shadowImage(String value) {
|
||||
return new LayoutPropertyValue<>("shadow-image", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of image in sprite to use as the background of the location indicator.
|
||||
*
|
||||
* @param value a String value
|
||||
* @return property wrapper around String
|
||||
*/
|
||||
public static PropertyValue<Expression> shadowImage(Expression value) {
|
||||
return new LayoutPropertyValue<>("shadow-image", value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
package com.mapbox.mapboxsdk.style.layers;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
package com.mapbox.mapboxsdk.style.layers;
|
||||
|
||||
|
||||
@@ -3,9 +3,13 @@
|
||||
const properties = locals.properties;
|
||||
const doc = locals.doc;
|
||||
-%>
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
<% if (type === 'location-indicator') { -%>
|
||||
package com.mapbox.mapboxsdk.location;
|
||||
<% } else { -%>
|
||||
package com.mapbox.mapboxsdk.style.layers;
|
||||
<% } -%>
|
||||
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.Keep;
|
||||
@@ -23,6 +27,10 @@ import com.mapbox.mapboxsdk.style.layers.TransitionOptions;
|
||||
import com.mapbox.mapboxsdk.style.types.Formatted;
|
||||
import com.mapbox.mapboxsdk.style.types.FormattedSection;
|
||||
<% } -%>
|
||||
<% if (type === 'location-indicator') { -%>
|
||||
import com.mapbox.mapboxsdk.style.layers.Layer;
|
||||
import com.mapbox.mapboxsdk.style.layers.PropertyValue;
|
||||
<% } -%>
|
||||
|
||||
/**
|
||||
* <%- doc %>
|
||||
@@ -30,7 +38,11 @@ import com.mapbox.mapboxsdk.style.types.FormattedSection;
|
||||
* @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#layers-<%- type %>">The online documentation</a>
|
||||
*/
|
||||
@UiThread
|
||||
<% if (type === 'location-indicator') { -%>
|
||||
class <%- camelize(type) %>Layer extends Layer {
|
||||
<% } else { -%>
|
||||
public class <%- camelize(type) %>Layer extends Layer {
|
||||
<% } -%>
|
||||
|
||||
/**
|
||||
* Creates a <%- camelize(type) %>Layer.
|
||||
@@ -94,7 +106,7 @@ public class <%- camelize(type) %>Layer extends Layer {
|
||||
}
|
||||
|
||||
<% } -%>
|
||||
<% if (type !== 'background' && type !== 'custom') { -%>
|
||||
<% if (type !== 'background' && type !== 'location-indicator' && type !== 'custom') { -%>
|
||||
/**
|
||||
* Get the source id.
|
||||
*
|
||||
@@ -107,7 +119,7 @@ public class <%- camelize(type) %>Layer extends Layer {
|
||||
}
|
||||
|
||||
<% } -%>
|
||||
<% if (type !== 'background' && type !== 'raster' && type !== 'hillshade') { -%>
|
||||
<% if (type !== 'background' && type !== 'location-indicator' && type !== 'raster' && type !== 'hillshade') { -%>
|
||||
/**
|
||||
* Get the source layer.
|
||||
*
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<%
|
||||
const properties = locals.properties;
|
||||
-%>
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
package com.mapbox.mapboxsdk.style.layers;
|
||||
|
||||
|
||||
@@ -1,23 +1,38 @@
|
||||
<%
|
||||
const paintProperties = locals.paintProperties;
|
||||
const layoutProperties = locals.layoutProperties;
|
||||
const locationIndicator = locals.locationIndicator;
|
||||
-%>
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
<% if (locationIndicator) { -%>
|
||||
package com.mapbox.mapboxsdk.location;
|
||||
<% } else { -%>
|
||||
package com.mapbox.mapboxsdk.style.layers;
|
||||
<% } -%>
|
||||
|
||||
import androidx.annotation.ColorInt;
|
||||
|
||||
import com.mapbox.mapboxsdk.style.expressions.Expression;
|
||||
import com.mapbox.mapboxsdk.style.types.Formatted;
|
||||
import static com.mapbox.mapboxsdk.utils.ColorUtils.colorToRgbaString;
|
||||
<% if (locationIndicator) { -%>
|
||||
import com.mapbox.mapboxsdk.style.layers.LayoutPropertyValue;
|
||||
import com.mapbox.mapboxsdk.style.layers.PaintPropertyValue;
|
||||
import com.mapbox.mapboxsdk.style.layers.Property;
|
||||
import com.mapbox.mapboxsdk.style.layers.PropertyValue;
|
||||
<% } -%>
|
||||
|
||||
/**
|
||||
* Constructs paint/layout properties for Layers
|
||||
*
|
||||
* @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#layers">Layer style documentation</a>
|
||||
*/
|
||||
<% if (locationIndicator) { -%>
|
||||
class LocationPropertyFactory {
|
||||
<% } else { -%>
|
||||
public class PropertyFactory {
|
||||
<% } -%>
|
||||
|
||||
/**
|
||||
* Set the property visibility.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
package com.mapbox.mapboxsdk.style.light;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
const properties = locals.properties;
|
||||
const doc = locals.doc;
|
||||
-%>
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
package com.mapbox.mapboxsdk.style.light;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
package com.mapbox.mapboxsdk.location;
|
||||
|
||||
import android.graphics.Color;
|
||||
import androidx.test.annotation.UiThreadTest;
|
||||
@@ -11,7 +11,6 @@ import org.junit.Before;
|
||||
import timber.log.Timber;
|
||||
|
||||
import com.mapbox.mapboxsdk.style.expressions.Expression;
|
||||
import com.mapbox.mapboxsdk.style.layers.LocationIndicatorLayer;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -19,7 +18,7 @@ import org.junit.runner.RunWith;
|
||||
import static com.mapbox.mapboxsdk.style.expressions.Expression.*;
|
||||
import static org.junit.Assert.*;
|
||||
import static com.mapbox.mapboxsdk.style.layers.Property.*;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.*;
|
||||
import static com.mapbox.mapboxsdk.location.LocationPropertyFactory.*;
|
||||
|
||||
import com.mapbox.mapboxsdk.style.layers.TransitionOptions;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
|
||||
@@ -2,9 +2,13 @@
|
||||
const type = locals.type;
|
||||
const properties = locals.properties;
|
||||
-%>
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
<% if (type === 'location-indicator') { -%>
|
||||
package com.mapbox.mapboxsdk.location;
|
||||
<% } else { -%>
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
<% } -%>
|
||||
|
||||
import android.graphics.Color;
|
||||
import androidx.test.annotation.UiThreadTest;
|
||||
@@ -15,7 +19,9 @@ import org.junit.Before;
|
||||
import timber.log.Timber;
|
||||
|
||||
import com.mapbox.mapboxsdk.style.expressions.Expression;
|
||||
<% if (type !== 'location-indicator') { -%>
|
||||
import com.mapbox.mapboxsdk.style.layers.<%- camelize(type) %>Layer;
|
||||
<% } -%>
|
||||
<% if (type === 'symbol') { -%>
|
||||
import com.mapbox.mapboxsdk.style.types.Formatted;
|
||||
import com.mapbox.mapboxsdk.style.types.FormattedSection;
|
||||
@@ -27,7 +33,11 @@ import org.junit.runner.RunWith;
|
||||
import static com.mapbox.mapboxsdk.style.expressions.Expression.*;
|
||||
import static org.junit.Assert.*;
|
||||
import static com.mapbox.mapboxsdk.style.layers.Property.*;
|
||||
<% if (type === 'location-indicator') { -%>
|
||||
import static com.mapbox.mapboxsdk.location.LocationPropertyFactory.*;
|
||||
<% } else { -%>
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.*;
|
||||
<% } -%>
|
||||
|
||||
import com.mapbox.mapboxsdk.style.layers.TransitionOptions;
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ const lightProperties = Object.keys(spec[`light`]).reduce((memo, name) => {
|
||||
// Collect layer types from spec
|
||||
var layers = Object.keys(spec.layer.type.values).map((type) => {
|
||||
const layoutProperties = Object.keys(spec[`layout_${type}`]).reduce((memo, name) => {
|
||||
if (name !== 'visibility') {
|
||||
if (name !== 'visibility' && type !== 'location-indicator') {
|
||||
spec[`layout_${type}`][name].name = name;
|
||||
memo.push(spec[`layout_${type}`][name]);
|
||||
}
|
||||
@@ -34,8 +34,26 @@ var layers = Object.keys(spec.layer.type.values).map((type) => {
|
||||
}, []);
|
||||
|
||||
const paintProperties = Object.keys(spec[`paint_${type}`]).reduce((memo, name) => {
|
||||
spec[`paint_${type}`][name].name = name;
|
||||
memo.push(spec[`paint_${type}`][name]);
|
||||
if (type !== 'location-indicator') {
|
||||
spec[`paint_${type}`][name].name = name;
|
||||
memo.push(spec[`paint_${type}`][name]);
|
||||
}
|
||||
return memo;
|
||||
}, []);
|
||||
|
||||
const locationLayoutProperties = Object.keys(spec[`layout_${type}`]).reduce((memo, name) => {
|
||||
if (name !== 'visibility' && type === 'location-indicator') {
|
||||
spec[`layout_${type}`][name].name = name;
|
||||
memo.push(spec[`layout_${type}`][name]);
|
||||
}
|
||||
return memo;
|
||||
}, []);
|
||||
|
||||
const locationPaintProperties = Object.keys(spec[`paint_${type}`]).reduce((memo, name) => {
|
||||
if (type === 'location-indicator') {
|
||||
spec[`paint_${type}`][name].name = name;
|
||||
memo.push(spec[`paint_${type}`][name]);
|
||||
}
|
||||
return memo;
|
||||
}, []);
|
||||
|
||||
@@ -44,7 +62,9 @@ var layers = Object.keys(spec.layer.type.values).map((type) => {
|
||||
doc: spec.layer.type.values[type].doc,
|
||||
layoutProperties: layoutProperties,
|
||||
paintProperties: paintProperties,
|
||||
properties: layoutProperties.concat(paintProperties)
|
||||
locationLayoutProperties: locationLayoutProperties,
|
||||
locationPaintProperties: locationPaintProperties,
|
||||
properties: layoutProperties.concat(paintProperties).concat(locationLayoutProperties).concat(locationPaintProperties)
|
||||
};
|
||||
});
|
||||
|
||||
@@ -57,6 +77,8 @@ const uniqueArrayEnum = (prop, enums) => {
|
||||
|
||||
const layoutProperties = _(layers).map('layoutProperties').flatten().value();
|
||||
const paintProperties = _(layers).map('paintProperties').flatten().value();
|
||||
const locationLayoutProperties = _(layers).map('locationLayoutProperties').flatten().value();
|
||||
const locationPaintProperties = _(layers).map('locationPaintProperties').flatten().value();
|
||||
const allProperties = _(layoutProperties).union(paintProperties).union(lightProperties).value();
|
||||
let allEnumProperties = _(allProperties).filter({'type': 'enum'}).value();
|
||||
const uniqueArrayEnumProperties = _(allProperties).filter({'type': 'array'}).filter(prop => uniqueArrayEnum(prop, allEnumProperties)).value();
|
||||
@@ -391,8 +413,15 @@ const layerJava = ejs.compile(fs.readFileSync('MapboxGLAndroidSDK/src/main/java/
|
||||
const layerJavaUnitTests = ejs.compile(fs.readFileSync('MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/layer.junit.ejs', 'utf8'), {strict: true});
|
||||
|
||||
for (const layer of layers) {
|
||||
writeIfModified(`MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/${camelize(layer.type)}Layer.java`, layerJava(layer));
|
||||
writeIfModified(`MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/${camelize(layer.type)}LayerTest.java`, layerJavaUnitTests(layer));
|
||||
var srcDir = 'MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/'
|
||||
var testDir = 'MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/'
|
||||
if (layer.type === 'location-indicator') {
|
||||
srcDir = 'MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/'
|
||||
testDir = 'MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/'
|
||||
}
|
||||
|
||||
writeIfModified(srcDir + `${camelize(layer.type)}Layer.java`, layerJava(layer));
|
||||
writeIfModified(testDir + `${camelize(layer.type)}LayerTest.java`, layerJavaUnitTests(layer));
|
||||
}
|
||||
|
||||
// Jni
|
||||
@@ -407,10 +436,18 @@ for (const layer of layers) {
|
||||
}
|
||||
|
||||
// Java PropertyFactory
|
||||
const propertiesTemplate = ejs.compile(fs.readFileSync('MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs', 'utf8'), {strict: true});
|
||||
const propertyFactoryTemplate = ejs.compile(fs.readFileSync('MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs', 'utf8'), {strict: true});
|
||||
|
||||
var propertyFactorySrcDir = 'MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java'
|
||||
writeIfModified(
|
||||
`MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java`,
|
||||
propertiesTemplate({layoutProperties: layoutProperties, paintProperties: paintProperties})
|
||||
propertyFactorySrcDir,
|
||||
propertyFactoryTemplate({layoutProperties: layoutProperties, paintProperties: paintProperties, locationIndicator: false})
|
||||
);
|
||||
|
||||
var locationPropertyFactorySrcDir = 'MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationPropertyFactory.java'
|
||||
writeIfModified(
|
||||
locationPropertyFactorySrcDir,
|
||||
propertyFactoryTemplate({layoutProperties: locationLayoutProperties, paintProperties: locationPaintProperties, locationIndicator: true})
|
||||
);
|
||||
|
||||
// Java Property
|
||||
|
||||
Reference in New Issue
Block a user