[core] add raster-dem source type and hillshade layer type (#10642)

This commit is contained in:
Molly Lloyd
2018-01-23 10:49:23 -08:00
committed by GitHub
parent 2d15aed43c
commit f3294200c6
84 changed files with 4661 additions and 56 deletions

View File

@@ -33,13 +33,22 @@ void TileCache::add(const OverscaledTileID& key, std::unique_ptr<Tile> tile) {
// purge oldest key/tile if necessary
if (orderedKeys.size() > size) {
get(orderedKeys.front());
pop(orderedKeys.front());
}
assert(orderedKeys.size() <= size);
}
std::unique_ptr<Tile> TileCache::get(const OverscaledTileID& key) {
Tile* TileCache::get(const OverscaledTileID& key) {
auto it = tiles.find(key);
if (it != tiles.end()) {
return it->second.get();
} else {
return nullptr;
}
}
std::unique_ptr<Tile> TileCache::pop(const OverscaledTileID& key) {
std::unique_ptr<Tile> tile;