diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-05-26 15:59:23 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-06-01 17:36:50 -0700 |
commit | aa1a54c577a95082824f2a5a6bdf4948506fcaa9 (patch) | |
tree | 47ebfe8eab89811cbd877308cf981254f22226f7 /src/mbgl/annotation/shape_annotation_impl.cpp | |
parent | efaf6461aa99a5d42ce97c0bd8daf352e5b486f8 (diff) | |
download | qtlocation-mapboxgl-aa1a54c577a95082824f2a5a6bdf4948506fcaa9.tar.gz |
[core] Do annotation longitude wrapping together with latitude clamping
Diffstat (limited to 'src/mbgl/annotation/shape_annotation_impl.cpp')
-rw-r--r-- | src/mbgl/annotation/shape_annotation_impl.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mbgl/annotation/shape_annotation_impl.cpp b/src/mbgl/annotation/shape_annotation_impl.cpp index 1da2e4ea9f..76a237bfc2 100644 --- a/src/mbgl/annotation/shape_annotation_impl.cpp +++ b/src/mbgl/annotation/shape_annotation_impl.cpp @@ -91,8 +91,9 @@ void ShapeAnnotationImpl::updateTile(const CanonicalTileID& tileID, AnnotationTi for (auto& segment : shape.segments) { std::vector<geojsonvt::LonLat> points; for (auto& latLng : segment) { - const double constrainedLatitude = util::clamp(latLng.latitude, -util::LATITUDE_MAX, util::LATITUDE_MAX); - points.push_back(geojsonvt::LonLat(latLng.longitude, constrainedLatitude)); + const double wrappedLongitude = util::wrap(latLng.longitude, -util::LONGITUDE_MAX, util::LONGITUDE_MAX); + const double clampedLatitude = util::clamp(latLng.latitude, -util::LATITUDE_MAX, util::LATITUDE_MAX); + points.push_back(geojsonvt::LonLat(wrappedLongitude, clampedLatitude)); } if (type == geojsonvt::ProjectedFeatureType::Polygon && |