summaryrefslogtreecommitdiff
path: root/include/mbgl/map/map_options.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/map/map_options.hpp')
-rw-r--r--include/mbgl/map/map_options.hpp71
1 files changed, 37 insertions, 34 deletions
diff --git a/include/mbgl/map/map_options.hpp b/include/mbgl/map/map_options.hpp
index 13772332a8..fcb8c8f32f 100644
--- a/include/mbgl/map/map_options.hpp
+++ b/include/mbgl/map/map_options.hpp
@@ -1,16 +1,17 @@
#pragma once
#include <mbgl/map/mode.hpp>
+#include <mbgl/util/geo.hpp>
+#include <mbgl/util/size.hpp>
#include <memory>
-#include <string>
namespace mbgl {
/**
* @brief Holds values for Map options.
*/
-class MapOptions {
+class MapOptions final {
public:
/**
* @brief Constructs a MapOptions object with default values.
@@ -18,13 +19,15 @@ public:
MapOptions();
~MapOptions();
+ MapOptions(MapOptions&&) noexcept;
+
/**
* @brief 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.
*
* @param mode Map rendering mode.
- * @return reference to MapOptions for chaining options together.
+ * @return MapOptions for chaining options together.
*/
MapOptions& withMapMode(MapMode mode);
@@ -41,7 +44,7 @@ public:
* HeightOnly.
*
* @param mode Map constrain mode.
- * @return reference to MapOptions for chaining options together.
+ * @return MapOptions for chaining options together.
*/
MapOptions& withConstrainMode(ConstrainMode mode);
@@ -57,7 +60,7 @@ public:
* orientation of the map as some devices may use inverted orientation.
*
* @param mode Viewport mode.
- * @return reference to MapOptions for chaining options together.
+ * @return MapOptions for chaining options together.
*/
MapOptions& withViewportMode(ViewportMode mode);
@@ -69,71 +72,71 @@ public:
ViewportMode viewportMode() const;
/**
- * @brief Sets the cache path.
+ * @brief Specify whether to enable cross-source symbol collision detection
+ * or not. By default, it is set to true.
*
- * @param path Cache path.
- * @return reference to MapOptions for chaining options together.
+ * @param enableCollisions true to enable, false to disable
+ * @return MapOptions for chaining options together.
*/
- MapOptions& withCachePath(std::string path);
+ MapOptions& withCrossSourceCollisions(bool enableCollisions);
/**
- * @brief Gets the previously set (or default) cache path.
+ * @brief Gets the previously set (or default) crossSourceCollisions value.
*
- * @return cache path
+ * @return true if ecross-source symbol collision detection enabled,
+ * false otherwise.
*/
- const std::string& cachePath() const;
+ bool crossSourceCollisions() const;
/**
- * @brief Sets the asset path, which is the root directory from where
- * the asset:// scheme gets resolved in a style.
+ * @brief Sets the orientation of the Map. By default, it is set to
+ * Upwards.
*
- * @param path Asset path.
+ * @param orientation Orientation of the Map.
* @return reference to MapOptions for chaining options together.
*/
- MapOptions& withAssetRoot(std::string path);
+ MapOptions& withNorthOrientation(NorthOrientation orientation);
/**
- * @brief Gets the previously set (or default) asset path.
+ * @brief Gets the previously set (or default) orientation.
*
- * @return asset path
+ * @return Map orientation.
*/
- const std::string& assetRoot() const;
+ NorthOrientation northOrientation() const;
/**
- * @brief Sets the maximum cache size.
+ * @brief Sets the size to resize the map object and renderer backend.
*
- * @param size Cache maximum size in bytes.
+ * @param size_ A size given in logical pixels.
* @return reference to MapOptions for chaining options together.
*/
- MapOptions& withMaximumCacheSize(uint64_t size);
+ MapOptions& withSize(Size size_);
/**
- * @brief Gets the previously set (or default) maximum allowed cache size.
+ * @brief Gets the previously set size.
*
- * @return maximum allowed cache database size in bytes.
+ * @return Size.
*/
- uint64_t maximumCacheSize() const;
+ Size size() const;
/**
- * @brief Specify whether to enable cross-source symbol collision detection
- * or not. By default, it is set to true.
+ * @brief Sets the custom pixel ratio. By default, it is set to 1.
*
- * @param enableCollisions true to enable, false to disable
+ * @param ratio Pixel ratio value.
* @return reference to MapOptions for chaining options together.
*/
- MapOptions& withCrossSourceCollisions(bool enableCollisions);
+ MapOptions& withPixelRatio(float ratio);
/**
- * @brief Gets the previously set (or default) crossSourceCollisions value.
+ * @brief Gets the previously set (or default) pixel ratio value.
*
- * @return true if ecross-source symbol collision detection enabled,
- * false otherwise.
+ * @return pixel ratio value.
*/
- bool crossSourceCollisions() const;
+ float pixelRatio() const;
private:
class Impl;
- std::shared_ptr<Impl> impl_;
+ std::unique_ptr<Impl> impl_;
};
} // namespace mbgl