summaryrefslogtreecommitdiff
path: root/src/mbgl/style/layers/symbol_layer_properties.hpp
diff options
context:
space:
mode:
authorAlexander Shalamov <alexander.shalamov@mapbox.com>2019-10-30 10:21:17 +0200
committerAlexander Shalamov <alexander.shalamov@mapbox.com>2019-11-11 18:20:01 +0200
commitc6f3cc8b60e0cff032020a780d4fd3de1cb2a112 (patch)
tree155fe444f21ae88dda664e81cfc8378e28297b0e /src/mbgl/style/layers/symbol_layer_properties.hpp
parente1556fc539607db626b978040895716c1564c9b9 (diff)
downloadqtlocation-mapboxgl-c6f3cc8b60e0cff032020a780d4fd3de1cb2a112.tar.gz
[core] Implement image expression (#15877)
* [core] Bump gl-js version * [core] Implement image expression * [core] Use new image expression * [core] Coerce image expression to / from string * [core] Serialize evaluated image * [core] Pass available images to layout * [core] Pass images to evaluation context * [core] Set available flag value based on image availability * [core] Allow image coercion to boolean to indicate image availability * [core] Coalesce image expression * [core] Add image expression to next build system * [core] Align serialization format and evaluated type with gl-js * [core] Add images to expression evaluation method * [core] Add support for Image expression to expression test runner * [core] Unskip image expression tests * [core] Update unit tests * [core] Use image expression in annotation manager * [core] Add string to ImageExpression conversion * [core] Add image expression to expression dsl * [core] Convert tokens for implicitly created Image literal * [core] Fix clang format * [core] Split generated style code lines that are over 120 characters * [core] Add unit test for image expression equality * [core] Add image property expression evaluation unit test * [core] Unskip image expression render test * [core] Skip 'in' expression tests * [core] Ignore fill-pattern/update-feature-state render test * [core] Rename Image::serialize to Image::toValue
Diffstat (limited to 'src/mbgl/style/layers/symbol_layer_properties.hpp')
-rw-r--r--src/mbgl/style/layers/symbol_layer_properties.hpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/mbgl/style/layers/symbol_layer_properties.hpp b/src/mbgl/style/layers/symbol_layer_properties.hpp
index e44e7e404f..6552589971 100644
--- a/src/mbgl/style/layers/symbol_layer_properties.hpp
+++ b/src/mbgl/style/layers/symbol_layer_properties.hpp
@@ -31,9 +31,9 @@ struct IconIgnorePlacement : LayoutProperty<bool> {
static bool defaultValue() { return false; }
};
-struct IconImage : DataDrivenLayoutProperty<std::string> {
+struct IconImage : DataDrivenLayoutProperty<expression::Image> {
static constexpr const char *name() { return "icon-image"; }
- static std::string defaultValue() { return ""; }
+ static expression::Image defaultValue() { return {}; }
};
struct IconKeepUpright : LayoutProperty<bool> {
@@ -43,7 +43,7 @@ struct IconKeepUpright : LayoutProperty<bool> {
struct IconOffset : DataDrivenLayoutProperty<std::array<float, 2>> {
static constexpr const char *name() { return "icon-offset"; }
- static std::array<float, 2> defaultValue() { return {{ 0, 0 }}; }
+ static std::array<float, 2> defaultValue() { return {{0, 0}}; }
};
struct IconOptional : LayoutProperty<bool> {
@@ -83,7 +83,7 @@ struct IconTextFit : LayoutProperty<IconTextFitType> {
struct IconTextFitPadding : LayoutProperty<std::array<float, 4>> {
static constexpr const char *name() { return "icon-text-fit-padding"; }
- static std::array<float, 4> defaultValue() { return {{ 0, 0, 0, 0 }}; }
+ static std::array<float, 4> defaultValue() { return {{0, 0, 0, 0}}; }
};
struct SymbolAvoidEdges : LayoutProperty<bool> {
@@ -123,12 +123,12 @@ struct TextAnchor : DataDrivenLayoutProperty<SymbolAnchorType> {
struct TextField : DataDrivenLayoutProperty<expression::Formatted> {
static constexpr const char *name() { return "text-field"; }
- static expression::Formatted defaultValue() { return ""; }
+ static expression::Formatted defaultValue() { return {}; }
};
struct TextFont : DataDrivenLayoutProperty<std::vector<std::string>> {
static constexpr const char *name() { return "text-font"; }
- static std::vector<std::string> defaultValue() { return { "Open Sans Regular", "Arial Unicode MS Regular" }; }
+ static std::vector<std::string> defaultValue() { return {{"Open Sans Regular"}, {"Arial Unicode MS Regular"}}; }
};
struct TextIgnorePlacement : LayoutProperty<bool> {
@@ -168,7 +168,7 @@ struct TextMaxWidth : DataDrivenLayoutProperty<float> {
struct TextOffset : DataDrivenLayoutProperty<std::array<float, 2>> {
static constexpr const char *name() { return "text-offset"; }
- static std::array<float, 2> defaultValue() { return {{ 0, 0 }}; }
+ static std::array<float, 2> defaultValue() { return {{0, 0}}; }
};
struct TextOptional : LayoutProperty<bool> {
@@ -213,12 +213,12 @@ struct TextTransform : DataDrivenLayoutProperty<TextTransformType> {
struct TextVariableAnchor : LayoutProperty<std::vector<TextVariableAnchorType>> {
static constexpr const char *name() { return "text-variable-anchor"; }
- static std::vector<TextVariableAnchorType> defaultValue() { return { }; }
+ static std::vector<TextVariableAnchorType> defaultValue() { return {}; }
};
struct TextWritingMode : LayoutProperty<std::vector<TextWritingModeType>> {
static constexpr const char *name() { return "text-writing-mode"; }
- static std::vector<TextWritingModeType> defaultValue() { return { }; }
+ static std::vector<TextWritingModeType> defaultValue() { return {}; }
};
struct IconColor : DataDrivenPaintProperty<Color, attributes::fill_color, uniforms::fill_color> {
@@ -242,7 +242,7 @@ struct IconOpacity : DataDrivenPaintProperty<float, attributes::opacity, uniform
};
struct IconTranslate : PaintProperty<std::array<float, 2>> {
- static std::array<float, 2> defaultValue() { return {{ 0, 0 }}; }
+ static std::array<float, 2> defaultValue() { return {{0, 0}}; }
};
struct IconTranslateAnchor : PaintProperty<TranslateAnchorType> {
@@ -273,7 +273,7 @@ struct TextOpacity : DataDrivenPaintProperty<float, attributes::opacity, uniform
};
struct TextTranslate : PaintProperty<std::array<float, 2>> {
- static std::array<float, 2> defaultValue() { return {{ 0, 0 }}; }
+ static std::array<float, 2> defaultValue() { return {{0, 0}}; }
};
struct TextTranslateAnchor : PaintProperty<TranslateAnchorType> {