diff options
author | Tobrun <tobrun.van.nuland@gmail.com> | 2018-02-13 12:25:45 +0100 |
---|---|---|
committer | Tobrun <tobrun@mapbox.com> | 2018-02-13 12:50:51 +0100 |
commit | 734b420649392fd7e35e808e9a5053b9c38b5adc (patch) | |
tree | f4f6a23775e8cbdc6474d449a8d4f308f25185ee /platform/android | |
parent | b8240f725cbfdb4b5369b050c933acdd4e42b705 (diff) | |
download | qtlocation-mapboxgl-734b420649392fd7e35e808e9a5053b9c38b5adc.tar.gz |
[android] - add constrained latlng documentation, add MapboxMap#LatLngZoom
Diffstat (limited to 'platform/android')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java index 2fd9a9010c..4f2c940ea3 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java @@ -621,6 +621,9 @@ public final class MapboxMap { /** * Moves the center of the screen to a latitude and longitude specified by a LatLng object. This centers the * camera on the LatLng object. + * <p> + * Note that at low zoom levels, setLatLng is constrained so that the entire viewport shows map data. + * </p> * * @param latLng Target location to change to */ @@ -641,6 +644,21 @@ public final class MapboxMap { } /** + * Moves the center and the zoom of the camera specified by a LatLng object and double zoom. + * <p> + * Note that at low zoom levels, setLatLng is constrained so that the entire viewport shows map data. + * </p> + * + * @param latLng Target location to change to + */ + public void setLatLngZoom(@NonNull LatLng latLng, + @FloatRange(from = MapboxConstants.MINIMUM_ZOOM, + to = MapboxConstants.MAXIMUM_ZOOM) double zoom) { + setZoom(zoom); + setLatLng(latLng); + } + + /** * Moves the camera viewpoint angle to a particular angle in degrees. * * @param tilt Tilt angle to change to @@ -1882,7 +1900,6 @@ public final class MapboxMap { * * @param listener The callback that's invoked when the map is scrolled. * To unset the callback, use null. - * * @deprecated Use {@link #addOnScrollListener(OnScrollListener)} instead. */ @Deprecated @@ -1895,7 +1912,6 @@ public final class MapboxMap { * * @param listener The callback that's invoked when the map is scrolled. * To unset the callback, use null. - * */ public void addOnScrollListener(@Nullable OnScrollListener listener) { onRegisterTouchListener.onAddScrollListener(listener); @@ -1906,7 +1922,6 @@ public final class MapboxMap { * * @param listener The callback that's invoked when the map is scrolled. * To unset the callback, use null. - * */ public void removeOnScrollListener(@Nullable OnScrollListener listener) { onRegisterTouchListener.onRemoveScrollListener(listener); @@ -1917,7 +1932,6 @@ public final class MapboxMap { * * @param listener The callback that's invoked when the map is flinged. * To unset the callback, use null. - * * @deprecated Use {@link #addOnFlingListener(OnFlingListener)} instead. */ @Deprecated @@ -1950,7 +1964,6 @@ public final class MapboxMap { * * @param listener The callback that's invoked when the user clicks on the map view. * To unset the callback, use null. - * * @deprecated Use {@link #addOnMapClickListener(OnMapClickListener)} instead. */ @Deprecated @@ -1983,7 +1996,6 @@ public final class MapboxMap { * * @param listener The callback that's invoked when the user long clicks on the map view. * To unset the callback, use null. - * * @deprecated Use {@link #addOnMapLongClickListener(OnMapLongClickListener)} instead. */ @Deprecated |