[core] geojson source - clear cache when json content is set

This commit is contained in:
Ivo van Dongen
2016-10-25 13:58:25 +02:00
committed by Ivo van Dongen
parent b0485bccd9
commit 6277dca898
2 changed files with 3 additions and 1 deletions

View File

@@ -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

View File

@@ -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;