diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-06-01 17:29:50 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-06-01 17:37:01 -0700 |
commit | 3689f52ef3f001450dd2480f5a985568efefe819 (patch) | |
tree | 90cd0af73308b7139bbfd643fd3f5bdda34a06a8 /include/mbgl/annotation | |
parent | 8068424f3040b97b23e2e09a9279ebc221284c2e (diff) | |
download | qtlocation-mapboxgl-3689f52ef3f001450dd2480f5a985568efefe819.tar.gz |
[core] Constrain annotation API to the supported geometry types
Diffstat (limited to 'include/mbgl/annotation')
-rw-r--r-- | include/mbgl/annotation/annotation.hpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/include/mbgl/annotation/annotation.hpp b/include/mbgl/annotation/annotation.hpp index 3b2b7f3ade..8b0c3026a8 100644 --- a/include/mbgl/annotation/annotation.hpp +++ b/include/mbgl/annotation/annotation.hpp @@ -16,13 +16,19 @@ using AnnotationIDs = std::vector<AnnotationID>; class SymbolAnnotation { public: - Geometry<double> geometry; + Point<double> geometry; std::string icon; }; +using ShapeAnnotationGeometry = variant< + LineString<double>, + Polygon<double>, + MultiLineString<double>, + MultiPolygon<double>>; + class LineAnnotation { public: - Geometry<double> geometry; + ShapeAnnotationGeometry geometry; float opacity = 1; float width = 1; Color color = {{ 0, 0, 0, 1 }}; @@ -30,7 +36,7 @@ public: class FillAnnotation { public: - Geometry<double> geometry; + ShapeAnnotationGeometry geometry; float opacity = 1; Color color = {{ 0, 0, 0, 1 }}; Color outlineColor = {{ 0, 0, 0, -1 }}; @@ -39,7 +45,7 @@ public: // An annotation whose type and properties are sourced from a style layer. class StyleSourcedAnnotation { public: - Geometry<double> geometry; + ShapeAnnotationGeometry geometry; std::string layerID; }; |