From 42c06e70392941a9c07b842f019c4b060f716ff7 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 26 Jun 2015 18:49:06 -0700 Subject: Use array of structs rather than parallel arrays for annotations --- include/mbgl/annotation/point_annotation.hpp | 22 ++++++++++++++++++++++ include/mbgl/annotation/shape_annotation.hpp | 24 ++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 include/mbgl/annotation/point_annotation.hpp create mode 100644 include/mbgl/annotation/shape_annotation.hpp (limited to 'include/mbgl/annotation') diff --git a/include/mbgl/annotation/point_annotation.hpp b/include/mbgl/annotation/point_annotation.hpp new file mode 100644 index 0000000000..17b6fe5369 --- /dev/null +++ b/include/mbgl/annotation/point_annotation.hpp @@ -0,0 +1,22 @@ +#ifndef MBGL_ANNOTATION_POINT_ANNOTATION +#define MBGL_ANNOTATION_POINT_ANNOTATION + +#include + +#include + +namespace mbgl { + +class PointAnnotation { +public: + inline PointAnnotation(const LatLng& position_, const std::string& icon_ = "") + : position(position_), icon(icon_) { + } + + const LatLng position; + const std::string icon; +}; + +} + +#endif diff --git a/include/mbgl/annotation/shape_annotation.hpp b/include/mbgl/annotation/shape_annotation.hpp new file mode 100644 index 0000000000..a35b867266 --- /dev/null +++ b/include/mbgl/annotation/shape_annotation.hpp @@ -0,0 +1,24 @@ +#ifndef MBGL_ANNOTATION_SHAPE_ANNOTATION +#define MBGL_ANNOTATION_SHAPE_ANNOTATION + +#include +#include +#include + +#include + +namespace mbgl { + +class ShapeAnnotation { +public: + inline ShapeAnnotation(const AnnotationSegments& segments_, const StyleProperties& styleProperties_) + : segments(segments_), styleProperties(styleProperties_) { + } + + const AnnotationSegments segments; + const StyleProperties styleProperties; +}; + +} + +#endif -- cgit v1.2.1