public final class CameraUpdateFactory extends Object
CameraUpdate
objects.Constructor and Description |
---|
CameraUpdateFactory() |
Modifier and Type | Method and Description |
---|---|
static CameraUpdate |
newCameraPosition(CameraPosition cameraPosition)
Returns a CameraUpdate that moves the camera to a specified CameraPosition.
|
static CameraUpdate |
newLatLng(LatLng latLng)
Returns a CameraUpdate that moves the center of the screen to a latitude and longitude
specified by a LatLng object.
|
static CameraUpdate |
newLatLngBounds(LatLngBounds bounds,
int padding)
Returns a
CameraUpdate that transforms the camera such that the specified
latitude/longitude bounds are centered on screen at the greatest possible zoom level. |
static CameraUpdate |
newLatLngBounds(LatLngBounds bounds,
int paddingLeft,
int paddingTop,
int paddingRight,
int paddingBottom)
Returns a
CameraUpdate that transforms the camera such that the specified
latitude/longitude bounds are centered on screen at the greatest possible zoom level. |
static CameraUpdate |
newLatLngZoom(LatLng latLng,
double zoom)
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.
|
static CameraUpdate |
scrollBy(float xPixel,
float yPixel)
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.
|
static CameraUpdate |
zoomBy(double amount)
Returns a CameraUpdate that shifts the zoom level of the current camera viewpoint.
|
static CameraUpdate |
zoomBy(double amount,
Point focus)
Returns a CameraUpdate that shifts the zoom level of the current camera viewpoint.
|
static CameraUpdate |
zoomIn()
Returns a CameraUpdate that zooms in on the map by moving the viewpoint's height closer to
the Earth's surface.
|
static CameraUpdate |
zoomOut()
Returns a CameraUpdate that zooms out on the map by moving the viewpoint's height farther
away from the Earth's surface.
|
static CameraUpdate |
zoomTo(double zoom)
Returns a CameraUpdate that moves the camera viewpoint to a particular zoom level.
|
public static CameraUpdate newCameraPosition(@NonNull CameraPosition cameraPosition)
cameraPosition
- Camera Position to change topublic static CameraUpdate newLatLng(@NonNull LatLng latLng)
latLng
- Target location to change topublic static CameraUpdate newLatLngBounds(@NonNull LatLngBounds bounds, int padding)
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.bounds
- Bounds to match Camera position withpadding
- Padding added to the boundspublic static CameraUpdate newLatLngBounds(@NonNull LatLngBounds bounds, int paddingLeft, int paddingTop, int paddingRight, int paddingBottom)
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.bounds
- Bounds to base the Camera position out ofpaddingLeft
- Padding left of the boundspaddingTop
- Padding top of the boundspaddingRight
- Padding right of the boundspaddingBottom
- Padding bottom of the boundspublic static CameraUpdate newLatLngZoom(@NonNull LatLng latLng, double zoom)
latLng
- Target location to change tozoom
- Zoom level to change topublic static CameraUpdate scrollBy(float xPixel, float yPixel)
xPixel
- Amount of pixels to scroll to in x directionyPixel
- Amount of pixels to scroll to in y directionpublic static CameraUpdate zoomBy(double amount, Point focus)
amount
- Amount of zoom level to change withfocus
- Focus point of zoompublic static CameraUpdate zoomBy(double amount)
amount
- Amount of zoom level to change withpublic static CameraUpdate zoomIn()
public static CameraUpdate zoomOut()
public static CameraUpdate zoomTo(double zoom)
zoom
- Zoom level to change to© 2015–2017 Mapbox. All rights reserved.