java.lang.Object | |
↳ | com.carto.components.Options |
A class containing various options for rendering and map manipulation.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
synchronized void | delete() | ||||||||||
boolean |
equals(Object obj)
Checks if this object is equal to the specified object.
| ||||||||||
Color |
getAmbientLightColor()
Returns the color of the ambient light.
| ||||||||||
Bitmap |
getBackgroundBitmap()
Returns the background bitmap.
| ||||||||||
Projection |
getBaseProjection()
Returns the base projection.
| ||||||||||
Color |
getClearColor()
Returns the clear color used by the renderer before drawing anything else.
| ||||||||||
float |
getDPI()
Returns the dots per inch value.
| ||||||||||
float |
getDrawDistance()
Returns the draw distance value.
| ||||||||||
int |
getEnvelopeThreadPoolSize()
Returns the number of threads used by the envelope task pool.
| ||||||||||
int |
getFieldOfViewY()
Returns the vertial field of view angle.
| ||||||||||
ScreenPos |
getFocusPointOffset()
Returns the focus point offset (from screen center) in pixels.
| ||||||||||
Color |
getMainLightColor()
Returns the color of the main light.
| ||||||||||
MapVec |
getMainLightDirection()
Returns the direction of the main light.
| ||||||||||
MapBounds |
getPanBounds()
Returns the map panning bounds constraints.
| ||||||||||
PanningMode |
getPanningMode()
Returns the panning mode.
| ||||||||||
PivotMode |
getPivotMode()
Returns the pivot mode.
| ||||||||||
RenderProjectionMode |
getRenderProjectionMode()
Returns the render projection mode.
| ||||||||||
Color |
getSkyColor()
Returns the sky color.
| ||||||||||
int |
getTileDrawSize()
Returns the tile size used for drawing map tiles.
| ||||||||||
int |
getTileThreadPoolSize()
Returns the number of threads used by the tile task pool.
| ||||||||||
MapRange |
getTiltRange()
Returns the tilt range constraint.
| ||||||||||
float |
getWatermarkAlignmentX()
Returns the horizontal alignment of the watermark.
| ||||||||||
float |
getWatermarkAlignmentY()
Returns the vertical alignment of the watermark.
| ||||||||||
Bitmap |
getWatermarkBitmap()
Returns the watermark bitmap.
| ||||||||||
ScreenPos |
getWatermarkPadding()
Returns the padding of the watermark.
| ||||||||||
float |
getWatermarkScale()
Returns the watermark relative scale.
| ||||||||||
MapRange |
getZoomRange()
Returns the zoom range constraint.
| ||||||||||
int |
hashCode()
Returns the hash value of this object.
| ||||||||||
boolean |
isClickTypeDetection()
Returns the click type detection state.
| ||||||||||
boolean |
isKineticPan()
Returns the state of the kinetic panning flag.
| ||||||||||
boolean |
isKineticRotation()
Returns the state of the kinetic rotation flag.
| ||||||||||
boolean |
isKineticZoom()
Returns the state of kinetic zoom flag.
| ||||||||||
boolean |
isRestrictedPanning()
Returns the state of the restricted panning flag.
| ||||||||||
boolean |
isRotatable()
Returns the state of the map rotatability flag.
| ||||||||||
boolean |
isSeamlessPanning()
Returns the state of seamless horizontal panning flag.
| ||||||||||
boolean |
isTiltGestureReversed()
Returns true if tilting gesture direction is reversed (and same as with Google Maps).
| ||||||||||
boolean |
isUserInput()
Returns the state of the user input flag.
| ||||||||||
boolean |
isZoomGestures()
Returns the state of zoom gestures.
| ||||||||||
void |
setAmbientLightColor(Color color)
Sets the ambient light color.
| ||||||||||
void |
setBackgroundBitmap(Bitmap backgroundBitmap)
Sets the background bitmap.
| ||||||||||
void |
setBaseProjection(Projection baseProjection)
Sets the base projection.
| ||||||||||
void |
setClearColor(Color color)
Sets the clear color of the renderer.
| ||||||||||
void |
setClickTypeDetection(boolean enabled)
Sets the state of the click type detection flag.
| ||||||||||
void |
setDPI(float dpi)
Sets the dots per inch value.
| ||||||||||
void |
setDrawDistance(float drawDistance)
Sets a new draw distance value.
| ||||||||||
void |
setEnvelopeThreadPoolSize(int poolSize)
Sets the number of threads used by the envelope task pool.
| ||||||||||
void |
setFieldOfViewY(int fovY)
Sets the vertial field of view angle.
| ||||||||||
void |
setFocusPointOffset(ScreenPos offset)
Sets the focus point offset (from screen center) in pixels.
| ||||||||||
void |
setKineticPan(boolean enabled)
Sets the state of the kinetic panning flag.
| ||||||||||
void |
setKineticRotation(boolean enabled)
Sets the state of the kinetic rotation flag.
| ||||||||||
void |
setKineticZoom(boolean enabled)
Sets the state of the kinetic zooming flag.
| ||||||||||
void |
setMainLightColor(Color color)
Sets the color of the main light.
| ||||||||||
void |
setMainLightDirection(MapVec direction)
Sets the direction of the main light.
| ||||||||||
void |
setPanBounds(MapBounds panBounds)
Sets the map panning bounds constraints.
| ||||||||||
void |
setPanningMode(PanningMode panningMode)
Sets the panning mode.
| ||||||||||
void |
setPivotMode(PivotMode pivotMode)
Sets the pivot mode.
| ||||||||||
void |
setRenderProjectionMode(RenderProjectionMode renderProjectionMode)
Sets the render projection mode.
| ||||||||||
void |
setRestrictedPanning(boolean enabled)
Sets the restricted panning flag.
| ||||||||||
void |
setRotatable(boolean enabled)
Sets the state of the map rotatability flag.
| ||||||||||
void |
setSeamlessPanning(boolean enabled)
Sets the state of seamless horizontal panning flag.
| ||||||||||
void |
setSkyColor(Color color)
Sets the sky color.
| ||||||||||
void |
setTileDrawSize(int tileDrawSize)
Sets the tile size for drawing map tiles.
| ||||||||||
void |
setTileThreadPoolSize(int poolSize)
Sets the number of threads used by the tile task pool.
| ||||||||||
void |
setTiltGestureReversed(boolean reversed)
Sets the tilting gesture direction.
| ||||||||||
void |
setTiltRange(MapRange tiltRange)
Sets the tilt range constraint.
| ||||||||||
void |
setUserInput(boolean enabled)
Sets the state of the user input flag.
| ||||||||||
void |
setWatermarkAlignmentX(float alignmentX)
Sets the position of the watermark relative to the screen.
| ||||||||||
void |
setWatermarkAlignmentY(float alignmentY)
Sets the position of the watermark relative to the screen.
| ||||||||||
void |
setWatermarkBitmap(Bitmap watermarkBitmap)
Sets the watermark bitmap.
| ||||||||||
void |
setWatermarkPadding(ScreenPos padding)
Sets the padding between the watermark and the edge of the screen.
| ||||||||||
void |
setWatermarkScale(float scale)
Set the watermark relative scale.
| ||||||||||
void |
setZoomGestures(boolean enabled)
Sets the zoom gestures flag.
| ||||||||||
void |
setZoomRange(MapRange zoomRange)
Sets the zoom range constraint.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Checks if this object is equal to the specified object.
obj | The reference object. |
---|
Returns the color of the ambient light.
Returns the background bitmap. May be null.
Returns the clear color used by the renderer before drawing anything else.
By default, this is white. It should be set to (0, 0, 0, 0) if transparent MapView is needed.
Returns the dots per inch value.
Returns the draw distance value.
Returns the number of threads used by the envelope task pool.
Returns the vertial field of view angle.
Returns the focus point offset (from screen center) in pixels.
Returns the color of the main light.
Returns the direction of the main light.
Returns the map panning bounds constraints. Map bounds minimum and maximum points are in the base
projection's coordinate system.
Returns the render projection mode.
Returns the tile size used for drawing map tiles.
Returns the number of threads used by the tile task pool.
Returns the tilt range constraint.
Returns the horizontal alignment of the watermark.
Returns the vertical alignment of the watermark.
Returns the watermark bitmap. May be null.
Returns the padding of the watermark.
Returns the watermark relative scale.
Returns the zoom range constraint.
Returns the hash value of this object.
Returns the click type detection state.
Returns the state of the kinetic panning flag.
Returns the state of the kinetic rotation flag.
Returns the state of kinetic zoom flag.
Returns the state of the restricted panning flag.
Returns the state of the map rotatability flag.
Returns the state of seamless horizontal panning flag.
Returns true if tilting gesture direction is reversed (and same as with Google Maps).
Returns the state of the user input flag.
Returns the state of zoom gestures. Zoom gestures allow to use double click and dual click to zoom in/out of the map.
Sets the ambient light color.
Ambient light affects all lighting enabled models in the scene equally, it has no direction or location.
color | The new color for the ambient light. |
---|
Sets the background bitmap. The purpose of the background bitmap is to fill out the empty space when there's
no map data visible. The bitmap will get scaled and repeated to cover the hole visible area. If a null pointer is passed,
the background won't be drawn.
The width and height of the bitmap must be power of two (for example: 256 * 256 or 128 * 512).
It's also preferred if the bitmap was square (width == height), but this is not a requirement.
The default is "default_background.png".
backgroundBitmap | The new background bitmap. |
---|
Sets the base projection. All MapView, MapEventListener and Options methods use the coordinate system of this projection.
For example, if base projection is set to EPSG3857 then MapView::getFocusPos returns the coordinates in the EPSG3857 coordinate system,
The same applies to setter methods like MapView::setFocusPos which expect the input coordinates to be in the base projection's coordinate system.
The default is EPSG3857.
baseProjection | The new base projection. |
---|
Sets the clear color of the renderer.
color | The new clear color. |
---|
Sets the state of the click type detection flag. If set to true clicks are categorized as normal clicks, double clicks,
long clicks and dual clicks. The click type resolving take about 400ms, so for applications that do not
require this functionality, it can be turned off. The default is true.
enabled | The new state of the click type detection flag. |
---|
Sets the dots per inch value. This is calculated automatically by the SDK when the MapView is created using
the device screen parameters. The purpose of this value is to compensate for very high or low resolution devices,
so that the map remains readable.
dpi | The new dots per inch value. |
---|
Sets a new draw distance value. The higher the draw distance the more tiles can be seen, if the map is tilted.
Changing the draw distance will cause the horizon to move, which means that the if the sky bitmap is used,
the horizon may not match up anymore. Increasing this value will decrease performance and increase network traffic,
if online map is used. The default is 16.
drawDistance | The new draw distance value. |
---|
Sets the number of threads used by the envelope task pool. More threads means more envelope tasks
are executed in parallel. This might speed up the data query, but may cause performance drops. Default is 1.
poolSize | The new envelope task thread pool size. |
---|
Sets the vertial field of view angle. Larger values increase the viewable area, at the cost of performance and
additional perspective distortion. The default is 70.
fovY | The new vertical field of view angle in degrees. |
---|
Sets the focus point offset (from screen center) in pixels.
offset | The new focus point offset in pixels. |
---|
Sets the state of the kinetic panning flag. Kinetic panning allows the map to pan automatically using
the inertia of the last swipe, after the user has finished interacting with the touch screen.
Default is true.
enabled | The new state of the kinetic panning flag. |
---|
Sets the state of the kinetic rotation flag. Kinetic rotation allows the map to rotate automatically using
the inertia of the last swipe, after the user has finished interacting with the touch screen.
Default is true.
enabled | The new state of the kinetic rotation flag. |
---|
Sets the state of the kinetic zooming flag. Kinetic zooming allows the map to zoom automatically using
the inertia of the last swipe, after the user has finished interacting with the touch screen.
Default is true.
enabled | The new state of the kinetic zooming flag. |
---|
Sets the color of the main light. The main light affects all lighting enabled models
in the scene equally from a certain direction. This light can be used to simulate sun or moon light.
color | The new color for the main light. |
---|
Sets the direction of the main light. The main light affects all lighting enabled models
in the scene equally from a certain direction. This light can be used to simulate sun or moon light.
The direction is always measured based on the local tangent frame of the focus point.
direction | The new direction vector for the main light. (0,0,-1) means straight down, (-0.707,0,-0.707) means from east with a 45 degree angle. The direction vector will be normalized. |
---|
Sets the map panning bounds constraints. This will limit camera movement to the specified bounds.
The current camera position will remain unaffected, until the next time camera position changes.
Map bounds minimum and maximum points are expected to be in the base projection's coordinate system.
If the bounds are larger than the world size, they will be clamped to world bounds. The default value covers the
whole world.
panBounds | The new map bounds constraints. |
---|
Sets the panning mode. The default is PanningMode::FREE.
panningMode | The new panning mode. |
---|
Sets the pivot mode. The default is PIVOT_MODE_TOUCHPOINT
pivotMode | The new pivot mode. |
---|
Sets the render projection mode. The default is RenderProjectionMode::PLANAR.
renderProjectionMode | The new render projection mode. |
---|
Sets the restricted panning flag. If set to true, then focus point coordinates and zoom level of the map view
will be adjusted to display as little empty background as possible. The default is false.
Sets the state of the map rotatability flag. If set to false the map can't be rotated by any means. The default is true.
enabled | The new state of the map rotatability flag. |
---|
Sets the state of seamless horizontal panning flag. If set to true, the user can scroll seamlessly from
the left side of the map to the right, and the other way around. The default is true.
enabled | The new state of seamless horizontal panning flag. |
---|
Sets the sky color. The purpose of the sky bitmap is to fill out the empty space visible at low tilt angles.
color | The new sky color. If the color is transparent, sky is not rendered. |
---|
Sets the tile size for drawing map tiles. Different datasources may have different tile sizes, this option
can be used to compensate for bigger or smaller tiles than default. The default is 256.
tileDrawSize | The new tile size in density-independent pixels (dp). |
---|
Sets the number of threads used by the tile task pool. More threads means more tile tasks
are executed in parallel. This might speed up the data query, but may cause performance drops. Default is 1.
poolSize | The new tile task thread pool size. |
---|
Sets the tilting gesture direction. By default, the gesture is not reversed.
reversed | True if Google Maps compatible mode should be used. False otherwise (default). |
---|
Sets the tilt range constraint. This will limit the tilt angle of the camera to the specified range.
The current tilt angle will remain unaffected, until the next time the tilt angle changes.
The minimum tilt angle is 30 degrees and the maximum is 90 degrees. Values that are out of range will be clamped.
The default value is MapRange(30, 90).
tiltRange | The new tilt range constraint in degrees. |
---|
Sets the state of the user input flag. If set to false the user won't be able to pan the map using touch controls,
programmatic map panning using MapView methods is still possible. The default is false.
enabled | The new state of the user input flag. |
---|
Sets the position of the watermark relative to the screen. Values will be clamped to [-1, 1] range.
alignmentX | The new horizontal alignment for the watermark. -1 means the left side, 0 the center and 1 the right side. The default is 1. |
---|
Sets the position of the watermark relative to the screen. Values will be clamped to [-1, 1] range.
alignmentY | The new vertical alignment for the watermark. -1 means the bottom, 0 the center and 1 the top. The default is -1. |
---|
Sets the watermark bitmap. This is only available with enterprise licenses. The watermark will be displayed
on top of the map view in a user chosen corner. If null is passed no watermark will be displayed.
watermarkBitmap | The new watermark bitmap. |
---|
Sets the padding between the watermark and the edge of the screen.
padding | The new padding for the watermark in dp. The default is 4,4. |
---|
Set the watermark relative scale. By default, watermark size is independant of the actual watermark bitmap size.
This method can be used to change this.
scale | The new relative scale value. |
---|
Sets the zoom gestures flag. By default, zoom gestures are not enabled.
enabled | True if zoom gestured should be enabled, false otherwise. |
---|
Sets the zoom range constraint. This will limit the zoom level of the camera to the specified range.
The current zoom level will remain unaffected, until the next time the zoom level changes.
The minimum zoom value is 0 and the maximum is 24. Values that are out of range will be clamped.
The default value is MapRange(0, 24).
zoomRange | The new zoom range constraint. |
---|