summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorJustin R. Miller <incanus@codesorcery.net>2015-07-30 16:24:17 -0700
committerJustin R. Miller <incanus@codesorcery.net>2015-07-30 16:24:17 -0700
commitb88fc75f747e64f9ef7ab2510f3610b4f637ecd2 (patch)
treec65818651b5026733f6cf9a34a98de66e5354372 /android
parent88d7a92655bc4bdf2c17cb60b369605629cce78c (diff)
downloadqtlocation-mapboxgl-b88fc75f747e64f9ef7ab2510f3610b4f637ecd2.tar.gz
compensate for Android screen ratio in conversion routines
Diffstat (limited to 'android')
-rw-r--r--android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/MapView.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/MapView.java b/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/MapView.java
index 15b1d32fe3..bc4b823c0e 100644
--- a/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/MapView.java
+++ b/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/MapView.java
@@ -490,11 +490,12 @@ public class MapView extends SurfaceView {
}
public LatLng fromScreenLocation(PointF point) {
- return mNativeMapView.latLngForPixel(point);
+ return mNativeMapView.latLngForPixel(new PointF(point.x / mScreenDensity, point.y / mScreenDensity));
}
public PointF toScreenLocation(LatLng location) {
- return mNativeMapView.pixelForLatLng(location);
+ PointF point = mNativeMapView.pixelForLatLng(location);
+ return new PointF(point.x * mScreenDensity, point.y * mScreenDensity);
}
//