correctly calculate placement depth

This commit is contained in:
Konstantin Käfer
2014-08-05 11:44:50 +02:00
parent 1ac5ed84ea
commit cdd7991505
3 changed files with 6 additions and 2 deletions

View File

@@ -51,6 +51,9 @@ protected:
std::unordered_map<std::string, std::unique_ptr<Bucket>> buckets;
std::unique_ptr<TileParser> parser;
public:
const float depth;
};
}

View File

@@ -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() {

View File

@@ -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() {