diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-04-11 17:07:25 +0300 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-04-14 12:33:13 -0700 |
commit | 2f4d162debd7e4accfc0b20360058304dce40801 (patch) | |
tree | 276894e2ccfa67874dbe6ecf263330d6b35007ad /platform | |
parent | 8877452ec36d01a753221998f31b67700e595d54 (diff) | |
download | qtlocation-mapboxgl-2f4d162debd7e4accfc0b20360058304dce40801.tar.gz |
[core] Tighten geo.hpp ctors
Diffstat (limited to 'platform')
-rwxr-xr-x | platform/android/src/native_map_view.cpp | 2 | ||||
-rw-r--r-- | platform/darwin/src/MGLMapCamera.mm | 8 | ||||
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 4 | ||||
-rw-r--r-- | platform/qt/src/qmapboxgl.cpp | 10 |
4 files changed, 12 insertions, 12 deletions
diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp index 78e021c321..e5edc1c30f 100755 --- a/platform/android/src/native_map_view.cpp +++ b/platform/android/src/native_map_view.cpp @@ -643,7 +643,7 @@ jni::jdouble NativeMapView::getMetersPerPixelAtLatitude(JNIEnv&, jni::jdouble la jni::Object<ProjectedMeters> NativeMapView::projectedMetersForLatLng(JNIEnv& env, jni::jdouble latitude, jni::jdouble longitude) { mbgl::ProjectedMeters projectedMeters = map->projectedMetersForLatLng(mbgl::LatLng(latitude, longitude)); - return ProjectedMeters::New(env, projectedMeters.northing, projectedMeters.easting); + return ProjectedMeters::New(env, projectedMeters.northing(), projectedMeters.easting()); } jni::Object<PointF> NativeMapView::pixelForLatLng(JNIEnv& env, jdouble latitude, jdouble longitude) { diff --git a/platform/darwin/src/MGLMapCamera.mm b/platform/darwin/src/MGLMapCamera.mm index 49c7e70900..1611dbf4a3 100644 --- a/platform/darwin/src/MGLMapCamera.mm +++ b/platform/darwin/src/MGLMapCamera.mm @@ -32,11 +32,11 @@ BOOL MGLEqualFloatWithAccuracy(CGFloat left, CGFloat right, CGFloat accuracy) mbgl::ProjectedMeters centerMeters = mbgl::Projection::projectedMetersForLatLng(centerLatLng); mbgl::ProjectedMeters eyeMeters = mbgl::Projection::projectedMetersForLatLng(eyeLatLng); - heading = std::atan((centerMeters.northing - eyeMeters.northing) / - (centerMeters.easting - eyeMeters.easting)); + heading = std::atan((centerMeters.northing() - eyeMeters.northing()) / + (centerMeters.easting() - eyeMeters.easting())); - double groundDistance = std::hypot(centerMeters.northing - eyeMeters.northing, - centerMeters.easting - eyeMeters.easting); + double groundDistance = std::hypot(centerMeters.northing() - eyeMeters.northing(), + centerMeters.easting() - eyeMeters.easting()); pitch = std::atan(eyeAltitude / groundDistance); } diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 5ae588d619..6badb1d857 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -4559,8 +4559,8 @@ public: mbgl::LatLng targetLatLng = MGLLatLngFromLocationCoordinate2D(self.targetCoordinate); mbgl::ProjectedMeters userMeters = mbgl::Projection::projectedMetersForLatLng(userLatLng); mbgl::ProjectedMeters targetMeters = mbgl::Projection::projectedMetersForLatLng(targetLatLng); - double angle = atan2(targetMeters.easting - userMeters.easting, - targetMeters.northing - userMeters.northing); + double angle = atan2(targetMeters.easting() - userMeters.easting(), + targetMeters.northing() - userMeters.northing()); direction = mbgl::util::wrap(MGLDegreesFromRadians(angle), 0., 360.); } else diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp index 2f5b3d84db..143af2ed16 100644 --- a/platform/qt/src/qmapboxgl.cpp +++ b/platform/qt/src/qmapboxgl.cpp @@ -1130,7 +1130,7 @@ double QMapboxGL::metersPerPixelAtLatitude(double latitude, double zoom) const QMapbox::ProjectedMeters QMapboxGL::projectedMetersForCoordinate(const QMapbox::Coordinate &coordinate_) const { auto projectedMeters = d_ptr->mapObj->projectedMetersForLatLng(mbgl::LatLng { coordinate_.first, coordinate_.second }); - return QMapbox::ProjectedMeters(projectedMeters.northing, projectedMeters.easting); + return QMapbox::ProjectedMeters(projectedMeters.northing(), projectedMeters.easting()); } /*! @@ -1229,10 +1229,10 @@ void QMapboxGL::setMargins(const QMargins &margins_) QMargins QMapboxGL::margins() const { return QMargins( - d_ptr->margins.left, - d_ptr->margins.top, - d_ptr->margins.right, - d_ptr->margins.bottom + d_ptr->margins.left(), + d_ptr->margins.top(), + d_ptr->margins.right(), + d_ptr->margins.bottom() ); } |