diff options
author | Tobrun <tobrun.van.nuland@gmail.com> | 2018-04-25 14:35:05 +0200 |
---|---|---|
committer | Tobrun <tobrun@mapbox.com> | 2018-04-25 16:01:58 +0200 |
commit | 2095700a5fd9afc20bed3ebe9fb8e0f66dfc126d (patch) | |
tree | aad48e153a787837ebfa379e9c629e889af564a0 | |
parent | 536860d5522123906ea9c3e3fa0b14e00a4aadc5 (diff) | |
download | qtlocation-mapboxgl-2095700a5fd9afc20bed3ebe9fb8e0f66dfc126d.tar.gz |
[android] - promote pixel ratio to public api of NativeMapview.
-rwxr-xr-x | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java | 7 |
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); } |