summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java58
1 files changed, 29 insertions, 29 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java
index 0ba40642f5..be98f7e51d 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java
@@ -24,7 +24,7 @@ final class Transform implements MapView.OnCameraDidChangeListener {
private static final String TAG = "Mbgl-Transform";
- private final NativeMapView nativeMapView;
+ private final NativeMap nativeMap;
private final MapView mapView;
private final Handler handler = new Handler();
@@ -44,9 +44,9 @@ final class Transform implements MapView.OnCameraDidChangeListener {
}
};
- Transform(MapView mapView, NativeMapView nativeMapView, CameraChangeDispatcher cameraChangeDispatcher) {
+ Transform(MapView mapView, NativeMap nativeMap, CameraChangeDispatcher cameraChangeDispatcher) {
this.mapView = mapView;
- this.nativeMapView = nativeMapView;
+ this.nativeMap = nativeMap;
this.cameraChangeDispatcher = cameraChangeDispatcher;
}
@@ -99,7 +99,7 @@ final class Transform implements MapView.OnCameraDidChangeListener {
if (isValidCameraPosition(cameraPosition)) {
cancelTransitions();
cameraChangeDispatcher.onCameraMoveStarted(OnCameraMoveStartedListener.REASON_API_ANIMATION);
- nativeMapView.jumpTo(cameraPosition.bearing, cameraPosition.target, cameraPosition.tilt, cameraPosition.zoom);
+ nativeMap.jumpTo(cameraPosition.bearing, cameraPosition.target, cameraPosition.tilt, cameraPosition.zoom);
cameraChangeDispatcher.onCameraIdle();
invalidateCameraPosition();
handler.post(new Runnable() {
@@ -125,7 +125,7 @@ final class Transform implements MapView.OnCameraDidChangeListener {
cameraCancelableCallback = callback;
}
mapView.addOnCameraDidChangeListener(this);
- nativeMapView.easeTo(cameraPosition.bearing, cameraPosition.target, durationMs, cameraPosition.tilt,
+ nativeMap.easeTo(cameraPosition.bearing, cameraPosition.target, durationMs, cameraPosition.tilt,
cameraPosition.zoom, easingInterpolator);
}
}
@@ -142,7 +142,7 @@ final class Transform implements MapView.OnCameraDidChangeListener {
cameraCancelableCallback = callback;
}
mapView.addOnCameraDidChangeListener(this);
- nativeMapView.flyTo(cameraPosition.bearing, cameraPosition.target, durationMs, cameraPosition.tilt,
+ nativeMap.flyTo(cameraPosition.bearing, cameraPosition.target, durationMs, cameraPosition.tilt,
cameraPosition.zoom);
}
}
@@ -154,8 +154,8 @@ final class Transform implements MapView.OnCameraDidChangeListener {
@UiThread
@Nullable
CameraPosition invalidateCameraPosition() {
- if (nativeMapView != null) {
- CameraPosition cameraPosition = nativeMapView.getCameraPosition();
+ if (nativeMap != null) {
+ CameraPosition cameraPosition = nativeMap.getCameraPosition();
if (this.cameraPosition != null && !this.cameraPosition.equals(cameraPosition)) {
cameraChangeDispatcher.onCameraMove();
}
@@ -183,7 +183,7 @@ final class Transform implements MapView.OnCameraDidChangeListener {
}
// cancel ongoing transitions
- nativeMapView.cancelTransitions();
+ nativeMap.cancelTransitions();
cameraChangeDispatcher.onCameraIdle();
}
@@ -191,7 +191,7 @@ final class Transform implements MapView.OnCameraDidChangeListener {
@UiThread
void resetNorth() {
cancelTransitions();
- nativeMapView.resetNorth();
+ nativeMap.resetNorth();
}
//
@@ -201,20 +201,20 @@ final class Transform implements MapView.OnCameraDidChangeListener {
// Zoom in or out
double getRawZoom() {
- return nativeMapView.getZoom();
+ return nativeMap.getZoom();
}
void zoomBy(double zoomAddition, @NonNull PointF focalPoint) {
- setZoom(nativeMapView.getZoom() + zoomAddition, focalPoint);
+ setZoom(nativeMap.getZoom() + zoomAddition, focalPoint);
}
void setZoom(double zoom, @NonNull PointF focalPoint) {
- nativeMapView.setZoom(zoom, focalPoint, 0);
+ nativeMap.setZoom(zoom, focalPoint, 0);
}
// Direction
double getBearing() {
- double direction = -nativeMapView.getBearing();
+ double direction = -nativeMap.getBearing();
while (direction > 360) {
direction -= 360;
@@ -227,19 +227,19 @@ final class Transform implements MapView.OnCameraDidChangeListener {
}
double getRawBearing() {
- return nativeMapView.getBearing();
+ return nativeMap.getBearing();
}
void setBearing(double bearing) {
- nativeMapView.setBearing(bearing);
+ nativeMap.setBearing(bearing);
}
void setBearing(double bearing, float focalX, float focalY) {
- nativeMapView.setBearing(bearing, focalX, focalY);
+ nativeMap.setBearing(bearing, focalX, focalY);
}
void setBearing(double bearing, float focalX, float focalY, long duration) {
- nativeMapView.setBearing(bearing, focalX, focalY, duration);
+ nativeMap.setBearing(bearing, focalX, focalY, duration);
}
@@ -248,7 +248,7 @@ final class Transform implements MapView.OnCameraDidChangeListener {
//
LatLng getLatLng() {
- return nativeMapView.getLatLng();
+ return nativeMap.getLatLng();
}
//
@@ -256,11 +256,11 @@ final class Transform implements MapView.OnCameraDidChangeListener {
//
double getTilt() {
- return nativeMapView.getPitch();
+ return nativeMap.getPitch();
}
void setTilt(Double pitch) {
- nativeMapView.setPitch(pitch, 0);
+ nativeMap.setPitch(pitch, 0);
}
//
@@ -268,15 +268,15 @@ final class Transform implements MapView.OnCameraDidChangeListener {
//
LatLng getCenterCoordinate() {
- return nativeMapView.getLatLng();
+ return nativeMap.getLatLng();
}
void setCenterCoordinate(LatLng centerCoordinate) {
- nativeMapView.setLatLng(centerCoordinate);
+ nativeMap.setLatLng(centerCoordinate);
}
void setGestureInProgress(boolean gestureInProgress) {
- nativeMapView.setGestureInProgress(gestureInProgress);
+ nativeMap.setGestureInProgress(gestureInProgress);
if (!gestureInProgress) {
invalidateCameraPosition();
}
@@ -286,7 +286,7 @@ final class Transform implements MapView.OnCameraDidChangeListener {
if (duration > 0) {
mapView.addOnCameraDidChangeListener(moveByChangeListener);
}
- nativeMapView.moveBy(offsetX, offsetY, duration);
+ nativeMap.moveBy(offsetX, offsetY, duration);
}
//
@@ -298,11 +298,11 @@ final class Transform implements MapView.OnCameraDidChangeListener {
Logger.e(TAG, String.format("Not setting minZoomPreference, value is in unsupported range: %s", minZoom));
return;
}
- nativeMapView.setMinZoom(minZoom);
+ nativeMap.setMinZoom(minZoom);
}
double getMinZoom() {
- return nativeMapView.getMinZoom();
+ return nativeMap.getMinZoom();
}
void setMaxZoom(double maxZoom) {
@@ -310,10 +310,10 @@ final class Transform implements MapView.OnCameraDidChangeListener {
Logger.e(TAG, String.format("Not setting maxZoomPreference, value is in unsupported range: %s", maxZoom));
return;
}
- nativeMapView.setMaxZoom(maxZoom);
+ nativeMap.setMaxZoom(maxZoom);
}
double getMaxZoom() {
- return nativeMapView.getMaxZoom();
+ return nativeMap.getMaxZoom();
}
}