diff options
author | Sudarsana Babu Nagineni <sudarsana.babu@mapbox.com> | 2019-03-26 00:00:37 +0200 |
---|---|---|
committer | Sudarsana Babu Nagineni <sudarsana.babu@mapbox.com> | 2019-03-28 16:41:15 +0200 |
commit | 1cc1d4ea08ae02c3cc9b4dd1474845456c17d1bc (patch) | |
tree | d7de92e01ef1b1bf654ff8784534e534608a352f /include | |
parent | 11afef7825d622a237fa026e45e6d61b4de94068 (diff) | |
download | qtlocation-mapboxgl-1cc1d4ea08ae02c3cc9b4dd1474845456c17d1bc.tar.gz |
[core] Add setter/getter for size property in MapOptions
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/map/map.hpp | 6 | ||||
-rw-r--r-- | include/mbgl/map/map_options.hpp | 16 |
2 files changed, 17 insertions, 5 deletions
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index 9134272ea7..822c400ddf 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&, - Size size, float pixelRatio, Scheduler&, const MapOptions&, @@ -91,16 +90,13 @@ public: void setNorthOrientation(NorthOrientation); void setConstrainMode(ConstrainMode); void setViewportMode(ViewportMode); + void setSize(Size); MapOptions getMapOptions() const; //Projection Mode void setProjectionMode(const ProjectionMode&); ProjectionMode getProjectionMode() const; - // Size - void setSize(Size); - Size getSize() const; - // Projection ScreenCoordinate pixelForLatLng(const LatLng&) const; LatLng latLngForPixel(const ScreenCoordinate&) const; diff --git a/include/mbgl/map/map_options.hpp b/include/mbgl/map/map_options.hpp index 8d5c12b96c..508d569ea5 100644 --- a/include/mbgl/map/map_options.hpp +++ b/include/mbgl/map/map_options.hpp @@ -2,6 +2,7 @@ #include <mbgl/map/mode.hpp> #include <mbgl/util/geo.hpp> +#include <mbgl/util/size.hpp> #include <memory> @@ -103,6 +104,21 @@ public: */ NorthOrientation northOrientation() const; + /** + * @brief Sets the size to resize the map object and renderer backend. + * + * @param size_ A size given in logical pixels. + * @return reference to MapOptions for chaining options together. + */ + MapOptions& withSize(Size size_); + + /** + * @brief Gets the previously set size. + * + * @return Size. + */ + Size size() const; + private: class Impl; std::unique_ptr<Impl> impl_; |