[android][glfw][ios][macos][node][qt] split backend from mapobserver

This commit is contained in:
Ivo van Dongen
2017-06-13 10:50:16 +03:00
committed by Ivo van Dongen
parent 57351c068b
commit 39a732d7ae
10 changed files with 20 additions and 14 deletions

View File

@@ -45,7 +45,7 @@ static const char* releasedMessage() {
NodeBackend::NodeBackend()
: HeadlessBackend(sharedDisplay()) {}
void NodeBackend::onDidFailLoadingMap(std::exception_ptr error) {
void NodeMapObserver::onDidFailLoadingMap(std::exception_ptr error) {
std::rethrow_exception(error);
}
@@ -530,7 +530,7 @@ void NodeMap::Cancel(const Nan::FunctionCallbackInfo<v8::Value>& info) {
void NodeMap::cancel() {
auto style = map->getStyle().getJSON();
map = std::make_unique<mbgl::Map>(backend, mbgl::Size{ 256, 256 },
map = std::make_unique<mbgl::Map>(backend, mapObserver, mbgl::Size{ 256, 256 },
pixelRatio, *this, threadpool, mbgl::MapMode::Still);
// FIXME: Reload the style after recreating the map. We need to find
@@ -982,7 +982,9 @@ NodeMap::NodeMap(v8::Local<v8::Object> options)
->NumberValue()
: 1.0;
}()),
mapObserver(NodeMapObserver()),
map(std::make_unique<mbgl::Map>(backend,
mapObserver,
mbgl::Size{ 256, 256 },
pixelRatio,
*this,