MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
map_options.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <mbgl/map/mode.hpp>
4 #include <mbgl/util/geo.hpp>
5 #include <mbgl/util/size.hpp>
6 
7 #include <memory>
8 
9 namespace mbgl {
10 
14 class MapOptions final {
15 public:
21 
22  MapOptions(MapOptions&&) noexcept;
23 
33 
38  MapMode mapMode() const;
39 
49 
56 
65 
72 
80  MapOptions& withCrossSourceCollisions(bool enableCollisions);
81 
88  bool crossSourceCollisions() const;
89 
98 
105 
113 
119  Size size() const;
120 
127  MapOptions& withPixelRatio(float ratio);
128 
134  float pixelRatio() const;
135 
136 private:
137  class Impl;
138  std::unique_ptr<Impl> impl_;
139 };
140 
141 } // namespace mbgl
Holds values for Map options.
Definition: map_options.hpp:14
MapOptions & withPixelRatio(float ratio)
Sets the custom pixel ratio. By default, it is set to 1.
Size size() const
Gets the previously set size.
MapOptions & withConstrainMode(ConstrainMode mode)
Sets the map constrain mode. This can be used to limit the map to wrap around the globe horizontally....
ViewportMode viewportMode() const
Gets the previously set (or default) viewport mode.
MapOptions & withMapMode(MapMode mode)
Sets the map rendering mode. By default, it is set to Continuous so the map will render as data arriv...
MapOptions & withSize(Size size_)
Sets the size to resize the map object and renderer backend.
MapOptions & withCrossSourceCollisions(bool enableCollisions)
Specify whether to enable cross-source symbol collision detection or not. By default,...
ConstrainMode constrainMode() const
Gets the previously set (or default) constrain mode.
NorthOrientation northOrientation() const
Gets the previously set (or default) orientation.
MapOptions & withViewportMode(ViewportMode mode)
Sets the viewport mode. This can be used to flip the vertical orientation of the map as some devices ...
MapOptions & withNorthOrientation(NorthOrientation orientation)
Sets the orientation of the Map. By default, it is set to Upwards.
float pixelRatio() const
Gets the previously set (or default) pixel ratio value.
bool crossSourceCollisions() const
Gets the previously set (or default) crossSourceCollisions value.
MapOptions()
Constructs a MapOptions object with default values.
MapOptions(MapOptions &&) noexcept
MapMode mapMode() const
Gets the previously set (or default) map mode.
Definition: actor.hpp:15
MapMode
Definition: mode.hpp:16
ViewportMode
Definition: mode.hpp:32
NorthOrientation
Definition: geo.hpp:179
ConstrainMode
Definition: mode.hpp:24
Definition: tile_id.hpp:256