summaryrefslogtreecommitdiff
path: root/include/mbgl
diff options
context:
space:
mode:
authorAnsis Brammanis <ansis.brammanis@gmail.com>2019-04-02 12:57:45 -0400
committerGitHub <noreply@github.com>2019-04-02 12:57:45 -0400
commit2455275bf47e1671a92eb2c1296c6b48f11f6b2e (patch)
treead027661edc899feae56ad8b50ebd208f7a36d12 /include/mbgl
parent805b1402452da74042b995d693c48ee4b79ae337 (diff)
downloadqtlocation-mapboxgl-2455275bf47e1671a92eb2c1296c6b48f11f6b2e.tar.gz
add onStyleImageMissing to allow dynamically loaded or generated images (#14253)
Also make `Style#updateImage(...)` much faster when the image doesn't change size. This can be useful for asynchronously generating images.
Diffstat (limited to 'include/mbgl')
-rw-r--r--include/mbgl/map/map_observer.hpp2
-rw-r--r--include/mbgl/renderer/renderer_observer.hpp4
2 files changed, 6 insertions, 0 deletions
diff --git a/include/mbgl/map/map_observer.hpp b/include/mbgl/map/map_observer.hpp
index 8ad9e93d0b..75e389df9f 100644
--- a/include/mbgl/map/map_observer.hpp
+++ b/include/mbgl/map/map_observer.hpp
@@ -1,6 +1,7 @@
#pragma once
#include <mbgl/style/source.hpp>
+#include <mbgl/style/image.hpp>
#include <cstdint>
#include <string>
@@ -46,6 +47,7 @@ public:
virtual void onDidFinishLoadingStyle() {}
virtual void onSourceChanged(style::Source&) {}
virtual void onDidBecomeIdle() {}
+ virtual void onStyleImageMissing(const std::string&) {}
};
} // namespace mbgl
diff --git a/include/mbgl/renderer/renderer_observer.hpp b/include/mbgl/renderer/renderer_observer.hpp
index 0a76d01ca7..1a9d3ff9bc 100644
--- a/include/mbgl/renderer/renderer_observer.hpp
+++ b/include/mbgl/renderer/renderer_observer.hpp
@@ -31,6 +31,10 @@ public:
// Final frame
virtual void onDidFinishRenderingMap() {}
+
+ // Style is missing an image
+ using StyleImageMissingCallback = std::function<void()>;
+ virtual void onStyleImageMissing(const std::string&, StyleImageMissingCallback done) { done(); }
};
} // namespace mbgl