Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit f6bfa07

Browse files
committed
[core] Trigger repaint on source changes
1 parent 505999a commit f6bfa07

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/mbgl/style/sources/geojson_source.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <mbgl/style/sources/geojson_source.hpp>
22
#include <mbgl/style/sources/geojson_source_impl.hpp>
3+
#include <mbgl/style/source_observer.hpp>
34

45
namespace mbgl {
56
namespace style {
@@ -16,6 +17,7 @@ void GeoJSONSource::setURL(const std::string& url) {
1617

1718
void GeoJSONSource::setGeoJSON(const mapbox::geojson::geojson& geoJSON) {
1819
impl->setGeoJSON(geoJSON);
20+
impl->observer->onSourceChanged(*this);
1921
}
2022

2123
optional<std::string> GeoJSONSource::getURL() const {

src/mbgl/style/style.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,7 @@ void Style::onSourceLoaded(Source& source) {
725725

726726
void Style::onSourceChanged(Source& source) {
727727
observer->onSourceChanged(source);
728+
observer->onUpdate(Update::Repaint);
728729
}
729730

730731
void Style::onSourceError(Source& source, std::exception_ptr error) {

0 commit comments

Comments
 (0)