summaryrefslogtreecommitdiff
path: root/src/mbgl/annotation/shape_annotation_impl.cpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-06-01 17:29:50 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-06-01 17:37:01 -0700
commit3689f52ef3f001450dd2480f5a985568efefe819 (patch)
tree90cd0af73308b7139bbfd643fd3f5bdda34a06a8 /src/mbgl/annotation/shape_annotation_impl.cpp
parent8068424f3040b97b23e2e09a9279ebc221284c2e (diff)
downloadqtlocation-mapboxgl-3689f52ef3f001450dd2480f5a985568efefe819.tar.gz
[core] Constrain annotation API to the supported geometry types
Diffstat (limited to 'src/mbgl/annotation/shape_annotation_impl.cpp')
-rw-r--r--src/mbgl/annotation/shape_annotation_impl.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/mbgl/annotation/shape_annotation_impl.cpp b/src/mbgl/annotation/shape_annotation_impl.cpp
index a5116be72f..a2dc4c8093 100644
--- a/src/mbgl/annotation/shape_annotation_impl.cpp
+++ b/src/mbgl/annotation/shape_annotation_impl.cpp
@@ -57,18 +57,6 @@ struct ToGeoJSONVT {
return convertFeature(geojsonvt::ProjectedFeatureType::Polygon, converted);
}
- geojsonvt::ProjectedFeature operator()(const Point<double>&) {
- throw std::runtime_error("unsupported shape annotation geometry type");
- }
-
- geojsonvt::ProjectedFeature operator()(const MultiPoint<double>&) {
- throw std::runtime_error("unsupported shape annotation geometry type");
- }
-
- geojsonvt::ProjectedFeature operator()(const mapbox::geometry::geometry_collection<double>&) {
- throw std::runtime_error("unsupported shape annotation geometry type");
- }
-
private:
geojsonvt::LonLat convertPoint(const Point<double>& p) const {
return {
@@ -104,7 +92,7 @@ void ShapeAnnotationImpl::updateTile(const CanonicalTileID& tileID, AnnotationTi
const double tolerance = baseTolerance / (maxAmountOfTiles * util::EXTENT);
std::vector<geojsonvt::ProjectedFeature> features = {
- Geometry<double>::visit(geometry(), ToGeoJSONVT(tolerance))
+ ShapeAnnotationGeometry::visit(geometry(), ToGeoJSONVT(tolerance))
};
mapbox::geojsonvt::Options options;