[core] Trigger repaint on source changes

This commit is contained in:
John Firebaugh
2017-06-19 12:26:58 -07:00
parent 505999a52d
commit f6bfa078af
2 changed files with 3 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
#include <mbgl/style/sources/geojson_source.hpp>
#include <mbgl/style/sources/geojson_source_impl.hpp>
#include <mbgl/style/source_observer.hpp>
namespace mbgl {
namespace style {
@@ -16,6 +17,7 @@ void GeoJSONSource::setURL(const std::string& url) {
void GeoJSONSource::setGeoJSON(const mapbox::geojson::geojson& geoJSON) {
impl->setGeoJSON(geoJSON);
impl->observer->onSourceChanged(*this);
}
optional<std::string> GeoJSONSource::getURL() const {

View File

@@ -725,6 +725,7 @@ void Style::onSourceLoaded(Source& source) {
void Style::onSourceChanged(Source& source) {
observer->onSourceChanged(source);
observer->onUpdate(Update::Repaint);
}
void Style::onSourceError(Source& source, std::exception_ptr error) {