[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.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user