diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2015-10-15 11:38:58 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2015-10-20 13:54:19 -0700 |
commit | 597b2b48511b68c7a6494386b414da479c436bd7 (patch) | |
tree | 50f22e46fc691772ec7eea2db546e9110a8e610e /include/mbgl | |
parent | 8baa804a44927fe23b4fed3cb07eb6db9a78f2e8 (diff) | |
download | qtlocation-mapboxgl-597b2b48511b68c7a6494386b414da479c436bd7.tar.gz |
[core] Pull annotation typedefs to own header; add AnnotationID
Diffstat (limited to 'include/mbgl')
-rw-r--r-- | include/mbgl/annotation/annotation.hpp | 20 | ||||
-rw-r--r-- | include/mbgl/annotation/shape_annotation.hpp | 8 | ||||
-rw-r--r-- | include/mbgl/map/map.hpp | 17 |
3 files changed, 29 insertions, 16 deletions
diff --git a/include/mbgl/annotation/annotation.hpp b/include/mbgl/annotation/annotation.hpp new file mode 100644 index 0000000000..fd21cd5f6a --- /dev/null +++ b/include/mbgl/annotation/annotation.hpp @@ -0,0 +1,20 @@ +#ifndef MBGL_ANNOTATION +#define MBGL_ANNOTATION + +#include <cstdint> +#include <vector> + +namespace mbgl { + +enum class AnnotationType : uint8_t { + Any = 0, + Point = 1 << 0, + Shape = 1 << 1, +}; + +using AnnotationID = uint32_t; +using AnnotationIDs = std::vector<AnnotationID>; + +} + +#endif diff --git a/include/mbgl/annotation/shape_annotation.hpp b/include/mbgl/annotation/shape_annotation.hpp index a35b867266..dd8bf5e4d5 100644 --- a/include/mbgl/annotation/shape_annotation.hpp +++ b/include/mbgl/annotation/shape_annotation.hpp @@ -1,14 +1,16 @@ #ifndef MBGL_ANNOTATION_SHAPE_ANNOTATION #define MBGL_ANNOTATION_SHAPE_ANNOTATION -#include <mbgl/util/geo.hpp> -#include <mbgl/map/map.hpp> +#include <mbgl/annotation/annotation.hpp> #include <mbgl/style/style_properties.hpp> -#include <string> +#include <mbgl/util/geo.hpp> namespace mbgl { +using AnnotationSegment = std::vector<LatLng>; +using AnnotationSegments = std::vector<AnnotationSegment>; + class ShapeAnnotation { public: inline ShapeAnnotation(const AnnotationSegments& segments_, const StyleProperties& styleProperties_) diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index 69499c5110..8a381cda65 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -7,6 +7,7 @@ #include <mbgl/util/geo.hpp> #include <mbgl/util/noncopyable.hpp> #include <mbgl/util/vec.hpp> +#include <mbgl/annotation/annotation.hpp> #include <cstdint> #include <string> @@ -31,12 +32,6 @@ namespace util { template <class T> class Thread; } -enum class AnnotationType : uint8_t { - Any = 0, - Point = 1 << 0, - Shape = 1 << 1, -}; - struct EdgeInsets { double top = 0; double left = 0; @@ -44,10 +39,6 @@ struct EdgeInsets { double right = 0; }; -using AnnotationIDs = std::vector<uint32_t>; -using AnnotationSegment = std::vector<LatLng>; -using AnnotationSegments = std::vector<AnnotationSegment>; - class Map : private util::noncopyable { friend class View; @@ -147,13 +138,13 @@ public: void setDefaultPointAnnotationSymbol(const std::string&); double getTopOffsetPixelsForAnnotationSymbol(const std::string&); - uint32_t addPointAnnotation(const PointAnnotation&); + AnnotationID addPointAnnotation(const PointAnnotation&); AnnotationIDs addPointAnnotations(const std::vector<PointAnnotation>&); - uint32_t addShapeAnnotation(const ShapeAnnotation&); + AnnotationID addShapeAnnotation(const ShapeAnnotation&); AnnotationIDs addShapeAnnotations(const std::vector<ShapeAnnotation>&); - void removeAnnotation(uint32_t); + void removeAnnotation(AnnotationID); void removeAnnotations(const AnnotationIDs&); AnnotationIDs getAnnotationsInBounds(const LatLngBounds&, const AnnotationType& = AnnotationType::Any); |