adapt to still image render mode changes
https://github.com/mapbox/mapbox-gl-native/pull/1272 Some tests are hanging with no errors or log messages when map.load is passed a style but never rendered.
This commit is contained in:
@@ -94,10 +94,6 @@ NAN_METHOD(NodeMap::SetAccessToken) {
|
||||
|
||||
auto nodeMap = node::ObjectWrap::Unwrap<NodeMap>(args.Holder());
|
||||
|
||||
if (nodeMap->map.isRendering()) {
|
||||
return NanThrowError("Map object is currently in use");
|
||||
}
|
||||
|
||||
try {
|
||||
nodeMap->map.setAccessToken(std::string { *token, size_t(token.length()) });
|
||||
} catch (const std::exception &ex) {
|
||||
@@ -137,10 +133,6 @@ NAN_METHOD(NodeMap::Load) {
|
||||
|
||||
auto nodeMap = node::ObjectWrap::Unwrap<NodeMap>(args.Holder());
|
||||
|
||||
if (nodeMap->map.isRendering()) {
|
||||
return NanThrowError("Map object is currently in use");
|
||||
}
|
||||
|
||||
try {
|
||||
nodeMap->map.setStyleJSON(style, ".");
|
||||
} catch (const std::exception &ex) {
|
||||
@@ -193,10 +185,6 @@ NAN_METHOD(NodeMap::Render) {
|
||||
|
||||
auto nodeMap = node::ObjectWrap::Unwrap<NodeMap>(args.Holder());
|
||||
|
||||
if (nodeMap->map.isRendering()) {
|
||||
return NanThrowError("Map object is currently in use");
|
||||
}
|
||||
|
||||
assert(!nodeMap->callback);
|
||||
assert(!nodeMap->image);
|
||||
nodeMap->callback = std::unique_ptr<NanCallback>(new NanCallback(args[1].As<v8::Function>()));
|
||||
@@ -289,9 +277,11 @@ void NodeMap::renderFinished() {
|
||||
NodeMap::NodeMap(v8::Handle<v8::Object> source_) :
|
||||
view(sharedDisplay()),
|
||||
fs(*ObjectWrap::Unwrap<NodeFileSource>(source_)),
|
||||
map(view, fs, mbgl::Map::RenderMode::Still),
|
||||
map(view, fs),
|
||||
async(new uv_async_t) {
|
||||
|
||||
map.start(mbgl::Map::Mode::Static);
|
||||
|
||||
NanAssignPersistent(source, source_);
|
||||
|
||||
async->data = this;
|
||||
@@ -304,6 +294,8 @@ NodeMap::NodeMap(v8::Handle<v8::Object> source_) :
|
||||
}
|
||||
|
||||
NodeMap::~NodeMap() {
|
||||
map.stop();
|
||||
|
||||
source.Dispose();
|
||||
|
||||
uv_close(reinterpret_cast<uv_handle_t *>(async), [] (uv_handle_t *handle) {
|
||||
|
||||
Reference in New Issue
Block a user