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.
This commit is contained in:
Ansis Brammanis
2019-04-02 12:57:45 -04:00
committed by GitHub
parent 805b140245
commit 2455275bf4
25 changed files with 280 additions and 37 deletions

View File

@@ -171,4 +171,14 @@ void Map::Impl::jumpTo(const CameraOptions& camera) {
onUpdate();
}
void Map::Impl::onStyleImageMissing(const std::string& id, std::function<void()> done) {
if (style->getImage(id) == nullptr) {
observer.onStyleImageMissing(id);
}
done();
onUpdate();
}
} // namespace mbgl