[darwin] Use MGLLatLngFromLocationCoordinate2D where appropriate

This commit is contained in:
John Firebaugh
2017-04-03 11:51:06 -07:00
parent 0314a46ee4
commit 391a10db0e
3 changed files with 5 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
#import "MGLMapCamera.h"
#import "MGLGeometry_Private.h"
#include <mbgl/util/projection.hpp>
@@ -23,8 +24,8 @@ BOOL MGLEqualFloatWithAccuracy(CGFloat left, CGFloat right, CGFloat accuracy)
fromEyeCoordinate:(CLLocationCoordinate2D)eyeCoordinate
eyeAltitude:(CLLocationDistance)eyeAltitude
{
mbgl::LatLng centerLatLng = mbgl::LatLng(centerCoordinate.latitude, centerCoordinate.longitude);
mbgl::LatLng eyeLatLng = mbgl::LatLng(eyeCoordinate.latitude, eyeCoordinate.longitude);
mbgl::LatLng centerLatLng = MGLLatLngFromLocationCoordinate2D(centerCoordinate);
mbgl::LatLng eyeLatLng = MGLLatLngFromLocationCoordinate2D(eyeCoordinate);
mbgl::ProjectedMeters centerMeters = mbgl::Projection::projectedMetersForLatLng(centerLatLng);
mbgl::ProjectedMeters eyeMeters = mbgl::Projection::projectedMetersForLatLng(eyeLatLng);

View File

@@ -163,7 +163,7 @@
if (!_bounds) {
mbgl::LatLngBounds bounds = mbgl::LatLngBounds::empty();
for (auto coordinate : _coordinates) {
bounds.extend(mbgl::LatLng(coordinate.latitude, coordinate.longitude));
bounds.extend(MGLLatLngFromLocationCoordinate2D(coordinate));
}
_bounds = bounds;
}

View File

@@ -54,7 +54,7 @@ NS_ASSUME_NONNULL_BEGIN
if (!_bounds) {
mbgl::LatLngBounds bounds = mbgl::LatLngBounds::empty();
for (auto coordinate : _coordinates) {
bounds.extend(mbgl::LatLng(coordinate.latitude, coordinate.longitude));
bounds.extend(MGLLatLngFromLocationCoordinate2D(coordinate));
}
_bounds = bounds;
}