Skip to content

Commit

Permalink
do not stop rendering if some tiles/layers of tiles are missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Nakaner committed Mar 25, 2024
1 parent 1b1ed1f commit f220e17
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
25 changes: 16 additions & 9 deletions src/mbtiles_vector_featureset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,30 @@ bool mbtiles_vector_featureset::valid() const
return vector_tile_.get() != nullptr;
}

mapnik::feature_ptr mbtiles_vector_featureset::next_feature()
{
mapnik::feature_ptr f = mapnik::feature_ptr();
if (valid()) {
f = vector_tile_->next();
}
return f;
}

mapnik::feature_ptr mbtiles_vector_featureset::next()
{
// If current tile is processed completely, go forward to the next tile.
// else step forward to the next feature
mapnik::feature_ptr f = mapnik::feature_ptr();
if (!valid())
{
return f;
}
f = vector_tile_->next();
if (f)
{
mapnik::feature_ptr f = next_feature();
if (f) {
return f;
}
while (next_tile() && open_tile() && valid())
{
return vector_tile_->next();
f = next_feature();
if (f)
{
return f;
}
}
return mapnik::feature_ptr();
}
Expand Down
1 change: 1 addition & 0 deletions src/mbtiles_vector_featureset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class mbtiles_vector_featureset : public mapnik::Featureset
virtual ~mbtiles_vector_featureset();
mapnik::feature_ptr next();
private:
mapnik::feature_ptr next_feature();
bool valid() const;
std::shared_ptr<sqlite_connection> database_;
mapnik::context_ptr context_;
Expand Down

0 comments on commit f220e17

Please sign in to comment.