diff options
author | Sudarsana Babu Nagineni <sudarsana.babu@mapbox.com> | 2019-03-07 14:29:19 +0200 |
---|---|---|
committer | Sudarsana Babu Nagineni <sudarsana.babu@mapbox.com> | 2019-03-08 18:20:55 +0200 |
commit | 5e2b6bf636472a4464e6ab3ae0d9d01c68de041b (patch) | |
tree | d4a924f2ac4174a034448388fb65b033b801a83d /test/map | |
parent | c4115f0539be1834db40b318eb4ebb9e27d1eafb (diff) | |
download | qtlocation-mapboxgl-5e2b6bf636472a4464e6ab3ae0d9d01c68de041b.tar.gz |
[core] Add MapOptions to define properties of Map
To simplify the Map constructor, introduce MapOptions
interface to define the properties that can be set on
a Map.
Diffstat (limited to 'test/map')
-rw-r--r-- | test/map/map.test.cpp | 10 | ||||
-rw-r--r-- | test/map/prefetch.test.cpp | 4 |
2 files changed, 10 insertions, 4 deletions
diff --git a/test/map/map.test.cpp b/test/map/map.test.cpp index 3a8d05ebb2..f45c728944 100644 --- a/test/map/map.test.cpp +++ b/test/map/map.test.cpp @@ -5,6 +5,7 @@ #include <mbgl/test/fixture_log_observer.hpp> #include <mbgl/map/map.hpp> +#include <mbgl/map/map_options.hpp> #include <mbgl/gl/context.hpp> #include <mbgl/gl/headless_frontend.hpp> #include <mbgl/util/default_thread_pool.hpp> @@ -38,7 +39,8 @@ public: MapTest(float pixelRatio = 1, MapMode mode = MapMode::Static) : frontend(pixelRatio, fileSource, threadPool) - , map(frontend, observer, frontend.getSize(), pixelRatio, fileSource, threadPool, mode) { + , map(frontend, observer, frontend.getSize(), pixelRatio, + fileSource, threadPool, MapOptions().withMapMode(mode)) { } template <typename T = FileSource> @@ -47,7 +49,8 @@ public: typename std::enable_if<std::is_same<T, DefaultFileSource>::value>::type* = 0) : fileSource { cachePath, assetRoot } , frontend(pixelRatio, fileSource, threadPool) - , map(frontend, observer, frontend.getSize(), pixelRatio, fileSource, threadPool, mode) { + , map(frontend, observer, frontend.getSize(), pixelRatio, + fileSource, threadPool, MapOptions().withMapMode(mode)) { } }; @@ -694,7 +697,8 @@ TEST(Map, TEST_DISABLED_ON_CI(ContinuousRendering)) { }); }; - Map map(frontend, observer, frontend.getSize(), pixelRatio, fileSource, threadPool, MapMode::Continuous); + Map map(frontend, observer, frontend.getSize(), pixelRatio, fileSource, + threadPool, MapOptions().withMapMode(MapMode::Continuous)); map.getStyle().loadJSON(util::read_file("test/fixtures/api/water.json")); runLoop.run(); diff --git a/test/map/prefetch.test.cpp b/test/map/prefetch.test.cpp index 9e513d61cd..9b7d620739 100644 --- a/test/map/prefetch.test.cpp +++ b/test/map/prefetch.test.cpp @@ -3,6 +3,7 @@ #include <mbgl/test/stub_map_observer.hpp> #include <mbgl/map/map.hpp> +#include <mbgl/map/map_options.hpp> #include <mbgl/gl/headless_frontend.hpp> #include <mbgl/storage/default_file_source.hpp> #include <mbgl/style/style.hpp> @@ -37,7 +38,8 @@ TEST(Map, PrefetchTiles) { }; HeadlessFrontend frontend { { 512, 512 }, 1, fileSource, threadPool }; - Map map(frontend, observer, frontend.getSize(), 1, fileSource, threadPool, MapMode::Continuous); + Map map(frontend, observer, frontend.getSize(), 1, fileSource, threadPool, + MapOptions().withMapMode(MapMode::Continuous)); std::vector<int> tiles; |