From 6277dca8985156e313004464337c02128e13cae7 Mon Sep 17 00:00:00 2001 From: Ivo van Dongen Date: Tue, 25 Oct 2016 13:58:25 +0200 Subject: [PATCH] [core] geojson source - clear cache when json content is set --- src/mbgl/style/source_impl.hpp | 2 +- src/mbgl/style/sources/geojson_source_impl.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mbgl/style/source_impl.hpp b/src/mbgl/style/source_impl.hpp index 608a55283..14ed9cd01 100644 --- a/src/mbgl/style/source_impl.hpp +++ b/src/mbgl/style/source_impl.hpp @@ -86,6 +86,7 @@ protected: Source& base; SourceObserver* observer = nullptr; std::map> tiles; + TileCache cache; private: // TileObserver implementation. @@ -97,7 +98,6 @@ private: virtual std::unique_ptr createTile(const OverscaledTileID&, const UpdateParameters&) = 0; std::map renderTiles; - TileCache cache; }; } // namespace style diff --git a/src/mbgl/style/sources/geojson_source_impl.cpp b/src/mbgl/style/sources/geojson_source_impl.cpp index 0406cb22e..f9dfcfb31 100644 --- a/src/mbgl/style/sources/geojson_source_impl.cpp +++ b/src/mbgl/style/sources/geojson_source_impl.cpp @@ -54,6 +54,8 @@ optional GeoJSONSource::Impl::getURL() { void GeoJSONSource::Impl::setGeoJSON(const GeoJSON& geoJSON) { double scale = util::EXTENT / util::tileSize; + cache.clear(); + if (!options.cluster) { mapbox::geojsonvt::Options vtOptions; vtOptions.maxZoom = options.maxzoom;