File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -2675,6 +2675,15 @@ void QgsLegend::legendLayerZoom()
2675
2675
QgsMapLayer* theLayer = currentLayer->layer ();
2676
2676
extent = theLayer->extent ();
2677
2677
2678
+ QgsVectorLayer* vLayer = qobject_cast<QgsVectorLayer*>( theLayer );
2679
+
2680
+ if ( extent.isEmpty () && vLayer )
2681
+ {
2682
+ vLayer->updateExtents ();
2683
+ extent = vLayer->extent ();
2684
+ }
2685
+
2686
+
2678
2687
// transform extent if otf-projection is on
2679
2688
if ( mMapCanvas ->hasCrsTransformEnabled () )
2680
2689
{
@@ -2697,6 +2706,14 @@ void QgsLegend::legendLayerZoom()
2697
2706
QgsMapLayer* theLayer = layers.at ( i )->layer ();
2698
2707
layerExtent = theLayer->extent ();
2699
2708
2709
+ QgsVectorLayer* vLayer = qobject_cast<QgsVectorLayer*>( theLayer );
2710
+
2711
+ if ( extent.isEmpty () && vLayer )
2712
+ {
2713
+ vLayer->updateExtents ();
2714
+ layerExtent = vLayer->extent ();
2715
+ }
2716
+
2700
2717
// transform extent if otf-projection is on
2701
2718
if ( mMapCanvas ->hasCrsTransformEnabled () )
2702
2719
{
You can’t perform that action at this time.
0 commit comments