diff --git a/include/mbgl/map/vector_tile_data.hpp b/include/mbgl/map/vector_tile_data.hpp index d31d11499..edad22899 100644 --- a/include/mbgl/map/vector_tile_data.hpp +++ b/include/mbgl/map/vector_tile_data.hpp @@ -51,6 +51,9 @@ protected: std::unordered_map> buckets; std::unique_ptr parser; + +public: + const float depth; }; } diff --git a/src/map/tile_parser.cpp b/src/map/tile_parser.cpp index 89ca4a41f..97b071a16 100644 --- a/src/map/tile_parser.cpp +++ b/src/map/tile_parser.cpp @@ -43,7 +43,7 @@ TileParser::TileParser(const std::string &data, VectorTileData &tile, glyphStore(glyphStore), spriteAtlas(spriteAtlas), sprite(sprite), - collision(tile.id.z, 4096, tile.source.tile_size, tile.id.z >= tile.source.max_zoom ? tile.source.max_zoom - tile.id.z : 1) { + collision(tile.id.z, 4096, tile.source.tile_size, tile.depth) { } void TileParser::parse() { diff --git a/src/map/vector_tile_data.cpp b/src/map/vector_tile_data.cpp index cc4133e45..2bf339b65 100644 --- a/src/map/vector_tile_data.cpp +++ b/src/map/vector_tile_data.cpp @@ -9,7 +9,8 @@ using namespace mbgl; VectorTileData::VectorTileData(Tile::ID id, Map &map, const SourceInfo &source) - : TileData(id, map, source) { + : TileData(id, map, source), + depth(id.z >= source.max_zoom ? map.getMaxZoom() - id.z : 1) { } VectorTileData::~VectorTileData() {