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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user