summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-05-26 16:35:55 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-06-01 17:36:50 -0700
commit8985b1311b7d00cf761752bd9291566325ae207a (patch)
treeaa42e0a0f5e0dc592d6dcafdf5ff54013ccc7a25 /include
parentaa1a54c577a95082824f2a5a6bdf4948506fcaa9 (diff)
downloadqtlocation-mapboxgl-8985b1311b7d00cf761752bd9291566325ae207a.tar.gz
[core] Use geometry.hpp types for shape annotations
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/annotation/shape_annotation.hpp11
-rw-r--r--include/mbgl/platform/default/glfw_view.hpp4
2 files changed, 7 insertions, 8 deletions
diff --git a/include/mbgl/annotation/shape_annotation.hpp b/include/mbgl/annotation/shape_annotation.hpp
index c5d4c42d87..7dca1ec134 100644
--- a/include/mbgl/annotation/shape_annotation.hpp
+++ b/include/mbgl/annotation/shape_annotation.hpp
@@ -3,14 +3,11 @@
#include <mbgl/annotation/annotation.hpp>
#include <mbgl/style/types.hpp>
-#include <mbgl/util/geo.hpp>
+#include <mbgl/util/geometry.hpp>
#include <mbgl/util/variant.hpp>
namespace mbgl {
-using AnnotationSegment = std::vector<LatLng>;
-using AnnotationSegments = std::vector<AnnotationSegment>;
-
struct FillAnnotationProperties {
float opacity = 1;
Color color = {{ 0, 0, 0, 1 }};
@@ -30,10 +27,10 @@ public:
LineAnnotationProperties, // creates a line annotation
std::string>; // creates an annotation whose type and properties are sourced from a style layer
- ShapeAnnotation(const AnnotationSegments& segments_, const Properties& properties_)
- : segments(segments_), properties(properties_) {}
+ ShapeAnnotation(const Geometry<double>& geometry_, const Properties& properties_)
+ : geometry(geometry_), properties(properties_) {}
- const AnnotationSegments segments;
+ const Geometry<double> geometry;
const Properties properties;
};
diff --git a/include/mbgl/platform/default/glfw_view.hpp b/include/mbgl/platform/default/glfw_view.hpp
index b5931e6262..b3b6116ad7 100644
--- a/include/mbgl/platform/default/glfw_view.hpp
+++ b/include/mbgl/platform/default/glfw_view.hpp
@@ -3,6 +3,7 @@
#include <mbgl/mbgl.hpp>
#include <mbgl/util/run_loop.hpp>
#include <mbgl/util/timer.hpp>
+#include <mbgl/util/geometry.hpp>
#ifdef MBGL_USE_GLES2
#define GLFW_INCLUDE_ES2
@@ -43,7 +44,8 @@ public:
void report(float duration);
private:
- mbgl::LatLng makeRandomPoint() const;
+ mbgl::LatLng makeRandomLatLng() const;
+ mbgl::Point<double> makeRandomPoint() const;
static std::shared_ptr<const mbgl::SpriteImage>
makeSpriteImage(int width, int height, float pixelRatio);