public final class

CameraUpdateFactory

extends Object
java.lang.Object
   ↳ com.amazon.geo.mapsv2.CameraUpdateFactory

Class Overview

Contains methods for creating CameraUpdate objects. Pass a CameraUpdate object to the methods for animating or moving the map camera:

Before you can use the methods in this class, the map must be initialized. If you call these methods before obtaining an AmazonMap object, you must initialize the map first by calling initialize(Context).

Summary

Public Methods
static CameraUpdate newCameraPosition(CameraPosition cameraPosition)
Returns a CameraUpdate object set to the specified CameraPosition.
static CameraUpdate newLatLng(LatLng latLng)
Returns a CameraUpdate object set to the specified geographic location (LatLng).
static CameraUpdate newLatLngBounds(LatLngBounds bounds, int width, int height, int padding)
Returns a CameraUpdate object set to the specified LatLngBounds, padding, width, and height.
static CameraUpdate newLatLngBounds(LatLngBounds bounds, int padding)
Returns a CameraUpdate object set to the specified LatLngBounds and padding.
static CameraUpdate newLatLngZoom(LatLng latLng, float zoom)
Returns a CameraUpdate object set to the specified LatLng and specified zoom level.
static CameraUpdate scrollBy(float xPixel, float yPixel)
Returns a CameraUpdate object set to shift the camera the specified number of pixels.
static CameraUpdate zoomBy(float amount, Point focus)
Returns a CameraUpdate object set to zoom the camera by a specified amount over a given focal point.
static CameraUpdate zoomBy(float amount)
Returns a CameraUpdate object set to zoom the camera by the specified amount.
static CameraUpdate zoomIn()
Returns a CameraUpdate object set to zoom the camera in one level (+1).
static CameraUpdate zoomOut()
Returns a CameraUpdate object set to zoom the camera out one level (-1).
static CameraUpdate zoomTo(float zoom)
Returns a CameraUpdate object set to zoom the camera to the specified level.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static CameraUpdate newCameraPosition (CameraPosition cameraPosition)

Returns a CameraUpdate object set to the specified CameraPosition. A CameraPosition can include all camera properties (target, bearing, tilt, and zoom).

Parameters
cameraPosition A CameraPosition object representing the new camera position.
Returns
  • A new CameraUpdate object.

public static CameraUpdate newLatLng (LatLng latLng)

Returns a CameraUpdate object set to the specified geographic location (LatLng). All other camera properties are unchanged.

Parameters
latLng A LatLng object representing the new latitude and longitude.
Returns
  • A new CameraUpdate object.

public static CameraUpdate newLatLngBounds (LatLngBounds bounds, int width, int height, int padding)

Returns a CameraUpdate object set to the specified LatLngBounds, padding, width, and height. Using this CameraUpdate moves the camera such that the specified bounds are visible inside the screen with the specified padding with the desired width and height (as close as possible).

Note that this method can be called before the map view has undergone layout.

Parameters
bounds A LatLngBounds object representing the region to fit on screen.
width The desired width of the bounding box in pixels (px).
height The desired height of the bounding box in pixels (px).
padding Padding in pixels (px) between the bounding box and the edge of the view. A single padding is used for all four sides of the bounding box.
Returns
  • A new CameraUpdate object.

public static CameraUpdate newLatLngBounds (LatLngBounds bounds, int padding)

Returns a CameraUpdate object set to the specified LatLngBounds and padding. Using this CameraUpdate moves the camera such that the specified bounds are visible inside the screen with the specified padding.

Note that calling this method before the map view has undergone layout throws an IllegalStateException.

Parameters
bounds A LatLngBounds object representing the region to fit on screen.
padding The padding in pixels (px) between the bounding box and the edge of the view. A single padding is used for all four sides of the bounding box.
Returns
  • A new CameraUpdate object.

public static CameraUpdate newLatLngZoom (LatLng latLng, float zoom)

Returns a CameraUpdate object set to the specified LatLng and specified zoom level.

When setting the zoom level, smaller numbers move the camera further from the earth. Larger numbers move the camera closer to the earth.

Parameters
latLng A LatLng object representing the desired latitude and longitude.
zoom The desired zoom level.
Returns
  • A new CameraUpdate object.

public static CameraUpdate scrollBy (float xPixel, float yPixel)

Returns a CameraUpdate object set to shift the camera the specified number of pixels.

Parameters
xPixel The number of pixels to shift horizontally. Positive numbers move the camera to the right. Negative numbers move the camera to the left (with respect to the current camera orientation).
yPixel The number of pixels to shift vertically. Positive numbers move the camera to the down. Negative numbers move the camera to the up (with respect to the current camera orientation).
Returns
  • A new CameraUpdate object.

public static CameraUpdate zoomBy (float amount, Point focus)

Returns a CameraUpdate object set to zoom the camera by a specified amount over a given focal point.

Parameters
amount Amount to change the zoom level. Positive numbers move the camera closer to the earth. Negative numbers move the camera further from the earth.
focus The pixel around which to zoom. The latitude / longitude at that pixel is the same after this camera change.
Returns
  • A new CameraUpdate object.

public static CameraUpdate zoomBy (float amount)

Returns a CameraUpdate object set to zoom the camera by the specified amount.

Parameters
amount Amount to change the zoom level. Positive numbers move the camera closer to the earth. Negative numbers move the camera further from the earth.
Returns

public static CameraUpdate zoomIn ()

Returns a CameraUpdate object set to zoom the camera in one level (+1).

Returns
  • A new CameraUpdate object.

public static CameraUpdate zoomOut ()

Returns a CameraUpdate object set to zoom the camera out one level (-1).

Returns
  • A new CameraUpdate object.

public static CameraUpdate zoomTo (float zoom)

Returns a CameraUpdate object set to zoom the camera to the specified level.

When setting the zoom level, smaller numbers move the camera further from the earth. Larger numbers move the camera closer to the earth.

Parameters
zoom The desired zoom level, in the range of 2.0 to 21.0. Values outside this range are clamped to the range.
Returns