Reduce memory use of GridIndex (#2362)
This commit is contained in:
@@ -13,14 +13,14 @@ TileLayerIndex::TileLayerIndex(OverscaledTileID coord_,
|
||||
: coord(coord_),
|
||||
bucketInstanceId(bucketInstanceId_),
|
||||
bucketLeaderId(std::move(bucketLeaderId_)) {
|
||||
for (SymbolInstance& symbolInstance : symbolInstances) {
|
||||
for (const SymbolInstance& symbolInstance : symbolInstances) {
|
||||
if (symbolInstance.crossTileID == SymbolInstance::invalidCrossTileID()) continue;
|
||||
indexedSymbolInstances[symbolInstance.key].emplace_back(symbolInstance.crossTileID,
|
||||
getScaledCoordinates(symbolInstance, coord));
|
||||
}
|
||||
}
|
||||
|
||||
Point<int64_t> TileLayerIndex::getScaledCoordinates(SymbolInstance& symbolInstance,
|
||||
Point<int64_t> TileLayerIndex::getScaledCoordinates(const SymbolInstance& symbolInstance,
|
||||
const OverscaledTileID& childTileCoord) const {
|
||||
// Round anchor positions to roughly 4 pixel grid
|
||||
const double roundingFactor = 512.0 / util::EXTENT / 2.0;
|
||||
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
uint32_t bucketInstanceId,
|
||||
std::string bucketLeaderId);
|
||||
|
||||
Point<int64_t> getScaledCoordinates(SymbolInstance&, const OverscaledTileID&) const;
|
||||
Point<int64_t> getScaledCoordinates(const SymbolInstance&, const OverscaledTileID&) const;
|
||||
void findMatches(SymbolBucket&, const OverscaledTileID&, std::set<uint32_t>&) const;
|
||||
|
||||
OverscaledTileID coord;
|
||||
|
||||
Reference in New Issue
Block a user