Altus Mapping Engine JavaScript API Reference - v2.0.ut.2153.g60764257e - Tuesday May 16, 2022 SDK Documentation | Builds | BA3 Home
AltusUnified::Screen Class Reference

Represents the screen or window Altus renders to. More...

Public Member Functions

void setSize (uint pointWidth, uint pointHeight)
 Sets the size of the render target. More...
 
void setDeviceScale (double deviceScale)
 Sets the scaling factor used to convert points to pixels. This value is calculted automatically based on screen resolution when Altus is initialized. HiDPI (Retina) screens will often have a value of 2.0, but many other values are common. More...
 
void setTilePointSize (double tilePointSize)
 Sets the size of map tiles in points. Defaults to 256. More...
 
double getTilePointSize ()
 Retrieves the tile point size. More...
 
void setTileLevelBias (double tileBias)
 TileLevelBias is the amount the engine will attempt to force all tiles on the screen to have the same level [of detail]. If you have a raster street map and always have the camera facing straight down, a value of 1.0 will force all tiles to have a consistent level. This results in more work for the engine and increased tile counts being displayed. Sometimes this can have a drastic impact on performance at certain viewing angles and distances. This should always be set to 0.0 when possible for best performance or when angled cameras are common. More...
 
void setTileLevelBiasSmoothingEnabled (bool enabled)
 When tileLevelBias is greater than zero, setting this to true limits level bias flip-flopping with smooth camera motion. NOTE: Enabling this setting can result in potentially more tiles being loaded for virtual maps than are necessary for the current camera position. More...
 
void setDistanceScale (double tileDistanceScale)
 Used to get larger and smaller tiles based on the tile slope to the screen. The default value is 1.4. Increase this value to reduce the number of tiles, or decrease this value to increase the number of tiles. More...
 
double getDistanceScale ()
 Gets the distance scale. See SetDistanceScale. More...
 
double getDeviceScale ()
 Gets the device scale. See SetDeviceScale. More...
 
vec2i getScreenSizeInPoints ()
 Gets the screen size in points. More...
 
vec2i getScreenSizeInPixels ()
 Gets the screen size in pixels. More...
 
ScreenSpacePercentagePoint getPercentagePoint (float pointX, float pointY)
 Returns the ScreenSpacePercentagePoint of a point on the screen. The X and Y coordinates will be between 0 and 1 for a point on the screen. More...
 
vec2d getScreenPoint (ScreenSpacePercentagePoint point)
 Gets a point on the screen from a ScreenSpacePercentagePoint. More...
 
float getPixelValueFromPointValue (float pointValue)
 Convets a point value to a pixel value, using the deviceScale. See SetDeviceScale. More...
 

Detailed Description

Represents the screen or window Altus renders to.

Member Function Documentation

double AltusUnified::Screen::getDeviceScale ( )

Gets the device scale. See SetDeviceScale.

double AltusUnified::Screen::getDistanceScale ( )

Gets the distance scale. See SetDistanceScale.

ScreenSpacePercentagePoint AltusUnified::Screen::getPercentagePoint ( float  pointX,
float  pointY 
)

Returns the ScreenSpacePercentagePoint of a point on the screen. The X and Y coordinates will be between 0 and 1 for a point on the screen.

Parameters
pointXDistance in points from left edge.
pointYDistance in points from top edge.
float AltusUnified::Screen::getPixelValueFromPointValue ( float  pointValue)

Convets a point value to a pixel value, using the deviceScale. See SetDeviceScale.

vec2d AltusUnified::Screen::getScreenPoint ( ScreenSpacePercentagePoint  point)

Gets a point on the screen from a ScreenSpacePercentagePoint.

vec2i AltusUnified::Screen::getScreenSizeInPixels ( )

Gets the screen size in pixels.

vec2i AltusUnified::Screen::getScreenSizeInPoints ( )

Gets the screen size in points.

double AltusUnified::Screen::getTilePointSize ( )

Retrieves the tile point size.

void AltusUnified::Screen::setDeviceScale ( double  deviceScale)

Sets the scaling factor used to convert points to pixels. This value is calculted automatically based on screen resolution when Altus is initialized. HiDPI (Retina) screens will often have a value of 2.0, but many other values are common.

Parameters
deviceScalenew value.
void AltusUnified::Screen::setDistanceScale ( double  tileDistanceScale)

Used to get larger and smaller tiles based on the tile slope to the screen. The default value is 1.4. Increase this value to reduce the number of tiles, or decrease this value to increase the number of tiles.

void AltusUnified::Screen::setSize ( uint  pointWidth,
uint  pointHeight 
)

Sets the size of the render target.

Parameters
pointWidthWidth of screen in points.
pointHeightHeight of screen in points.
void AltusUnified::Screen::setTileLevelBias ( double  tileBias)

TileLevelBias is the amount the engine will attempt to force all tiles on the screen to have the same level [of detail]. If you have a raster street map and always have the camera facing straight down, a value of 1.0 will force all tiles to have a consistent level. This results in more work for the engine and increased tile counts being displayed. Sometimes this can have a drastic impact on performance at certain viewing angles and distances. This should always be set to 0.0 when possible for best performance or when angled cameras are common.

Parameters
tileBiasNew value (typically between 0.0 and 1.0)
void AltusUnified::Screen::setTileLevelBiasSmoothingEnabled ( bool  enabled)

When tileLevelBias is greater than zero, setting this to true limits level bias flip-flopping with smooth camera motion. NOTE: Enabling this setting can result in potentially more tiles being loaded for virtual maps than are necessary for the current camera position.

Parameters
enabledNew value.
void AltusUnified::Screen::setTilePointSize ( double  tilePointSize)

Sets the size of map tiles in points. Defaults to 256.

Parameters
tilePointSizeNew valu (typically 256).