From 3689f52ef3f001450dd2480f5a985568efefe819 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 1 Jun 2016 17:29:50 -0700 Subject: [core] Constrain annotation API to the supported geometry types --- include/mbgl/annotation/annotation.hpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'include/mbgl/annotation') 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; class SymbolAnnotation { public: - Geometry geometry; + Point geometry; std::string icon; }; +using ShapeAnnotationGeometry = variant< + LineString, + Polygon, + MultiLineString, + MultiPolygon>; + class LineAnnotation { public: - Geometry geometry; + ShapeAnnotationGeometry geometry; float opacity = 1; float width = 1; Color color = {{ 0, 0, 0, 1 }}; @@ -30,7 +36,7 @@ public: class FillAnnotation { public: - Geometry 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 geometry; + ShapeAnnotationGeometry geometry; std::string layerID; }; -- cgit v1.2.1