[core] always reparse with the freshest possible placement config

Fixes an issue where updates to stale tiles would remove labels altogether until the map was rotated.
This commit is contained in:
Konstantin Käfer
2015-10-26 15:45:32 +01:00
parent c0c554e36f
commit 75dec6ffac
15 changed files with 231 additions and 130 deletions

View File

@@ -286,8 +286,7 @@ TileData::State Source::addTile(MapData& data,
// If we don't find working tile data, we're just going to load it.
if (info.type == SourceType::Vector) {
auto tileData = std::make_shared<VectorTileData>(normalized_id, style, info,
transformState.getAngle(), transformState.getPitch(), data.getCollisionDebug());
auto tileData = std::make_shared<VectorTileData>(normalized_id, style, info);
tileData->request(data.pixelRatio, callback);
new_tile.data = tileData;
} else if (info.type == SourceType::Raster) {
@@ -296,7 +295,7 @@ TileData::State Source::addTile(MapData& data,
new_tile.data = tileData;
} else if (info.type == SourceType::Annotations) {
new_tile.data = std::make_shared<LiveTileData>(normalized_id,
data.getAnnotationManager()->getTile(normalized_id), style, info, callback);
data.getAnnotationManager()->getTile(normalized_id), style, info, callback);
} else {
throw std::runtime_error("source type not implemented");
}
@@ -510,7 +509,8 @@ bool Source::update(MapData& data,
updateTilePtrs();
for (auto& tilePtr : tilePtrs) {
tilePtr->data->redoPlacement(transformState.getAngle(), transformState.getPitch(), data.getCollisionDebug());
tilePtr->data->redoPlacement(
{ transformState.getAngle(), transformState.getPitch(), data.getCollisionDebug() });
}
updated = data.getAnimationTime();
@@ -560,7 +560,7 @@ void Source::tileLoadingCompleteCallback(const TileID& normalized_id, const Tran
return;
}
data->redoPlacement(transformState.getAngle(), transformState.getPitch(), collisionDebug);
data->redoPlacement({ transformState.getAngle(), transformState.getPitch(), collisionDebug });
emitTileLoaded(true);
}