@@ -1825,7 +1825,7 @@ - (void)setCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration a
1825
1825
double angle = -1 ;
1826
1826
if (camera.heading >= 0 )
1827
1827
{
1828
- angle = MGLRadiansFromDegrees (mbgl::util::wrap ( -camera.heading , 0 ., 360 .) );
1828
+ angle = MGLRadiansFromDegrees (-camera.heading );
1829
1829
}
1830
1830
double pitch = -1 ;
1831
1831
if (camera.pitch >= 0 )
@@ -1851,12 +1851,12 @@ - (void)setCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration a
1851
1851
else // portrait
1852
1852
{
1853
1853
sw = _mbglMap->latLngForProjectedMeters ({
1854
- centerMeters.northing - centerToEdge * std::cos (angle) + centerToEdge * std::cos (angle) * std::sin (pitch) / 2 ,
1855
- centerMeters.easting - centerToEdge * std::sin (angle) + centerToEdge * std::sin (angle) * std::sin (pitch) / 2 ,
1854
+ centerMeters.northing - centerToEdge * std::cos (- angle) + centerToEdge * std::cos (- angle) * std::sin (pitch) / 2 ,
1855
+ centerMeters.easting - centerToEdge * std::sin (- angle) + centerToEdge * std::sin (- angle) * std::sin (pitch) / 2 ,
1856
1856
});
1857
1857
ne = _mbglMap->latLngForProjectedMeters ({
1858
- centerMeters.northing + centerToEdge * std::cos (angle) - centerToEdge * std::cos (angle) * std::sin (pitch) / 2 ,
1859
- centerMeters.easting + centerToEdge * std::sin (angle) - centerToEdge * std::sin (angle) * std::sin (pitch) / 2 ,
1858
+ centerMeters.northing + centerToEdge * std::cos (- angle) - centerToEdge * std::cos (- angle) * std::sin (pitch) / 2 ,
1859
+ centerMeters.easting + centerToEdge * std::sin (- angle) - centerToEdge * std::sin (- angle) * std::sin (pitch) / 2 ,
1860
1860
});
1861
1861
}
1862
1862
@@ -1865,7 +1865,7 @@ - (void)setCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration a
1865
1865
mbgl::CameraOptions options = _mbglMap->cameraForLatLngs ({ sw, ne }, {});
1866
1866
options.center = centerLatLng;
1867
1867
1868
- if (angle >= 0 )
1868
+ if (camera. heading >= 0 )
1869
1869
{
1870
1870
options.angle = angle;
1871
1871
}
0 commit comments