summaryrefslogtreecommitdiff
path: root/test/src
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-08-13 11:30:15 -0700
committerMinh Nguyễn <mxn@1ec5.org>2016-09-26 11:37:06 -0700
commitf30765254807bedab0873a289a118906ef74b754 (patch)
tree0988f52d73931b05718642c218c8241421882eb8 /test/src
parent78af55f30a37165c960c90db9a96801effc850f6 (diff)
downloadqtlocation-mapboxgl-f30765254807bedab0873a289a118906ef74b754.tar.gz
[core] Source-driven attribution
Implemented observer callbacks so the style knows when the source’s attribution changes and the map knows when the style’s attribution changes. Also implemented a getter for a tile source’s attribution. Fixes #2723.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/mbgl/test/stub_style_observer.hpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/src/mbgl/test/stub_style_observer.hpp b/test/src/mbgl/test/stub_style_observer.hpp
index aa780121f5..7189fd8af4 100644
--- a/test/src/mbgl/test/stub_style_observer.hpp
+++ b/test/src/mbgl/test/stub_style_observer.hpp
@@ -6,7 +6,7 @@ using namespace mbgl;
using namespace mbgl::style;
/**
- * An implementation of style::Observer that forwards all methods to dynamically-settable lambas.
+ * An implementation of style::Observer that forwards all methods to dynamically-settable lambdas.
*/
class StubStyleObserver : public style::Observer {
public:
@@ -30,6 +30,10 @@ public:
if (sourceLoaded) sourceLoaded(source);
}
+ void onSourceAttributionChanged(Source& source, const std::string& attribution) override {
+ if (sourceAttributionChanged) sourceAttributionChanged(source, attribution);
+ }
+
void onSourceError(Source& source, std::exception_ptr error) override {
if (sourceError) sourceError(source, error);
}
@@ -52,6 +56,7 @@ public:
std::function<void ()> spriteLoaded;
std::function<void (std::exception_ptr)> spriteError;
std::function<void (Source&)> sourceLoaded;
+ std::function<void (Source&, std::string)> sourceAttributionChanged;
std::function<void (Source&, std::exception_ptr)> sourceError;
std::function<void (Source&, const OverscaledTileID&)> tileChanged;
std::function<void (Source&, const OverscaledTileID&, std::exception_ptr)> tileError;