Skip to content

Commit

Permalink
When a layer changes from non-spatial to spatial, update canvas layers
Browse files Browse the repository at this point in the history
If a layer changes data source then it may potentially change from
a non-spatial layer to a spatial layer. Accordingly, listen out
for this and trigger a canvas layer update whenever a layer's source
changes. This ensures that ALL spatial layers are correctly
visible in the canvas immediately after the source change triggers
the spatial status change.

Fixes #59723
  • Loading branch information
nyalldawson committed Jan 31, 2025
1 parent 65670a5 commit 1cf9734
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/gui/layertree/qgslayertreemapcanvasbridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ void QgsLayerTreeMapCanvasBridge::layersAdded( const QList<QgsMapLayer *> &layer
// if we are moving from zero valid layers to non-zero VALID layers, let's zoom to those data
mCanvas->zoomToProjectExtent();
}
deferredSetCanvasLayers();
} );
}
}
Expand Down

0 comments on commit 1cf9734

Please sign in to comment.