diff options
author | Tobrun <tobrun@mapbox.com> | 2017-06-20 15:48:24 +0200 |
---|---|---|
committer | Antonio Zugaldia <antonio@mapbox.com> | 2017-06-20 09:48:24 -0400 |
commit | a9f52e24e63af6d322b3f4744a38aab395344b1d (patch) | |
tree | 015072cdd1d3fe07894be73c3761f4ed5685e48f /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera | |
parent | 899d2b0de931ca1a7295cce35dc7cfb177a5d14b (diff) | |
download | qtlocation-mapboxgl-a9f52e24e63af6d322b3f4744a38aab395344b1d.tar.gz |
Revisit Javadoc for 5.1.0 (#9266)
* [android] - revisit public API javadoc
* [android] fix javadoc minor mistakes and typos
* grammar tweak
* add missing public javadoc
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera')
3 files changed, 42 insertions, 30 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 66c261f1d0..c2f19072db 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 @@ -3,6 +3,7 @@ package com.mapbox.mapboxsdk.camera; import android.content.res.TypedArray; import android.os.Parcel; import android.os.Parcelable; +import android.support.annotation.FloatRange; import com.mapbox.mapboxsdk.R; import com.mapbox.mapboxsdk.constants.MapboxConstants; @@ -166,14 +167,14 @@ public final class CameraPosition implements Parcelable { private double zoom = -1; /** - * Creates an empty builder. + * Create an empty builder. */ public Builder() { super(); } /** - * Create Builder with an existing CameraPosition data. + * Create a builder with an existing CameraPosition data. * * @param previous Existing CameraPosition values to use */ @@ -188,7 +189,7 @@ public final class CameraPosition implements Parcelable { } /** - * Create Builder with an existing CameraPosition data. + * Create a builder with an existing CameraPosition data. * * @param typedArray TypedArray containing attribute values */ @@ -205,7 +206,7 @@ public final class CameraPosition implements Parcelable { } /** - * Create Builder from an existing CameraPositionUpdate update. + * Create a builder from an existing CameraPositionUpdate update. * * @param update Update containing camera options */ @@ -220,7 +221,7 @@ public final class CameraPosition implements Parcelable { } /** - * Create Builder from an existing CameraPositionUpdate update. + * Create builder from an existing CameraPositionUpdate update. * * @param update Update containing camera options */ @@ -235,7 +236,7 @@ public final class CameraPosition implements Parcelable { * Sets the direction that the camera is pointing in, in degrees clockwise from north. * * @param bearing Bearing - * @return Builder + * @return this */ public Builder bearing(double bearing) { double direction = bearing; @@ -252,19 +253,10 @@ public final class CameraPosition implements Parcelable { } /** - * Builds a CameraPosition. + * Sets the location where the camera is pointing at. * - * @return CameraPosition - */ - public CameraPosition build() { - return new CameraPosition(target, zoom, tilt, bearing); - } - - /** - * Sets the location that the camera is pointing at. - * - * @param location Location - * @return Builder + * @param location target of the camera + * @return this */ public Builder target(LatLng location) { this.target = location; @@ -272,28 +264,42 @@ public final class CameraPosition implements Parcelable { } /** - * Set the tilt in degrees + * Set the tilt of the camera in degrees * <p> - * value is clamped to 0 and 60. + * value is clamped to {@link MapboxConstants#MINIMUM_TILT} and {@link MapboxConstants#MAXIMUM_TILT}. * </p> * - * @param tilt Tilt value - * @return Builder + * @param tilt Tilt value of the camera + * @return this */ - public Builder tilt(double tilt) { + public Builder tilt(@FloatRange(from = MapboxConstants.MINIMUM_TILT, + to = MapboxConstants.MAXIMUM_TILT) double tilt) { this.tilt = MathUtils.clamp(tilt, MapboxConstants.MINIMUM_TILT, MapboxConstants.MAXIMUM_TILT); return this; } /** - * Set the zoom + * Set the zoom of the camera + * <p> + * Zoom ranges from {@link MapboxConstants#MINIMUM_ZOOM} to {@link MapboxConstants#MAXIMUM_ZOOM} + * </p> * - * @param zoom Zoom value - * @return Builder + * @param zoom Zoom value of the camera + * @return this */ - public Builder zoom(double zoom) { + public Builder zoom(@FloatRange(from = MapboxConstants.MINIMUM_ZOOM, + to = MapboxConstants.MAXIMUM_ZOOM) double zoom) { this.zoom = zoom; return this; } + + /** + * Builds the CameraPosition. + * + * @return CameraPosition + */ + public CameraPosition build() { + return new CameraPosition(target, zoom, tilt, bearing); + } } } 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 498aa8343b..31f13cbcff 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 @@ -6,10 +6,16 @@ import android.support.annotation.Nullable; import com.mapbox.mapboxsdk.maps.MapboxMap; /** - * Interface definition for camera position changes. + * Interface definition for camera updates. */ public interface CameraUpdate { + /** + * Get the camera position from the camera update. + * + * @param mapboxMap Map object to build the position from + * @return the camera position from the implementing camera update + */ @Nullable 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 8e1411e273..50e33f4f9f 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 @@ -42,7 +42,7 @@ public final class CameraUpdateFactory { } /** - * Returns a {@link CameraUpdate} that transforms the camera such that the specified + * Returns a CameraUpdate that transforms the camera such that the specified * latitude/longitude bounds are centered on screen at the greatest possible zoom level. * 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. @@ -56,7 +56,7 @@ public final class CameraUpdateFactory { } /** - * Returns a {@link CameraUpdate} that transforms the camera such that the specified + * Returns a CameraUpdate that transforms the camera such that the specified * latitude/longitude bounds are centered on screen at the greatest possible zoom level. * 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. |