MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mbgl::MapOptions Class Referencefinal

Holds values for Map options. More...

#include <map_options.hpp>

Public Member Functions

 MapOptions ()
 Constructs a MapOptions object with default values. More...
 
 ~MapOptions ()
 
 MapOptions (MapOptions &&) noexcept
 
MapOptionswithMapMode (MapMode mode)
 Sets the map rendering mode. By default, it is set to Continuous so the map will render as data arrives from the network and react immediately to state changes. More...
 
MapMode mapMode () const
 Gets the previously set (or default) map mode. More...
 
MapOptionswithConstrainMode (ConstrainMode mode)
 Sets the map constrain mode. This can be used to limit the map to wrap around the globe horizontally. By default, it is set to HeightOnly. More...
 
ConstrainMode constrainMode () const
 Gets the previously set (or default) constrain mode. More...
 
MapOptionswithViewportMode (ViewportMode mode)
 Sets the viewport mode. This can be used to flip the vertical orientation of the map as some devices may use inverted orientation. More...
 
ViewportMode viewportMode () const
 Gets the previously set (or default) viewport mode. More...
 
MapOptionswithCrossSourceCollisions (bool enableCollisions)
 Specify whether to enable cross-source symbol collision detection or not. By default, it is set to true. More...
 
bool crossSourceCollisions () const
 Gets the previously set (or default) crossSourceCollisions value. More...
 
MapOptionswithNorthOrientation (NorthOrientation orientation)
 Sets the orientation of the Map. By default, it is set to Upwards. More...
 
NorthOrientation northOrientation () const
 Gets the previously set (or default) orientation. More...
 
MapOptionswithSize (Size size_)
 Sets the size to resize the map object and renderer backend. More...
 
Size size () const
 Gets the previously set size. More...
 
MapOptionswithPixelRatio (float ratio)
 Sets the custom pixel ratio. By default, it is set to 1. More...
 
float pixelRatio () const
 Gets the previously set (or default) pixel ratio value. More...
 

Detailed Description

Holds values for Map options.

Definition at line 14 of file map_options.hpp.

Constructor & Destructor Documentation

◆ MapOptions() [1/2]

mbgl::MapOptions::MapOptions ( )

Constructs a MapOptions object with default values.

◆ ~MapOptions()

mbgl::MapOptions::~MapOptions ( )

◆ MapOptions() [2/2]

mbgl::MapOptions::MapOptions ( MapOptions &&  )
noexcept

Member Function Documentation

◆ constrainMode()

ConstrainMode mbgl::MapOptions::constrainMode ( ) const

Gets the previously set (or default) constrain mode.

Returns
constrain mode.

◆ crossSourceCollisions()

bool mbgl::MapOptions::crossSourceCollisions ( ) const

Gets the previously set (or default) crossSourceCollisions value.

Returns
true if ecross-source symbol collision detection enabled, false otherwise.

◆ mapMode()

MapMode mbgl::MapOptions::mapMode ( ) const

Gets the previously set (or default) map mode.

Returns
Returns a mbgl::MapMode

◆ northOrientation()

NorthOrientation mbgl::MapOptions::northOrientation ( ) const

Gets the previously set (or default) orientation.

Returns
Map orientation.

◆ pixelRatio()

float mbgl::MapOptions::pixelRatio ( ) const

Gets the previously set (or default) pixel ratio value.

Returns
pixel ratio value.

◆ size()

Size mbgl::MapOptions::size ( ) const

Gets the previously set size.

Returns
Size.

◆ viewportMode()

ViewportMode mbgl::MapOptions::viewportMode ( ) const

Gets the previously set (or default) viewport mode.

Returns
viewport mode.

◆ withConstrainMode()

MapOptions& mbgl::MapOptions::withConstrainMode ( ConstrainMode  mode)

Sets the map constrain mode. This can be used to limit the map to wrap around the globe horizontally. By default, it is set to HeightOnly.

Parameters
modeMap constrain mode.
Returns
MapOptions for chaining options together.

◆ withCrossSourceCollisions()

MapOptions& mbgl::MapOptions::withCrossSourceCollisions ( bool  enableCollisions)

Specify whether to enable cross-source symbol collision detection or not. By default, it is set to true.

Parameters
enableCollisionstrue to enable, false to disable
Returns
MapOptions for chaining options together.

◆ withMapMode()

MapOptions& mbgl::MapOptions::withMapMode ( MapMode  mode)

Sets the map rendering mode. By default, it is set to Continuous so the map will render as data arrives from the network and react immediately to state changes.

Parameters
modeMap rendering mode.
Returns
MapOptions for chaining options together.

◆ withNorthOrientation()

MapOptions& mbgl::MapOptions::withNorthOrientation ( NorthOrientation  orientation)

Sets the orientation of the Map. By default, it is set to Upwards.

Parameters
orientationOrientation of the Map.
Returns
reference to MapOptions for chaining options together.

◆ withPixelRatio()

MapOptions& mbgl::MapOptions::withPixelRatio ( float  ratio)

Sets the custom pixel ratio. By default, it is set to 1.

Parameters
ratioPixel ratio value.
Returns
reference to MapOptions for chaining options together.

◆ withSize()

MapOptions& mbgl::MapOptions::withSize ( Size  size_)

Sets the size to resize the map object and renderer backend.

Parameters
size_A size given in logical pixels.
Returns
reference to MapOptions for chaining options together.

◆ withViewportMode()

MapOptions& mbgl::MapOptions::withViewportMode ( ViewportMode  mode)

Sets the viewport mode. This can be used to flip the vertical orientation of the map as some devices may use inverted orientation.

Parameters
modeViewport mode.
Returns
MapOptions for chaining options together.

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