Package com.navmii.sdk.map
Class CameraPosition.Builder
- java.lang.Object
-
- com.navmii.sdk.map.CameraPosition.Builder
-
- Enclosing class:
- CameraPosition
public static final class CameraPosition.Builder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
Creates a default instance of the Builder.Builder(CameraPosition cameraPosition)
Creates an instance of the Builder initialized with the values from the specified camera position.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CameraPosition
build()
CameraPosition.Builder
setHeading(float heading)
Sets the heading of the camera in degrees when the tilt is greater than 0.CameraPosition.Builder
setTargetLocation(MapCoordinates targetLocation)
Sets the coordinates of the location at which the camera is pointing.CameraPosition.Builder
setTilt(float tilt)
Sets the tilt of the map relative to the camera.CameraPosition.Builder
setZoom(float zoom)
Sets the zoom of the camera.
-
-
-
Constructor Detail
-
Builder
public Builder()
Creates a default instance of the Builder.If you pass the position returned from the
build()
method toMapView.CameraController
without calling any of the setters, the camera position will remain unchanged.
-
Builder
public Builder(CameraPosition cameraPosition)
Creates an instance of the Builder initialized with the values from the specified camera position.If you want to keep some of the values unchanged, pass the special values listed below to the corresponding setters.
-
-
Method Detail
-
setTargetLocation
public CameraPosition.Builder setTargetLocation(MapCoordinates targetLocation)
Sets the coordinates of the location at which the camera is pointing. This location is placed in the center of theMapView
.Note: use
CameraPosition.KEEP_TARGET_LOCATION_UNCHANGED
to keep the current location.- Parameters:
targetLocation
- The target location.- Returns:
- The builder.
-
setHeading
public CameraPosition.Builder setHeading(float heading)
Sets the heading of the camera in degrees when the tilt is greater than 0. When the heading is 0 the camera's heading is North. In case of planar representation of the map (map tilt is 0) it defines the rotation of the map in degrees relative to North.Note: use
CameraPosition.KEEP_HEADING_UNCHANGED
to keep the current heading.- Parameters:
heading
- The heading.- Returns:
- The builder.
-
setTilt
public CameraPosition.Builder setTilt(float tilt)
Sets the tilt of the map relative to the camera. When the tilt is 0, the camera points straight down the map showing it.Note: use
CameraPosition.KEEP_TILT_UNCHANGED
to keep the current tilt.- Parameters:
tilt
- The tilt.- Returns:
- The builder.
-
setZoom
public CameraPosition.Builder setZoom(float zoom)
Sets the zoom of the camera. The greater the value the less geo area fits the map view.Note: use
CameraPosition.KEEP_ZOOM_UNCHANGED
to keep the current zoom.- Parameters:
zoom
- The zoom level.- Returns:
- The builder.
- See Also:
MapView.getMinZoomLevel()
,MapView.getMaxZoomLevel()
-
build
public CameraPosition build()
- Returns:
- An instance of the CameraPosition.
-
-