diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-02-02 11:08:21 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-02-02 12:56:44 -0800 |
commit | f1f53c36d0d392f83cf99859d993d70676048bdf (patch) | |
tree | 363f552c3ff033c0ed95c0419c5bc4311e1f649c | |
parent | f198f306f320194b129ac67777bc71e16d33a674 (diff) | |
download | qtlocation-mapboxgl-f1f53c36d0d392f83cf99859d993d70676048bdf.tar.gz |
[core] Simplify latLngToCoordinate calculation
-rw-r--r-- | src/mbgl/map/transform_state.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mbgl/map/transform_state.cpp b/src/mbgl/map/transform_state.cpp index 3b9b362796..c0c1845a54 100644 --- a/src/mbgl/map/transform_state.cpp +++ b/src/mbgl/map/transform_state.cpp @@ -261,12 +261,10 @@ LatLng TransformState::pointToLatLng(const PrecisionPoint& point) const { } TileCoordinate TransformState::latLngToCoordinate(const LatLng& latLng) const { - const double tileZoom = getZoom(); - const double k = zoomScale(tileZoom) / worldSize(); return { - lngX(latLng.longitude) * k, - latY(latLng.latitude) * k, - tileZoom + lngX(latLng.longitude) / util::tileSize, + latY(latLng.latitude) / util::tileSize, + getZoom() }; } |