Skip to content
Permalink
Browse files

Invalidate wgs84 extent when setting a transform context

  • Loading branch information
pblottiere committed Mar 10, 2021
1 parent 6667472 commit 0c831ddec4ab51cd02b5f837f677a8a850e05e77
@@ -1812,6 +1812,8 @@ Add error message
Sets error message
%End

void invalidateWgs84Extent();




@@ -120,6 +120,7 @@ QgsRectangle QgsAnnotationLayer::extent() const
void QgsAnnotationLayer::setTransformContext( const QgsCoordinateTransformContext &context )
{
mTransformContext = context;
invalidateWgs84Extent();
}

bool QgsAnnotationLayer::readXml( const QDomNode &layerNode, QgsReadWriteContext &context )
@@ -539,6 +539,7 @@ void QgsMeshLayer::setTransformContext( const QgsCoordinateTransformContext &tra
{
if ( mDataProvider )
mDataProvider->setTransformContext( transformContext );
invalidateWgs84Extent();
}

QgsMeshDatasetIndex QgsMeshLayer::datasetIndexAtTime( const QgsDateTimeRange &timeRange, int datasetGroupIndex ) const
@@ -277,6 +277,7 @@ void QgsPointCloudLayer::setTransformContext( const QgsCoordinateTransformContex
{
if ( mDataProvider )
mDataProvider->setTransformContext( transformContext );
invalidateWgs84Extent();
}

void QgsPointCloudLayer::setDataSource( const QString &dataSource, const QString &baseName, const QString &provider,
@@ -2049,3 +2049,12 @@ void QgsMapLayer::updateExtent( const QgsRectangle &extent ) const

mWgs84Extent = wgs84Extent( true );
}

void QgsMapLayer::invalidateWgs84Extent()
{
// do not update the wgs84 extent if we trust layer metadata
if ( mReadFlags & QgsMapLayer::ReadFlag::FlagTrustLayerMetadata )
return;

mWgs84Extent = QgsRectangle();
}
@@ -1612,6 +1612,8 @@ class CORE_EXPORT QgsMapLayer : public QObject
//! Sets error message
void setError( const QgsError &error ) { mError = error;}

void invalidateWgs84Extent();

//! Indicates if the layer is valid and can be drawn
bool mValid = false;

@@ -1759,6 +1759,7 @@ void QgsRasterLayer::setTransformContext( const QgsCoordinateTransformContext &t
{
if ( mDataProvider )
mDataProvider->setTransformContext( transformContext );
invalidateWgs84Extent();
}

QStringList QgsRasterLayer::subLayers() const
@@ -344,6 +344,7 @@ bool QgsVectorTileLayer::writeSymbology( QDomNode &node, QDomDocument &doc, QStr
void QgsVectorTileLayer::setTransformContext( const QgsCoordinateTransformContext &transformContext )
{
Q_UNUSED( transformContext )
invalidateWgs84Extent();
}

QString QgsVectorTileLayer::loadDefaultStyle( bool &resultFlag )

0 comments on commit 0c831dd

Please sign in to comment.