summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvo van Dongen <info@ivovandongen.nl>2016-10-25 13:58:25 +0200
committerIvo van Dongen <ivovandongen@users.noreply.github.com>2016-10-25 16:11:36 +0200
commit6277dca8985156e313004464337c02128e13cae7 (patch)
treeeface3bd88d2b8d32f69035f43aea4d0d44b9e0f
parentb0485bccd9ddc5d6a3589c433cd1f3a103f857ea (diff)
downloadqtlocation-mapboxgl-6277dca8985156e313004464337c02128e13cae7.tar.gz
[core] geojson source - clear cache when json content is set
-rw-r--r--src/mbgl/style/source_impl.hpp2
-rw-r--r--src/mbgl/style/sources/geojson_source_impl.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/mbgl/style/source_impl.hpp b/src/mbgl/style/source_impl.hpp
index 608a552835..14ed9cd01c 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<OverscaledTileID, std::unique_ptr<Tile>> tiles;
+ TileCache cache;
private:
// TileObserver implementation.
@@ -97,7 +98,6 @@ private:
virtual std::unique_ptr<Tile> createTile(const OverscaledTileID&, const UpdateParameters&) = 0;
std::map<UnwrappedTileID, RenderTile> 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 0406cb22e5..f9dfcfb310 100644
--- a/src/mbgl/style/sources/geojson_source_impl.cpp
+++ b/src/mbgl/style/sources/geojson_source_impl.cpp
@@ -54,6 +54,8 @@ optional<std::string> 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;