diff options
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera')
4 files changed, 44 insertions, 36 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraPosition.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraPosition.java index 233e8946e7..679a474ae7 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraPosition.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraPosition.java @@ -11,6 +11,9 @@ import com.mapbox.mapboxsdk.constants.MathConstants; import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.utils.MathUtils; +/** + * Resembles the position, angle, zoom and tilt of the user's viewpoint. + */ public final class CameraPosition implements Parcelable { public static final Parcelable.Creator<CameraPosition> CREATOR @@ -28,7 +31,6 @@ public final class CameraPosition implements Parcelable { } }; - /** * Direction that the camera is pointing in, in degrees clockwise from north. */ @@ -68,7 +70,7 @@ public final class CameraPosition implements Parcelable { @Override public int describeContents() { - return 0; + return hashCode(); } @Override @@ -115,7 +117,7 @@ public final class CameraPosition implements Parcelable { } /** - * Builds camera position. + * Builder for composing {@link CameraPosition} objects. */ public static final class Builder { @@ -215,7 +217,6 @@ public final class CameraPosition implements Parcelable { } } - /** * Sets the direction that the camera is pointing in, in degrees clockwise from north. * diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdate.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdate.java index c6852624ef..94ee4912ce 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdate.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdate.java @@ -2,10 +2,12 @@ package com.mapbox.mapboxsdk.camera; import android.support.annotation.NonNull; -import com.mapbox.mapboxsdk.camera.CameraPosition; import com.mapbox.mapboxsdk.maps.MapboxMap; -public interface CameraUpdate { +/** + * Interface definition for camera position changes. + */ +public interface CameraUpdate { CameraPosition getCameraPosition(@NonNull MapboxMap mapboxMap); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdateFactory.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdateFactory.java index 93d1cd2e66..acec8f17fb 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdateFactory.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdateFactory.java @@ -16,13 +16,16 @@ import com.mapbox.mapboxsdk.utils.MathUtils; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; +/** + * Factory for creating {@link CameraUpdate} objects. + */ public final class CameraUpdateFactory { /** * Returns a CameraUpdate that moves the camera to a specified CameraPosition. * * @param cameraPosition Camera Position to change to - * @return CameraUpdate Final Camera Position data + * @return CameraUpdate Final Camera Position */ public static CameraUpdate newCameraPosition(@NonNull CameraPosition cameraPosition) { return new CameraPositionUpdate(cameraPosition.bearing, cameraPosition.target, cameraPosition.tilt, cameraPosition.zoom); @@ -32,8 +35,8 @@ public final class CameraUpdateFactory { * Returns a CameraUpdate that moves the center of the screen to a latitude and longitude * specified by a LatLng object. This centers the camera on the LatLng object. * - * @param latLng - * @return + * @param latLng Target location to change to + * @return CameraUpdate Final Camera Position */ public static CameraUpdate newLatLng(@NonNull LatLng latLng) { return new CameraPositionUpdate(-1, latLng, -1, -1); @@ -45,9 +48,9 @@ public final class CameraUpdateFactory { * You can specify padding, in order to inset the bounding box from the map view's edges. * The returned CameraUpdate has a bearing of 0 and a tilt of 0. * - * @param bounds - * @param padding - * @return + * @param bounds Bounds to match Camera position with + * @param padding Padding added to the bounds + * @return CameraUpdate Final Camera Position */ public static CameraUpdate newLatLngBounds(@NonNull LatLngBounds bounds, int padding) { return newLatLngBounds(bounds, padding, padding, padding, padding); @@ -60,34 +63,36 @@ public final class CameraUpdateFactory { * You can specify padding, in order to inset the bounding box from the map view's edges. * The returned CameraUpdate has a bearing of 0 and a tilt of 0. * - * @param bounds - * @param paddingLeft - * @param paddingTop - * @param paddingRight - * @param paddingBottom - * @return + * @param bounds Bounds to base the Camera position out of + * @param paddingLeft Padding left of the bounds + * @param paddingTop Padding top of the bounds + * @param paddingRight Padding right of the bounds + * @param paddingBottom Padding bottom of the bounds + * @return CameraUpdate Final Camera Position */ public static CameraUpdate newLatLngBounds(@NonNull LatLngBounds bounds, int paddingLeft, int paddingTop, int paddingRight, int paddingBottom) { return new CameraBoundsUpdate(bounds, paddingLeft, paddingTop, paddingRight, paddingBottom); } /** - * Returns a CameraUpdate that moves the center of the screen to a latitude and longitude specified by a LatLng object, and moves to the given zoom level. + * Returns a CameraUpdate that moves the center of the screen to a latitude and longitude specified by a LatLng object, + * and moves to the given zoom level. * - * @param latLng - * @param zoom - * @return + * @param latLng Target location to change to + * @param zoom Zoom level to change to + * @return CameraUpdate Final Camera Position */ public static CameraUpdate newLatLngZoom(@NonNull LatLng latLng, float zoom) { return new CameraPositionUpdate(-1, latLng, -1, zoom); } /** - * Returns a CameraUpdate that scrolls the camera over the map, shifting the center of view by the specified number of pixels in the x and y directions. + * Returns a CameraUpdate that scrolls the camera over the map, + * shifting the center of view by the specified number of pixels in the x and y directions. * - * @param xPixel - * @param yPixel - * @return + * @param xPixel Amount of pixels to scroll to in x direction + * @param yPixel Amount of pixels to scroll to in y direction + * @return CameraUpdate Final Camera Position */ public static CameraUpdate scrollBy(float xPixel, float yPixel) { return new CameraMoveUpdate(xPixel, yPixel); @@ -96,9 +101,9 @@ public final class CameraUpdateFactory { /** * Returns a CameraUpdate that shifts the zoom level of the current camera viewpoint. * - * @param amount - * @param focus - * @return + * @param amount Amount of zoom level to change with + * @param focus Focus point of zoom + * @return CameraUpdate Final Camera Position */ public static CameraUpdate zoomBy(float amount, Point focus) { return new ZoomUpdate(amount, focus.x, focus.y); @@ -107,8 +112,8 @@ public final class CameraUpdateFactory { /** * Returns a CameraUpdate that shifts the zoom level of the current camera viewpoint. * - * @param amount - * @return + * @param amount Amount of zoom level to change with + * @return CameraUpdate Final Camera Position */ public static CameraUpdate zoomBy(float amount) { return new ZoomUpdate(ZoomUpdate.ZOOM_BY, amount); @@ -117,7 +122,7 @@ public final class CameraUpdateFactory { /** * Returns a CameraUpdate that zooms in on the map by moving the viewpoint's height closer to the Earth's surface. The zoom increment is 1.0. * - * @return + * @return CameraUpdate Final Camera Position */ public static CameraUpdate zoomIn() { return new ZoomUpdate(ZoomUpdate.ZOOM_IN); @@ -126,7 +131,7 @@ public final class CameraUpdateFactory { /** * Returns a CameraUpdate that zooms out on the map by moving the viewpoint's height farther away from the Earth's surface. The zoom increment is -1.0. * - * @return + * @return CameraUpdate Final Camera Position */ public static CameraUpdate zoomOut() { return new ZoomUpdate(ZoomUpdate.ZOOM_OUT); @@ -135,8 +140,8 @@ public final class CameraUpdateFactory { /** * Returns a CameraUpdate that moves the camera viewpoint to a particular zoom level. * - * @param zoom - * @return + * @param zoom Zoom level to change to + * @return CameraUpdate Final Camera Position */ public static CameraUpdate zoomTo(float zoom) { return new ZoomUpdate(ZoomUpdate.ZOOM_TO, zoom); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/package-info.java index c480bdacf5..04ef699c21 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/package-info.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/package-info.java @@ -1,4 +1,4 @@ /** - * This package contains the Camera API classes which are used to control the user's viewpoint of the map. + * Contains the Mapbox Maps Android Camera API classes. */ package com.mapbox.mapboxsdk.camera; |