[android] Improve Javadoc for the new MapView methods.

This commit is contained in:
Leith Bade
2015-10-27 00:02:46 +11:00
parent 1f21bbc0eb
commit 5f081701df
2 changed files with 25 additions and 21 deletions

View File

@@ -8,7 +8,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* MyLocationTracking exposes different types location tracking modes.
* MyLocationTracking exposes different types of location tracking modes.
*
* @see MapView#setMyLocationTrackingMode(int)
* @see com.mapbox.mapboxsdk.views.UserLocationView#setMyLocationTrackingMode(int)
@@ -24,27 +24,29 @@ public class MyLocationTracking {
}
/**
* Not tracking user
* Location tracking is disabled.
*/
public static final int TRACKING_NONE = 0x00000000;
/**
* Tracking the location of the user
* Tracking the only the location of the user.
*/
public static final int TRACKING_FOLLOW = 0x00000004;
// /**
// * Tracking the location of the user with bearing from GPS
// * Tracking the location of the user with bearing from GPS.
// */
// public static final int TRACKING_FOLLOW_BEARING_GPS = 0x00000008;
//
// /**
// * Tracking the location of the user with bearing from compass
// * Tracking the location of the user with bearing from compass.
// */
// public static final int TRACKING_FOLLOW_BEARING_COMPASS = 0x00000012;
//
// /**
// * Tracking the location fot the user with bearing from GPS and compass
// * Tracking the location fot the user with bearing from GPS or compass.
// * <p>
// * The best source of bearing is selected automatically.
// */
// public static final int TRACKING_FOLLOW_BEARING = 0x00000016;

View File

@@ -1366,6 +1366,7 @@ public final class MapView extends FrameLayout {
* An error message will be logged in the Android logcat and {@link MapView#DID_FAIL_LOADING_MAP} event will be sent.
*
* @param style The bundled style. Accepts one of the values from {@link Style}.
* @see Style
*/
@UiThread
public void setStyle(@Style.StyleUrl String style) {
@@ -2017,8 +2018,8 @@ public final class MapView extends FrameLayout {
}
/**
* Changes the map’s viewport to fit the given coordinate bounds, optionally some additional padding on each side
* and animating the change.
* Changes the map’s viewport to fit the given coordinate bounds with additional padding at the
* edge of the map, optionally animating the change.
*
* @param bounds The bounds that the viewport will show in its entirety.
* @param padding The minimum padding (in pixels) that will be visible around the given coordinate bounds.
@@ -3137,34 +3138,35 @@ public final class MapView extends FrameLayout {
}
/**
* Set the current my location tracking mode.
* Tracking my location disbales gestures, automatically moves the viewport
* and shows the direction the user is heading.
* See {@link MyLocationTracking} for different values.
* Sets the current my location tracking mode.
* <p>
* My location racking disables gestures, automatically moves the viewport to the users
* location and shows the direction the user is heading.
*
* @param userLocationTrackingMode to be used.
* @see MyLocationTracking
* @param myLocationTrackingMode The my location tracking mode to use.
* Accepts one of the values from {@link MyLocationTracking.Mode}.
* @see MyLocationTracking.Mode
*/
@UiThread
public void setMyLocationTrackingMode(@MyLocationTracking.Mode int userLocationTrackingMode) {
mUserLocationView.setMyLocationTrackingMode(userLocationTrackingMode);
public void setMyLocationTrackingMode(@MyLocationTracking.Mode int myLocationTrackingMode) {
mUserLocationView.setMyLocationTrackingMode(myLocationTrackingMode);
// Enable/disable gestures based on tracking mode
if (userLocationTrackingMode == MyLocationTracking.TRACKING_NONE) {
if (myLocationTrackingMode == MyLocationTracking.TRACKING_NONE) {
mScrollEnabled = true;
mRotateEnabled = true;
} else {
mScrollEnabled = false;
mRotateEnabled = (userLocationTrackingMode == MyLocationTracking.TRACKING_FOLLOW);
mRotateEnabled = (myLocationTrackingMode == MyLocationTracking.TRACKING_FOLLOW);
}
}
/**
* Returns the current user location tracking mode.
* See {@link MyLocationTracking} for possible return values.
*
* @return the current user location tracking mode.
* @see MyLocationTracking
* @return The current user location tracking mode.
* One of the values from {@link MyLocationTracking.Mode}.
* @see MyLocationTracking.Mode
*/
@UiThread
@MyLocationTracking.Mode