summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/annotation/annotation.hpp34
-rw-r--r--include/mbgl/map/query.hpp16
-rw-r--r--include/mbgl/style/transition_options.hpp5
-rw-r--r--include/mbgl/util/tileset.hpp11
4 files changed, 57 insertions, 9 deletions
diff --git a/include/mbgl/annotation/annotation.hpp b/include/mbgl/annotation/annotation.hpp
index 96e06ca222..f64fde8807 100644
--- a/include/mbgl/annotation/annotation.hpp
+++ b/include/mbgl/annotation/annotation.hpp
@@ -17,6 +17,10 @@ using AnnotationIDs = std::vector<AnnotationID>;
class SymbolAnnotation {
public:
+ SymbolAnnotation(Point<double> geometry_, std::string icon_)
+ : geometry(std::move(geometry_)),
+ icon(std::move(icon_)) {}
+
Point<double> geometry;
std::string icon;
};
@@ -29,18 +33,36 @@ using ShapeAnnotationGeometry = variant<
class LineAnnotation {
public:
+ LineAnnotation(ShapeAnnotationGeometry geometry_,
+ style::DataDrivenPropertyValue<float> opacity_ = 1.0f,
+ style::DataDrivenPropertyValue<float> width_ = 1.0f,
+ style::DataDrivenPropertyValue<Color> color_ = Color::black())
+ : geometry(std::move(geometry_)),
+ opacity(std::move(opacity_)),
+ width(std::move(width_)),
+ color(std::move(color_)) {}
+
ShapeAnnotationGeometry geometry;
- style::DataDrivenPropertyValue<float> opacity { 1.0f };
- style::DataDrivenPropertyValue<float> width { 1.0f };
- style::DataDrivenPropertyValue<Color> color { Color::black() };
+ style::DataDrivenPropertyValue<float> opacity;
+ style::DataDrivenPropertyValue<float> width;
+ style::DataDrivenPropertyValue<Color> color;
};
class FillAnnotation {
public:
+ FillAnnotation(ShapeAnnotationGeometry geometry_,
+ style::DataDrivenPropertyValue<float> opacity_ = 1.0f,
+ style::DataDrivenPropertyValue<Color> color_ = Color::black(),
+ style::DataDrivenPropertyValue<Color> outlineColor_ = Color::black())
+ : geometry(std::move(geometry_)),
+ opacity(std::move(opacity_)),
+ color(std::move(color_)),
+ outlineColor(std::move(outlineColor_)) {}
+
ShapeAnnotationGeometry geometry;
- style::DataDrivenPropertyValue<float> opacity { 1.0f };
- style::DataDrivenPropertyValue<Color> color { Color::black() };
- style::DataDrivenPropertyValue<Color> outlineColor {};
+ style::DataDrivenPropertyValue<float> opacity;
+ style::DataDrivenPropertyValue<Color> color;
+ style::DataDrivenPropertyValue<Color> outlineColor;
};
using Annotation = variant<
diff --git a/include/mbgl/map/query.hpp b/include/mbgl/map/query.hpp
index e114fa2ebd..31f864e6fb 100644
--- a/include/mbgl/map/query.hpp
+++ b/include/mbgl/map/query.hpp
@@ -8,13 +8,20 @@
namespace mbgl {
+using StringVector = std::vector<std::string>;
+
/**
* Options for query rendered features.
*/
class RenderedQueryOptions {
public:
+ RenderedQueryOptions(optional<StringVector> layerIDs_ = optional<StringVector>(),
+ optional<style::Filter> filter_ = optional<style::Filter>())
+ : layerIDs(std::move(layerIDs_)),
+ filter(std::move(filter_)) {}
+
/** layerIDs to include in the query */
- optional<std::vector<std::string>> layerIDs;
+ optional<StringVector> layerIDs;
optional<style::Filter> filter;
};
@@ -24,8 +31,13 @@ public:
*/
class SourceQueryOptions {
public:
+ SourceQueryOptions(optional<StringVector> sourceLayers_ = optional<StringVector>(),
+ optional<style::Filter> filter_ = optional<style::Filter>())
+ : sourceLayers(std::move(sourceLayers_)),
+ filter(std::move(filter_)) {}
+
// Required for VectorSource, ignored for GeoJSONSource
- optional<std::vector<std::string>> sourceLayers;
+ optional<StringVector> sourceLayers;
optional<style::Filter> filter;
};
diff --git a/include/mbgl/style/transition_options.hpp b/include/mbgl/style/transition_options.hpp
index 1583667025..6dad17aeb4 100644
--- a/include/mbgl/style/transition_options.hpp
+++ b/include/mbgl/style/transition_options.hpp
@@ -11,6 +11,11 @@ public:
optional<Duration> duration = {};
optional<Duration> delay = {};
+ TransitionOptions(optional<Duration> duration_ = optional<Duration>(),
+ optional<Duration> delay_ = optional<Duration>())
+ : duration(std::move(duration_)),
+ delay(std::move(delay_)) {}
+
TransitionOptions reverseMerge(const TransitionOptions& defaults) const {
return {
duration ? duration : defaults.duration,
diff --git a/include/mbgl/util/tileset.hpp b/include/mbgl/util/tileset.hpp
index 1256e9fe96..664e7d1f36 100644
--- a/include/mbgl/util/tileset.hpp
+++ b/include/mbgl/util/tileset.hpp
@@ -13,10 +13,19 @@ public:
enum class Scheme : bool { XYZ, TMS };
std::vector<std::string> tiles;
- Range<uint8_t> zoomRange { 0, 22 };
+ Range<uint8_t> zoomRange;
std::string attribution;
Scheme scheme = Scheme::XYZ;
+ Tileset(std::vector<std::string> tiles_ = std::vector<std::string>(),
+ Range<uint8_t> zoomRange_ = { 0, 22 },
+ std::string attribution_ = {},
+ Scheme scheme_ = Scheme::XYZ)
+ : tiles(std::move(tiles_)),
+ zoomRange(std::move(zoomRange_)),
+ attribution(std::move(attribution_)),
+ scheme(scheme_) {}
+
// TileJSON also includes center, zoom, and bounds, but they are not used by mbgl.
friend bool operator==(const Tileset& lhs, const Tileset& rhs) {