Add callback for error notifications on renderStill()
The callback will be called when any of the resources requested from the network failed to load. There is not recovery implemented yet, so the closest thing to reseting the Map object and reloading all the resources would be setting a new style.
This commit is contained in:
@@ -28,7 +28,7 @@ TEST(API, RepeatedRender) {
|
||||
map.resize(128, 512, 1);
|
||||
map.setStyleJSON(style, "test/suite");
|
||||
std::promise<std::unique_ptr<const StillImage>> promise;
|
||||
map.renderStill([&promise](std::unique_ptr<const StillImage> image) {
|
||||
map.renderStill([&promise](std::exception_ptr, std::unique_ptr<const StillImage> image) {
|
||||
promise.set_value(std::move(image));
|
||||
});
|
||||
auto result = promise.get_future().get();
|
||||
@@ -42,7 +42,7 @@ TEST(API, RepeatedRender) {
|
||||
map.resize(512, 512, 2);
|
||||
map.setStyleJSON(style, "TEST_DATA/suite");
|
||||
std::promise<std::unique_ptr<const StillImage>> promise;
|
||||
map.renderStill([&promise](std::unique_ptr<const StillImage> image) {
|
||||
map.renderStill([&promise](std::exception_ptr, std::unique_ptr<const StillImage> image) {
|
||||
promise.set_value(std::move(image));
|
||||
});
|
||||
auto result = promise.get_future().get();
|
||||
|
||||
Reference in New Issue
Block a user