[core] Don't upload empty buckets

This commit is contained in:
Bruno de Oliveira Abinader
2017-07-05 14:37:49 +03:00
parent 754d2f377a
commit a1ed9f8794
3 changed files with 11 additions and 3 deletions

View File

@@ -28,6 +28,9 @@ public:
Bucket() = default;
virtual ~Bucket() = default;
// Feature geometries are also used to populate the feature index.
// Obtaining these is a costly operation, so we do it only once, and
// pass-by-const-ref the geometries as a second parameter.
virtual void addFeature(const GeometryTileFeature&,
const GeometryCollection&) {};
@@ -46,7 +49,7 @@ public:
};
bool needsUpload() const {
return !uploaded;
return hasData() && !uploaded;
}
protected:

View File

@@ -69,8 +69,7 @@ void SymbolBucket::render(Painter& painter,
}
bool SymbolBucket::hasData() const {
assert(false); // Should be calling SymbolLayout::has{Text,Icon,CollisonBox}Data() instead.
return false;
return hasTextData() || hasIconData() || hasCollisionBoxData();
}
bool SymbolBucket::hasTextData() const {