com.sygic.sdk.map.Camera Class Reference

Classes

interface  CameraListener
 
class  CameraModel
 
interface  ModeChangedListener
 
interface  MovementMode
 
interface  PositionChangedListener
 
interface  RotationMode
 

Public Member Functions

boolean isValid ()
 
void setPosition (final @NonNull GeoCoordinates position, final @NonNull MapAnimation animation)
 
GeoCoordinates getPosition ()
 
GeoBoundingBox getMapRectangle ()
 
void setMapRectangle (final @NonNull MapRectangle rectangle)
 
void setMapRectangle (final @NonNull MapRectangle rectangle, final @NonNull MapAnimation animation)
 
void setZoomLevel (@FloatRange(from=0.0, to=Float.MAX_VALUE) final float zoomLevel, final @NonNull MapAnimation animation)
 
float getZoomLevel ()
 
Pair< Float, Float > getMinMaxZoomLevel ()
 
void zoomBy (final float scale, final @NonNull PointF focus, final @NonNull MapAnimation animation)
 
void drag (final float xFrom, final float yFrom, final float xTo, final float yTo, final MapAnimation animation)
 
void dragBy (final float x, final float y, final MapAnimation animation)
 
void tiltBy (final float angle, final MapAnimation animation)
 
void rotateBy (final float angle, final @NonNull PointF focus, final @NonNull MapAnimation animation)
 
void setRotation (@FloatRange(from=-180.0, to=180.0) final float rotation, final @NonNull MapAnimation animation)
 
float getRotation ()
 
void setTilt (final float tilt, final @NonNull MapAnimation animation)
 
float getTilt ()
 
void setCameraRotationMode (@Camera.RotationMode int mode)
 
.RotationMode int getCameraRotationMode ()
 
void setCameraMovementMode (@Camera.MovementMode int mode)
 
.MovementMode int getCameraMovementMode ()
 
void setMapCenterSettings (@NonNull final MapCenterSettings settings, final @NonNull MapAnimation initialAnim)
 
MapCenter getMapCenter ()
 
MapCenterSettings getMapCenterSettings ()
 
void setMapPadding (final @NonNull RectF padding, final @NonNull MapAnimation anim)
 
RectF getMapPadding ()
 
void setLocalTranslation (final @NonNull Point3F point, final @NonNull MapAnimation anim)
 
Point3F getLocalTranslation ()
 
void setLocalRotation (final @NonNull Point3F point, final @NonNull MapAnimation anim)
 
Point3F getLocalRotation ()
 

Detailed Description

Represents a composite class comprised of tilt, orientation, zoom level and center point for a Map.

Member Function Documentation

void com.sygic.sdk.map.Camera.drag ( final float  xFrom,
final float  yFrom,
final float  xTo,
final float  yTo,
final MapAnimation  animation 
)
void com.sygic.sdk.map.Camera.dragBy ( final float  x,
final float  y,
final MapAnimation  animation 
)
.MovementMode int com.sygic.sdk.map.Camera.getCameraMovementMode ( )

Returns mode how camera should move when the vehicle is moving - if it is following the vehicle or not.

Returns
Camera.MovementMode
.RotationMode int com.sygic.sdk.map.Camera.getCameraRotationMode ( )

Returns mode how the camera rotation should behave when the vehicle is moving.

Returns
Camera.RotationMode
Point3F com.sygic.sdk.map.Camera.getLocalRotation ( )
Point3F com.sygic.sdk.map.Camera.getLocalTranslation ( )
MapCenter com.sygic.sdk.map.Camera.getMapCenter ( )

Return the point of map on the screen which will be recognized as map center for rotation and vehicle position

Returns
Pair of x and y position on screen from range 0 - 1
MapCenterSettings com.sygic.sdk.map.Camera.getMapCenterSettings ( )

Return the point of map on the screen which will be recognized as map center for rotation and vehicle position

Returns
Pair of x and y position on screen from range 0 - 1
RectF com.sygic.sdk.map.Camera.getMapPadding ( )

Return current map padding

GeoBoundingBox com.sygic.sdk.map.Camera.getMapRectangle ( )
Pair<Float, Float> com.sygic.sdk.map.Camera.getMinMaxZoomLevel ( )

Returns the minimum a maximum value of zoom levels

Returns
The minimum a maximum value of zoom levels
GeoCoordinates com.sygic.sdk.map.Camera.getPosition ( )

Return camera GeoCoordinates on the map.

float com.sygic.sdk.map.Camera.getRotation ( )

Return the rotation of map in degrees. By default,the map is oriented with north toward the top of the map (0 degrees). As the orientation angle increases,the map rotates counter-clockwise so that at 90 degrees.

Returns
Rotation in degrees
float com.sygic.sdk.map.Camera.getTilt ( )

Returns the tilt of map in degrees. The tilt controls the perspective at which the map is viewed. A value of 0 degrees corresponds to looking straight down at the map from above (2D). As the tilt value is increased,the view shifts to a 3D perspective.

The tilt of the map may be further constrained at some zoom levels. For example,no tilt is allowed at the lowest zoom levels when the globe is visible. This is to provide a better user experience when interacting with globe,since viewing a "tilted" globe does give any benefit.

Returns
Tilt in degrees
float com.sygic.sdk.map.Camera.getZoomLevel ( )

Returns the zoom value from range (0 - 20.0) with an animation. The zoom level determines how "close" the map view is to the surface of the Earth. Higher zoom levels give a closer view. Zoom level values must be in the range returned by getMinMaxZoomLevel() Zom level: 0 - world, 10 - city, 15 - street, 20 - buildings

Returns
The zoom value
boolean com.sygic.sdk.map.Camera.isValid ( )

Check if the camera object is valid. It is invalidated after MapFragment is destroyed. When invalid, all setters do nothing and all getters return 0, null or invalid object.

Returns
true, if valid
void com.sygic.sdk.map.Camera.rotateBy ( final float  angle,
final @NonNull PointF  focus,
final @NonNull MapAnimation  animation 
)
void com.sygic.sdk.map.Camera.setCameraMovementMode ( @Camera.MovementMode int  mode)

Sets how camera should move when the vehicle is moving - ff is following vehicle or not.

Parameters
modeCamera.MovementMode
void com.sygic.sdk.map.Camera.setCameraRotationMode ( @Camera.RotationMode int  mode)

Sets how the camera rotation should behave when the vehicle is moving.

Parameters
modeCamera.RotationMode
void com.sygic.sdk.map.Camera.setLocalRotation ( final @NonNull Point3F  point,
final @NonNull MapAnimation  anim 
)
void com.sygic.sdk.map.Camera.setLocalTranslation ( final @NonNull Point3F  point,
final @NonNull MapAnimation  anim 
)
void com.sygic.sdk.map.Camera.setMapCenterSettings ( @NonNull final MapCenterSettings  settings,
final @NonNull MapAnimation  initialAnim 
)

Sets the map center (point for rotation axis and vehicle position) for locked and unlocked map state.

void com.sygic.sdk.map.Camera.setMapPadding ( final @NonNull RectF  padding,
final @NonNull MapAnimation  anim 
)

Sets the padding of the map from left, top, right and bottom.

Parameters
paddingvalues for padding in pixels
animMapAnimation
void com.sygic.sdk.map.Camera.setMapRectangle ( final @NonNull MapRectangle  rectangle)

Sets the position to rectangle on map specified by MapRectangle rectangle with margin.

Parameters
rectangleRectangle with margins to be zoomed to
void com.sygic.sdk.map.Camera.setMapRectangle ( final @NonNull MapRectangle  rectangle,
final @NonNull MapAnimation  animation 
)

Sets the position to rectangle on map specified by MapRectangle rectangle with margin.

Parameters
rectangleRectangle with margins to be zoomed to
animationMapAnimation
void com.sygic.sdk.map.Camera.setPosition ( final @NonNull GeoCoordinates  position,
final @NonNull MapAnimation  animation 
)

Move camera to given position GeoCoordinates on the map with an animation.

Parameters
positionPosition on map to move on
animationMapAnimation
void com.sygic.sdk.map.Camera.setRotation ( @FloatRange(from=-180.0, to=180.0) final float  rotation,
final @NonNull MapAnimation  animation 
)

Sets the rotation of map in degrees. By default,the map is oriented with north toward the top of the map (0 degrees). As the orientation angle increases,the map rotates counter-clockwise so that at 90 degrees.

Parameters
rotationRotation in degrees
animationMapAnimation
void com.sygic.sdk.map.Camera.setTilt ( final float  tilt,
final @NonNull MapAnimation  animation 
)

Sets the tilt of map in degrees with an animation. The tilt controls the perspective at which the map is viewed. A value of 0 degrees corresponds to looking straight down at the map from above (2D). As the tilt value is increased,the view shifts to a 3D perspective.

The tilt of the map may be further constrained at some zoom levels. For example,no tilt is allowed at the lowest zoom levels when the globe is visible. This is to provide a better user experience when interacting with globe,since viewing a "tilted" globe does give any benefit.

Parameters
tiltTilt in degrees
animationMapAnimation
void com.sygic.sdk.map.Camera.setZoomLevel ( @FloatRange(from=0.0, to=Float.MAX_VALUE) final float  zoomLevel,
final @NonNull MapAnimation  animation 
)

Sets the zoom value from range (0 - 20.0). The zoom level determines how "close" the map view is to the surface of the Earth. Higher zoom levels give a closer view. Zoom level values must be in the range returned by getMinMaxZoomLevel() Zom level: 0 - world, 10 - city, 15 - street, 20 - buildings

Parameters
zoomLevelZoom level value
animationMapAnimation
void com.sygic.sdk.map.Camera.tiltBy ( final float  angle,
final MapAnimation  animation 
)
void com.sygic.sdk.map.Camera.zoomBy ( final float  scale,
final @NonNull PointF  focus,
final @NonNull MapAnimation  animation 
)

The documentation for this class was generated from the following file: