public class

ViewState

extends Object
java.lang.Object
   ↳ com.carto.graphics.ViewState

Class Overview

A class containing various view parameters for a view state.

Summary

Public Methods
synchronized void delete()
boolean equals(Object obj)
Checks if this object is equal to the specified object.
float getAspectRatio()
Returns the aspect ratio of the map screen.
float getDPI()
Returns the dots per inch parameter of the screen.
float getDPToPX()
Returns a value that is used for converting display independent pixels (dp) to pixels (px).
int getFOVY()
Returns the vertical field of view angle.
float getFar()
Returns the far plane distance.
int getHeight()
Returns the height of the map screen.
float getNear()
Returns the near plane distance.
float getRotation()
Returns the camera rotation angle.
int getScreenHeight()
Returns the screen height.
int getScreenWidth()
Returns the screen width.
float getTilt()
Returns the camera tilt angle.
float getUnitToDPCoef()
Returns the conversion ratio between internal map units and screen density independent pixels (DP or DIP).
float getUnitToPXCoef()
Returns the conversion ratio between internal map units and screen pixels.
int getWidth()
Returns the width of the map screen.
float getZoom()
Returns the camera zoom level.
float getZoom0Distance()
Returns the distance between the focus and the camera position, when the zoom level is set to 0.
int hashCode()
Returns the hash value of this object.
boolean isCameraChanged()
Returns the state of the camera changed flag.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public synchronized void delete ()

public boolean equals (Object obj)

Checks if this object is equal to the specified object.

Parameters
obj The reference object.
Returns
  • True when objects are equal, false otherwise.

public float getAspectRatio ()

Returns the aspect ratio of the map screen. Equal to width / height.

Returns
  • The aspect ratio of the map screen.

public float getDPI ()

Returns the dots per inch parameter of the screen.

Returns
  • The screen DPI parameter.

public float getDPToPX ()

Returns a value that is used for converting display independent pixels (dp) to pixels (px).
This values depends on the screen density.

Returns
  • The dp to px value.

public int getFOVY ()

Returns the vertical field of view angle.

Returns
  • The vertical field of view angle in degrees.

public float getFar ()

Returns the far plane distance.

Returns
  • The far plane distance.

public int getHeight ()

Returns the height of the map screen.

Returns
  • The map screen height.

public float getNear ()

Returns the near plane distance.

Returns
  • The new plane distance.

public float getRotation ()

Returns the camera rotation angle.

Returns
  • The camera rotation angle in degrees.

public int getScreenHeight ()

Returns the screen height.

Returns
  • The current screen height.

public int getScreenWidth ()

Returns the screen width.

Returns
  • The current screen width.

public float getTilt ()

Returns the camera tilt angle.

Returns
  • The camera tilt angle in degrees.

public float getUnitToDPCoef ()

Returns the conversion ratio between internal map units and screen density independent pixels (DP or DIP).
This parameter is dependent on the zoom level, DPI and other screen parameters.

Returns
  • The conversion ratio between internal map units and screen density independent pixels.

public float getUnitToPXCoef ()

Returns the conversion ratio between internal map units and screen pixels. This parameter is dependent
on the zoom level and other screen parameters.

Returns
  • The conversion ratio between internal map units and screen pixels.

public int getWidth ()

Returns the width of the map screen.

Returns
  • The map screen width.

public float getZoom ()

Returns the camera zoom level.

Returns
  • The camera zoom level.

public float getZoom0Distance ()

Returns the distance between the focus and the camera position, when the zoom level is set to 0.
This parameter depends on the screen size, DPI, tile draw size and field of view settings.

Returns
  • The distance between focus to camera position, when zoom level = 0.

public int hashCode ()

Returns the hash value of this object.

Returns
  • The hash value of this object.

public boolean isCameraChanged ()

Returns the state of the camera changed flag.

Returns
  • True if camera has changed since the last frame.