[core] Add setter/getter for size property in MapOptions

This commit is contained in:
Sudarsana Babu Nagineni
2019-03-26 00:00:37 +02:00
parent 11afef7825
commit 1cc1d4ea08
28 changed files with 102 additions and 85 deletions

View File

@@ -631,8 +631,10 @@ void NodeMap::cancel() {
});
frontend = std::make_unique<mbgl::HeadlessFrontend>(mbgl::Size{ 256, 256 }, pixelRatio, threadpool);
map = std::make_unique<mbgl::Map>(*frontend, mapObserver, frontend->getSize(), pixelRatio, threadpool,
mbgl::MapOptions().withMapMode(mode).withCrossSourceCollisions(crossSourceCollisions),
map = std::make_unique<mbgl::Map>(*frontend, mapObserver, pixelRatio, threadpool,
mbgl::MapOptions().withSize(frontend->getSize())
.withMapMode(mode)
.withCrossSourceCollisions(crossSourceCollisions),
mbgl::ResourceOptions().withPlatformContext(reinterpret_cast<void*>(this)));
// FIXME: Reload the style after recreating the map. We need to find
@@ -1212,8 +1214,10 @@ NodeMap::NodeMap(v8::Local<v8::Object> options)
}())
, mapObserver(NodeMapObserver())
, frontend(std::make_unique<mbgl::HeadlessFrontend>(mbgl::Size { 256, 256 }, pixelRatio, threadpool))
, map(std::make_unique<mbgl::Map>(*frontend, mapObserver, frontend->getSize(), pixelRatio, threadpool,
mbgl::MapOptions().withMapMode(mode).withCrossSourceCollisions(crossSourceCollisions),
, map(std::make_unique<mbgl::Map>(*frontend, mapObserver, pixelRatio, threadpool,
mbgl::MapOptions().withSize(frontend->getSize())
.withMapMode(mode)
.withCrossSourceCollisions(crossSourceCollisions),
mbgl::ResourceOptions().withPlatformContext(reinterpret_cast<void*>(this))))
, async(new uv_async_t) {
async->data = this;