[core] Include pixelRatio property in MapOptions
Move pixelRatio property from Map constructor to MapOptions.
This commit is contained in:
@@ -29,11 +29,10 @@ class AnnotationTest {
|
||||
public:
|
||||
util::RunLoop loop;
|
||||
ThreadPool threadPool { 4 };
|
||||
float pixelRatio { 1 };
|
||||
HeadlessFrontend frontend { pixelRatio, threadPool };
|
||||
HeadlessFrontend frontend { 1, threadPool };
|
||||
|
||||
MapAdapter map { frontend, MapObserver::nullObserver(), pixelRatio, std::make_shared<StubFileSource>(),
|
||||
threadPool, MapOptions().withMapMode(MapMode::Static).withSize(frontend.getSize())};
|
||||
MapAdapter map { frontend, MapObserver::nullObserver(), std::make_shared<StubFileSource>(), threadPool,
|
||||
MapOptions().withMapMode(MapMode::Static).withSize(frontend.getSize())};
|
||||
|
||||
void checkRendering(const char * name) {
|
||||
test::checkImage(std::string("test/fixtures/annotations/") + name,
|
||||
|
||||
@@ -22,11 +22,10 @@ TEST(API, RenderWithoutCallback) {
|
||||
util::RunLoop loop;
|
||||
|
||||
ThreadPool threadPool(4);
|
||||
float pixelRatio { 1 };
|
||||
HeadlessFrontend frontend { pixelRatio, threadPool };
|
||||
HeadlessFrontend frontend { 1, threadPool };
|
||||
|
||||
auto map = std::make_unique<MapAdapter>(frontend, MapObserver::nullObserver(),
|
||||
pixelRatio, std::make_shared<StubFileSource>(), threadPool,
|
||||
std::make_shared<StubFileSource>(), threadPool,
|
||||
MapOptions().withMapMode(MapMode::Static).withSize(frontend.getSize()));
|
||||
map->renderStill(nullptr);
|
||||
|
||||
|
||||
@@ -21,9 +21,8 @@ TEST(CustomGeometrySource, Grid) {
|
||||
util::RunLoop loop;
|
||||
|
||||
auto threadPool = sharedThreadPool();
|
||||
float pixelRatio { 1 };
|
||||
HeadlessFrontend frontend { pixelRatio, *threadPool };
|
||||
Map map(frontend, MapObserver::nullObserver(), pixelRatio, *threadPool,
|
||||
HeadlessFrontend frontend { 1, *threadPool };
|
||||
Map map(frontend, MapObserver::nullObserver(), *threadPool,
|
||||
MapOptions().withMapMode(MapMode::Static).withSize(frontend.getSize()),
|
||||
ResourceOptions().withCachePath(":memory:").withAssetPath("test/fixtures/api/assets"));
|
||||
map.getStyle().loadJSON(util::read_file("test/fixtures/api/water.json"));
|
||||
|
||||
@@ -91,9 +91,8 @@ TEST(CustomLayer, Basic) {
|
||||
util::RunLoop loop;
|
||||
|
||||
ThreadPool threadPool(4);
|
||||
float pixelRatio { 1 };
|
||||
HeadlessFrontend frontend { pixelRatio, threadPool };
|
||||
Map map(frontend, MapObserver::nullObserver(), pixelRatio, threadPool,
|
||||
HeadlessFrontend frontend { 1, threadPool };
|
||||
Map map(frontend, MapObserver::nullObserver(), threadPool,
|
||||
MapOptions().withMapMode(MapMode::Static).withSize(frontend.getSize()),
|
||||
ResourceOptions().withCachePath(":memory:").withAssetPath("test/fixtures/api/assets"));
|
||||
map.getStyle().loadJSON(util::read_file("test/fixtures/api/water.json"));
|
||||
|
||||
@@ -36,10 +36,9 @@ public:
|
||||
util::RunLoop loop;
|
||||
std::shared_ptr<StubFileSource> fileSource = std::make_shared<StubFileSource>();
|
||||
ThreadPool threadPool { 4 };
|
||||
float pixelRatio { 1 };
|
||||
HeadlessFrontend frontend { pixelRatio, threadPool };
|
||||
MapAdapter map { frontend, MapObserver::nullObserver(), pixelRatio, fileSource,
|
||||
threadPool, MapOptions().withMapMode(MapMode::Static).withSize(frontend.getSize())};
|
||||
HeadlessFrontend frontend { 1, threadPool };
|
||||
MapAdapter map { frontend, MapObserver::nullObserver(), fileSource, threadPool,
|
||||
MapOptions().withMapMode(MapMode::Static).withSize(frontend.getSize())};
|
||||
};
|
||||
|
||||
std::vector<Feature> getTopClusterFeature(QueryTest& test) {
|
||||
|
||||
@@ -24,11 +24,10 @@ TEST(API, RecycleMapUpdateImages) {
|
||||
util::RunLoop loop;
|
||||
|
||||
ThreadPool threadPool(4);
|
||||
float pixelRatio { 1 };
|
||||
|
||||
HeadlessFrontend frontend { pixelRatio, threadPool };
|
||||
HeadlessFrontend frontend { 1, threadPool };
|
||||
auto map = std::make_unique<MapAdapter>(frontend, MapObserver::nullObserver(),
|
||||
pixelRatio, std::make_shared<StubFileSource>(), threadPool,
|
||||
std::make_shared<StubFileSource>(), threadPool,
|
||||
MapOptions().withMapMode(MapMode::Static).withSize(frontend.getSize()));
|
||||
|
||||
EXPECT_TRUE(map);
|
||||
|
||||
Reference in New Issue
Block a user