summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/maps/MapViewUtils.java
blob: 427d7ff21de2c418dcc9b7f86bb5c5db0da80f13 (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
package com.mapbox.mapboxsdk.maps;

import com.mapbox.mapboxsdk.geometry.LatLng;

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

    public static void setDirection(MapboxMap mapboxMap, float direction) {
        mapboxMap.getTransform().setBearing(direction);
    }

    public static float getDirection(MapboxMap mapboxMap) {
        return (float) mapboxMap.getTransform().getBearing();
    }

    public static void setTilt(MapboxMap mapboxMap, float tilt) {
        mapboxMap.getTransform().setTilt((double) tilt);
    }

    public static float getTilt(MapboxMap mapboxMap) {
        return (float) mapboxMap.getTransform().getTilt();
    }

    public static void setLatLng(MapboxMap mapboxMap, LatLng latLng) {
        mapboxMap.getTransform().setCenterCoordinate(latLng);
    }

    public static LatLng getLatLng(MapboxMap mapboxMap) {
        return mapboxMap.getTransform().getCenterCoordinate();
    }
}