public interface

MapCamera

com.neomades.maps.camera.MapCamera

Class Overview

Represents the camera looking at the map.

An object of this type can be used to modify a map's camera by calling animate(MapCameraUpdate), animate(MapCameraUpdate, int) or move(MapCameraUpdate).

Summary

Public Methods
abstract void animate(MapCameraUpdate update)
Animates the movement of the camera from the current position to the position defined in the update and calls an optional callback on completion.
abstract void animate(MapCameraUpdate update, int durationMs)
Animates the movement of the camera from the current position to the position defined in the update and calls an optional callback on completion.
abstract Location getCenterLocation()
Returns the location that the camera is pointing at.
abstract float getMaxZoomLevel()
Returns the maximum zoom level.
abstract float getMinZoomLevel()
Returns the minimum zoom level.
abstract float getZoomLevel()
Returns the current zoom level for the current camera position.
abstract void move(MapCameraUpdate update)
Repositions the camera according to the instructions defined in the update.
abstract void setCameraChangeListener(MapCameraChangeListener listener)
Sets a callback that is invoked when the camera changes.
abstract void stopAnimation()
Stops the camera animation if there is one in progress.
abstract void takeSnapshot(MapSnapshotListener callback)
Takes a snapshot of the map.

Public Methods

public abstract void animate (MapCameraUpdate update)

Animates the movement of the camera from the current position to the position defined in the update and calls an optional callback on completion.

During the animation, a call to getCenterLocation() returns an intermediate location of the camera.

Parameters
update The change that should be applied to the camera.

public abstract void animate (MapCameraUpdate update, int durationMs)

Animates the movement of the camera from the current position to the position defined in the update and calls an optional callback on completion.

During the animation, a call to getCenterLocation() returns an intermediate location of the camera.

Parameters
update The change that should be applied to the camera.
durationMs The duration of the animation in milliseconds. This must be strictly positive, otherwise an IllegalArgumentException will be thrown.

public abstract Location getCenterLocation ()

Returns the location that the camera is pointing at.

Returns
  • The location that the camera is pointing at.

public abstract float getMaxZoomLevel ()

Returns the maximum zoom level.

Returns
  • The maximum zoom level available.

public abstract float getMinZoomLevel ()

Returns the minimum zoom level.

Returns
  • The minimum zoom level available.

public abstract float getZoomLevel ()

Returns the current zoom level for the current camera position.

Returns
  • The current zoom level.

public abstract void move (MapCameraUpdate update)

Repositions the camera according to the instructions defined in the update.

The move is instantaneous, and a subsequent getCenterLocation() will reflect the new position.

Parameters
update The change that should be applied to the camera.

public abstract void setCameraChangeListener (MapCameraChangeListener listener)

Sets a callback that is invoked when the camera changes.

Parameters
listener The callback that is invoked when the camera changes. To unset the callback, use null.

public abstract void stopAnimation ()

Stops the camera animation if there is one in progress. When the method is called, the camera stops moving immediately and remains in that position.

Cross Platform considerations

Supported only on the Android platform.

public abstract void takeSnapshot (MapSnapshotListener callback)

Takes a snapshot of the map.

You can use snapshots within your application when an interactive map would be difficult, or impossible, to use. For example, images produced with the takeSnapshot() method can be used to display a thumbnail of the map in your app, or a snapshot in the notification center.

Note: Images of the map must not be transmitted to your servers, or otherwise used outside of the application. If you need to send a map to another application or user, send data that allows them to reconstruct the map for the new user instead of a snapshot.

Parameters
callback Callback method invoked when the snapshot is taken.