summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/maps/MapViewUtils.java
blob: da9c3f9c8f7aafca6414fb5a911bb69b135533b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.mapbox.mapboxsdk.maps;

import com.mapbox.mapboxsdk.geometry.LatLng;

/**
 * Utility class to bypass package visibility
 */
public class MapViewUtils {

    public static void setDirection(MapView mapView, float direction) {
        mapView.setBearing(direction);
    }

    public static float getDirection(MapView mapView) {
        return (float) mapView.getDirection();
    }

    public static void setTilt(MapView mapView, float tilt) {
        mapView.setTilt((double) tilt);
    }

    public static float getTilt(MapView mapView) {
        return (float) mapView.getTilt();
    }

    public static void setLatLng(MapView mapView, LatLng latLng) {
        mapView.setCenterCoordinate(latLng);
    }

    public static LatLng getLatLng(MapView mapView) {
        return mapView.getCenterCoordinate();
    }

    public static int[] getContentPadding(MapView mapView) {
        return new int[]{mapView.getContentPaddingLeft(), mapView.getContentPaddingTop(), mapView.getContentPaddingRight(), mapView.getContentPaddingBottom()};
    }
}