summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobrun <tobrun.van.nuland@gmail.com>2018-04-25 14:35:05 +0200
committerTobrun <tobrun@mapbox.com>2018-04-25 16:01:58 +0200
commit2095700a5fd9afc20bed3ebe9fb8e0f66dfc126d (patch)
treeaad48e153a787837ebfa379e9c629e889af564a0
parent536860d5522123906ea9c3e3fa0b14e00a4aadc5 (diff)
downloadqtlocation-mapboxgl-2095700a5fd9afc20bed3ebe9fb8e0f66dfc126d.tar.gz
[android] - promote pixel ratio to public api of NativeMapview.
-rwxr-xr-xplatform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java
index 7cae0d0791..b2d7af7687 100755
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java
@@ -78,10 +78,15 @@ final class NativeMapView {
//
public NativeMapView(final Context context, final ViewCallback viewCallback, final MapRenderer mapRenderer) {
+ this(context, context.getResources().getDisplayMetrics().density, viewCallback, mapRenderer);
+ }
+
+ public NativeMapView(final Context context, float pixelRatio,
+ final ViewCallback viewCallback, final MapRenderer mapRenderer) {
this.mapRenderer = mapRenderer;
this.viewCallback = viewCallback;
this.fileSource = FileSource.getInstance(context);
- this.pixelRatio = context.getResources().getDisplayMetrics().density;
+ this.pixelRatio = pixelRatio;
nativeInitialize(this, fileSource, mapRenderer, pixelRatio);
}