saving current state
This commit is contained in:
@@ -9,7 +9,10 @@ VectorTileData::VectorTileData(Tile::ID id, Map &map, const std::string url)
|
||||
}
|
||||
|
||||
VectorTileData::~VectorTileData() {
|
||||
map.getGlyphAtlas()->removeGlyphs(id.to_uint64());
|
||||
std::shared_ptr<GlyphAtlas> glyphAtlas = map.getGlyphAtlas();
|
||||
if (glyphAtlas) {
|
||||
glyphAtlas->removeGlyphs(id.to_uint64());
|
||||
}
|
||||
}
|
||||
|
||||
void VectorTileData::beforeParse() {
|
||||
@@ -43,22 +46,23 @@ void VectorTileData::afterParse() {
|
||||
parser.reset();
|
||||
}
|
||||
|
||||
void VectorTileData::render(Painter &painter, const LayerDescription& layer_desc) {
|
||||
auto databucket_it = buckets.find(layer_desc.bucket_name);
|
||||
if (databucket_it != buckets.end()) {
|
||||
assert(databucket_it->second);
|
||||
databucket_it->second->render(painter, layer_desc.name, id);
|
||||
void VectorTileData::render(Painter &painter, std::shared_ptr<StyleLayer> layer_desc) {
|
||||
if (state == State::parsed && layer_desc->bucket) {
|
||||
auto databucket_it = buckets.find(layer_desc->bucket->name);
|
||||
if (databucket_it != buckets.end()) {
|
||||
assert(databucket_it->second);
|
||||
databucket_it->second->render(painter, layer_desc, id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool VectorTileData::hasData(const LayerDescription& layer_desc) const {
|
||||
if (state != State::parsed) return false;
|
||||
|
||||
auto databucket_it = buckets.find(layer_desc.bucket_name);
|
||||
if (databucket_it != buckets.end()) {
|
||||
assert(databucket_it->second);
|
||||
return databucket_it->second->hasData();
|
||||
} else {
|
||||
return false;
|
||||
bool VectorTileData::hasData(std::shared_ptr<StyleLayer> layer_desc) const {
|
||||
if (state == State::parsed && layer_desc->bucket) {
|
||||
auto databucket_it = buckets.find(layer_desc->bucket->name);
|
||||
if (databucket_it != buckets.end()) {
|
||||
assert(databucket_it->second);
|
||||
return databucket_it->second->hasData();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user