Fix incomplete feature state updates in GeometryTile and SourceFeatureState [Vector Tile Layer]. (#3406)

Co-authored-by: nithin.aashik <nithin.aashik@mapmyindia.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bart Louwers <bart@emeel.net>
Co-authored-by: Bart Louwers <bart.louwers@gmail.com>
This commit is contained in:
NithinAashikPS
2025-06-06 03:14:22 +05:30
committed by GitHub
parent 53393f1af6
commit b81de15587
3 changed files with 10 additions and 12 deletions

View File

@@ -44,7 +44,7 @@
}
},
{
"id": "poi_label",
"id": "poi_layer",
"type": "circle",
"source": "maplibre",
"source-layer": "poi_label",

View File

@@ -97,6 +97,8 @@ void SourceFeatureState::coalesceChanges(std::vector<RenderTile>& tiles) {
stateChanges.clear();
deletedStates.clear();
changes.insert(currentStates.begin(), currentStates.end());
if (changes.empty()) {
return;
}

View File

@@ -542,18 +542,16 @@ void GeometryTile::performedFadePlacement() {
void GeometryTile::setFeatureState(const LayerFeatureStates& states) {
MLN_TRACE_FUNC();
auto layers = getData();
const auto layers = getData();
if ((layers == nullptr) || states.empty() || !layoutResult) {
return;
}
auto& layerIdToLayerRenderData = layoutResult->layerRenderData;
for (auto& layer : layerIdToLayerRenderData) {
const auto& layerID = layer.first;
const auto sourceLayer = layers->getLayer(layerID);
if (sourceLayer) {
const auto& sourceLayerID = sourceLayer->getName();
auto entry = states.find(sourceLayerID);
for (auto& layerIdToLayerRenderData = layoutResult->layerRenderData;
auto& [layerID, renderData] : layerIdToLayerRenderData) {
std::string sourceLayerId = renderData.layerProperties->baseImpl->sourceLayer;
if (const auto sourceLayer = layers->getLayer(sourceLayerId)) {
auto entry = states.find(sourceLayerId);
if (entry == states.end()) {
continue;
}
@@ -561,9 +559,7 @@ void GeometryTile::setFeatureState(const LayerFeatureStates& states) {
if (featureStates.empty()) {
continue;
}
auto bucket = layer.second.bucket;
if (bucket && bucket->hasData()) {
if (const auto bucket = renderData.bucket; bucket && bucket->hasData()) {
bucket->update(featureStates, *sourceLayer, layerID, layoutResult->imageAtlas.patternPositions);
}
}