summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <thiago@mapbox.com>2016-06-01 11:16:45 +0300
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-06-01 17:36:50 -0700
commitcfd6757ecc9bd4d9b1f4c5266d19da48c529f58b (patch)
tree25060fc52460e8d922ec1ae6c43e709979cf3a85 /platform
parent8985b1311b7d00cf761752bd9291566325ae207a (diff)
downloadqtlocation-mapboxgl-cfd6757ecc9bd4d9b1f4c5266d19da48c529f58b.tar.gz
[Qt] Use geometry.hpp internally for shape annotations
Diffstat (limited to 'platform')
-rw-r--r--platform/qt/src/qmapboxgl.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp
index b175a6175b..976da9a1eb 100644
--- a/platform/qt/src/qmapboxgl.cpp
+++ b/platform/qt/src/qmapboxgl.cpp
@@ -413,22 +413,21 @@ mbgl::ShapeAnnotation fromQMapboxGLShapeAnnotation(const ShapeAnnotation &shapeA
const CoordinateSegments &segments = shapeAnnotation.first;
const QString &styleLayer = shapeAnnotation.second;
- mbgl::AnnotationSegments mbglAnnotationSegments;
- mbglAnnotationSegments.reserve(segments.size());
+ mbgl::Polygon<double> polygon;
+ polygon.reserve(segments.size());
for (const Coordinates &coordinates : segments) {
- mbgl::AnnotationSegment mbglAnnotationSegment;
- mbglAnnotationSegment.reserve(coordinates.size());
+ mbgl::LinearRing<double> linearRing;
+ linearRing.reserve(coordinates.size());
for (const Coordinate &coordinate : coordinates) {
- mbgl::LatLng mbglCoordinate(coordinate.first, coordinate.second);
- mbglAnnotationSegment.emplace_back(mbglCoordinate);
+ linearRing.emplace_back(mbgl::Point<double>(coordinate.first, coordinate.second));
}
- mbglAnnotationSegments.emplace_back(mbglAnnotationSegment);
+ polygon.emplace_back(linearRing);
}
- return { mbglAnnotationSegments, styleLayer.toStdString() };
+ return { polygon, styleLayer.toStdString() };
}
AnnotationID QMapboxGL::addShapeAnnotation(const ShapeAnnotation &shapeAnnotation)