Skip to content
Permalink
Browse files

Don't prompt for CRS for annotation layers

Fixes #38739
  • Loading branch information
nyalldawson committed Sep 16, 2020
1 parent 49037e0 commit 15975c1d5191933311d81a494d87806f4e73ce57
Showing with 3 additions and 2 deletions.
  1. +1 −0 src/core/annotations/qgsannotationlayer.cpp
  2. +2 −2 src/core/qgsmaplayer.cpp
@@ -26,6 +26,7 @@ QgsAnnotationLayer::QgsAnnotationLayer( const QString &name, const LayerOptions
: QgsMapLayer( QgsMapLayerType::AnnotationLayer, name )
, mTransformContext( options.transformContext )
{
mShouldValidateCrs = false;
mValid = true;
}

@@ -257,7 +257,7 @@ bool QgsMapLayer::readLayerXml( const QDomElement &layerElement, QgsReadWriteCon
QDomNode srsNode = layerElement.namedItem( QStringLiteral( "srs" ) );
mCRS.readXml( srsNode );
mCRS.setValidationHint( tr( "Specify CRS for layer %1" ).arg( mne.text() ) );
if ( isSpatial() )
if ( isSpatial() && type() != QgsMapLayerType::AnnotationLayer )
mCRS.validate();
savedCRS = mCRS;

@@ -770,7 +770,7 @@ void QgsMapLayer::setCrs( const QgsCoordinateReferenceSystem &srs, bool emitSign
{
mCRS = srs;

if ( mShouldValidateCrs && isSpatial() && !mCRS.isValid() )
if ( mShouldValidateCrs && isSpatial() && !mCRS.isValid() && type() != QgsMapLayerType::AnnotationLayer )
{
mCRS.setValidationHint( tr( "Specify CRS for layer %1" ).arg( name() ) );
mCRS.validate();

0 comments on commit 15975c1

Please sign in to comment.
You can’t perform that action at this time.