From ec60ba6d06d5b156c7b8ecaf47320de2ccdd6fd0 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 19 May 2016 11:29:33 -0700 Subject: [PATCH] [core] Run fixupPolygons on geojson-vt-cpp polygon output --- src/mbgl/annotation/shape_annotation_impl.cpp | 5 +++++ src/mbgl/tile/geojson_tile.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/mbgl/annotation/shape_annotation_impl.cpp b/src/mbgl/annotation/shape_annotation_impl.cpp index 9b9ea3bf26a..87b328558df 100644 --- a/src/mbgl/annotation/shape_annotation_impl.cpp +++ b/src/mbgl/annotation/shape_annotation_impl.cpp @@ -143,6 +143,11 @@ void ShapeAnnotationImpl::updateTile(const CanonicalTileID& tileID, AnnotationTi renderGeometry.push_back(renderLine); } + // https://github.com/mapbox/geojson-vt-cpp/issues/44 + if (featureType == FeatureType::Polygon) { + renderGeometry = fixupPolygons(renderGeometry); + } + layer.features.emplace_back( std::make_shared(featureType, renderGeometry)); } diff --git a/src/mbgl/tile/geojson_tile.cpp b/src/mbgl/tile/geojson_tile.cpp index 81d2cb5144b..90147ffd871 100644 --- a/src/mbgl/tile/geojson_tile.cpp +++ b/src/mbgl/tile/geojson_tile.cpp @@ -89,6 +89,11 @@ std::unique_ptr convertTile(const mapbox::geojsonvt::Tile& tile) { } } + // https://github.com/mapbox/geojson-vt-cpp/issues/44 + if (featureType == FeatureType::Polygon) { + geometry = fixupPolygons(geometry); + } + Feature::property_map properties { feature.tags.begin(), feature.tags.end() }; features.emplace_back(std::make_shared(