From 7af00a404f22742fed4a83e9a36d023d7515025f Mon Sep 17 00:00:00 2001 From: Sudarsana Babu Nagineni Date: Wed, 27 Mar 2019 19:17:04 +0200 Subject: [core] Include pixelRatio property in MapOptions Move pixelRatio property from Map constructor to MapOptions. --- include/mbgl/map/map.hpp | 1 - include/mbgl/map/map_options.hpp | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index 822c400ddf..2fdd72dcb8 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -34,7 +34,6 @@ class Map : private util::noncopyable { public: explicit Map(RendererFrontend&, MapObserver&, - float pixelRatio, Scheduler&, const MapOptions&, const ResourceOptions&); diff --git a/include/mbgl/map/map_options.hpp b/include/mbgl/map/map_options.hpp index 508d569ea5..fcb8c8f32f 100644 --- a/include/mbgl/map/map_options.hpp +++ b/include/mbgl/map/map_options.hpp @@ -119,6 +119,21 @@ public: */ Size size() const; + /** + * @brief Sets the custom pixel ratio. By default, it is set to 1. + * + * @param ratio Pixel ratio value. + * @return reference to MapOptions for chaining options together. + */ + MapOptions& withPixelRatio(float ratio); + + /** + * @brief Gets the previously set (or default) pixel ratio value. + * + * @return pixel ratio value. + */ + float pixelRatio() const; + private: class Impl; std::unique_ptr impl_; -- cgit v1.2.1