summaryrefslogtreecommitdiff
path: root/include/mbgl
diff options
context:
space:
mode:
authorGali Nelle <galinelle.mapbox@gmail.com>2020-03-25 17:35:44 +0200
committergalinelle <paolo.angelelli@mapbox.com>2020-04-08 14:00:26 +0300
commit9a55c282fecfdd76b1acdf64cef0ce2ed99472ef (patch)
treed2c412ef6ac4782d28cea66b761deeb5fff10cc3 /include/mbgl
parent7f53cec17b047a1804952a8da543dc10321e1dae (diff)
downloadqtlocation-mapboxgl-9a55c282fecfdd76b1acdf64cef0ce2ed99472ef.tar.gz
Add LocationIndicatorLayer
New key is "G" in mbgl-glfw, cycling between no puck, centered in the viewport and positioned in Tokyo.
Diffstat (limited to 'include/mbgl')
-rw-r--r--include/mbgl/layermanager/location_indicator_layer_factory.hpp15
-rw-r--r--include/mbgl/style/conversion/constant.hpp5
-rw-r--r--include/mbgl/style/conversion/property_value.hpp4
-rw-r--r--include/mbgl/style/layers/layer.hpp.ejs2
-rw-r--r--include/mbgl/style/layers/location_indicator_layer.hpp115
5 files changed, 140 insertions, 1 deletions
diff --git a/include/mbgl/layermanager/location_indicator_layer_factory.hpp b/include/mbgl/layermanager/location_indicator_layer_factory.hpp
new file mode 100644
index 0000000000..8d8e3b9a40
--- /dev/null
+++ b/include/mbgl/layermanager/location_indicator_layer_factory.hpp
@@ -0,0 +1,15 @@
+#pragma once
+
+#include <mbgl/layermanager/layer_factory.hpp>
+
+namespace mbgl {
+
+class LocationIndicatorLayerFactory : public LayerFactory {
+protected:
+ const style::LayerTypeInfo* getTypeInfo() const noexcept final;
+ std::unique_ptr<style::Layer> createLayer(const std::string& id,
+ const style::conversion::Convertible& value) noexcept final;
+ std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final;
+};
+
+} // namespace mbgl
diff --git a/include/mbgl/style/conversion/constant.hpp b/include/mbgl/style/conversion/constant.hpp
index 3a5833be64..4acddfb012 100644
--- a/include/mbgl/style/conversion/constant.hpp
+++ b/include/mbgl/style/conversion/constant.hpp
@@ -54,6 +54,11 @@ struct Converter<std::vector<float>> {
optional<std::vector<float>> operator()(const Convertible& value, Error& error) const;
};
+template <size_t N>
+struct Converter<std::array<double, N>> {
+ optional<std::array<double, N>> operator()(const Convertible& value, Error& error) const;
+};
+
template <>
struct Converter<std::vector<std::string>> {
optional<std::vector<std::string>> operator()(const Convertible& value, Error& error) const;
diff --git a/include/mbgl/style/conversion/property_value.hpp b/include/mbgl/style/conversion/property_value.hpp
index 61360b7440..925f97af18 100644
--- a/include/mbgl/style/conversion/property_value.hpp
+++ b/include/mbgl/style/conversion/property_value.hpp
@@ -47,6 +47,10 @@ struct Converter<PropertyValue<T>> {
}
};
+template <>
+struct Converter<PropertyValue<std::array<double, 3>>, void> {
+ optional<PropertyValue<std::array<double, 3>>> operator()(const Convertible& value, Error& error, bool, bool) const;
+};
} // namespace conversion
} // namespace style
} // namespace mbgl
diff --git a/include/mbgl/style/layers/layer.hpp.ejs b/include/mbgl/style/layers/layer.hpp.ejs
index 9cdd74737a..a083829f60 100644
--- a/include/mbgl/style/layers/layer.hpp.ejs
+++ b/include/mbgl/style/layers/layer.hpp.ejs
@@ -29,7 +29,7 @@ class TransitionOptions;
class <%- camelize(type) %>Layer : public Layer {
public:
-<% if (type === 'background') { -%>
+<% if ((type === 'background') || (type === 'location-indicator')) { -%>
<%- camelize(type) %>Layer(const std::string& layerID);
<% } else { -%>
<%- camelize(type) %>Layer(const std::string& layerID, const std::string& sourceID);
diff --git a/include/mbgl/style/layers/location_indicator_layer.hpp b/include/mbgl/style/layers/location_indicator_layer.hpp
new file mode 100644
index 0000000000..e9e67c1a20
--- /dev/null
+++ b/include/mbgl/style/layers/location_indicator_layer.hpp
@@ -0,0 +1,115 @@
+// clang-format off
+
+// This file is generated. Do not edit.
+
+#pragma once
+
+#include <mbgl/style/layer.hpp>
+#include <mbgl/style/filter.hpp>
+#include <mbgl/style/property_value.hpp>
+#include <mbgl/style/expression/formatted.hpp>
+#include <mbgl/util/color.hpp>
+
+namespace mbgl {
+namespace style {
+
+class TransitionOptions;
+
+class LocationIndicatorLayer : public Layer {
+public:
+ LocationIndicatorLayer(const std::string& layerID);
+ ~LocationIndicatorLayer() final;
+
+ // Layout properties
+
+ static PropertyValue<float> getDefaultBearing();
+ const PropertyValue<float>& getBearing() const;
+ void setBearing(const PropertyValue<float>&);
+
+ static PropertyValue<expression::Image> getDefaultBearingImage();
+ const PropertyValue<expression::Image>& getBearingImage() const;
+ void setBearingImage(const PropertyValue<expression::Image>&);
+
+ static PropertyValue<float> getDefaultImageTiltDisplacement();
+ const PropertyValue<float>& getImageTiltDisplacement() const;
+ void setImageTiltDisplacement(const PropertyValue<float>&);
+
+ static PropertyValue<float> getDefaultPerspectiveCompensation();
+ const PropertyValue<float>& getPerspectiveCompensation() const;
+ void setPerspectiveCompensation(const PropertyValue<float>&);
+
+ static PropertyValue<expression::Image> getDefaultShadowImage();
+ const PropertyValue<expression::Image>& getShadowImage() const;
+ void setShadowImage(const PropertyValue<expression::Image>&);
+
+ static PropertyValue<expression::Image> getDefaultTopImage();
+ const PropertyValue<expression::Image>& getTopImage() const;
+ void setTopImage(const PropertyValue<expression::Image>&);
+
+ // Paint properties
+
+ static PropertyValue<float> getDefaultAccuracyRadius();
+ const PropertyValue<float>& getAccuracyRadius() const;
+ void setAccuracyRadius(const PropertyValue<float>&);
+ void setAccuracyRadiusTransition(const TransitionOptions&);
+ TransitionOptions getAccuracyRadiusTransition() const;
+
+ static PropertyValue<Color> getDefaultAccuracyRadiusBorderColor();
+ const PropertyValue<Color>& getAccuracyRadiusBorderColor() const;
+ void setAccuracyRadiusBorderColor(const PropertyValue<Color>&);
+ void setAccuracyRadiusBorderColorTransition(const TransitionOptions&);
+ TransitionOptions getAccuracyRadiusBorderColorTransition() const;
+
+ static PropertyValue<Color> getDefaultAccuracyRadiusColor();
+ const PropertyValue<Color>& getAccuracyRadiusColor() const;
+ void setAccuracyRadiusColor(const PropertyValue<Color>&);
+ void setAccuracyRadiusColorTransition(const TransitionOptions&);
+ TransitionOptions getAccuracyRadiusColorTransition() const;
+
+ static PropertyValue<float> getDefaultBearingImageSize();
+ const PropertyValue<float>& getBearingImageSize() const;
+ void setBearingImageSize(const PropertyValue<float>&);
+ void setBearingImageSizeTransition(const TransitionOptions&);
+ TransitionOptions getBearingImageSizeTransition() const;
+
+ static PropertyValue<std::array<double, 3>> getDefaultLocation();
+ const PropertyValue<std::array<double, 3>>& getLocation() const;
+ void setLocation(const PropertyValue<std::array<double, 3>>&);
+ void setLocationTransition(const TransitionOptions&);
+ TransitionOptions getLocationTransition() const;
+
+ static PropertyValue<float> getDefaultShadowImageSize();
+ const PropertyValue<float>& getShadowImageSize() const;
+ void setShadowImageSize(const PropertyValue<float>&);
+ void setShadowImageSizeTransition(const TransitionOptions&);
+ TransitionOptions getShadowImageSizeTransition() const;
+
+ static PropertyValue<float> getDefaultTopImageSize();
+ const PropertyValue<float>& getTopImageSize() const;
+ void setTopImageSize(const PropertyValue<float>&);
+ void setTopImageSizeTransition(const TransitionOptions&);
+ TransitionOptions getTopImageSizeTransition() const;
+
+ // Private implementation
+
+ class Impl;
+ const Impl& impl() const;
+
+ Mutable<Impl> mutableImpl() const;
+ LocationIndicatorLayer(Immutable<Impl>);
+ std::unique_ptr<Layer> cloneRef(const std::string& id) const final;
+
+protected:
+ // Dynamic properties
+ optional<conversion::Error> setPropertyInternal(const std::string& name, const conversion::Convertible& value) final;
+
+ StyleProperty getProperty(const std::string& name) const final;
+ Value serialize() const final;
+
+ Mutable<Layer::Impl> mutableBaseImpl() const final;
+};
+
+} // namespace style
+} // namespace mbgl
+
+// clang-format on