Skip to content
Permalink
Browse files

Fix broken atlas handling of z/m layer types

  • Loading branch information
nyalldawson committed Dec 27, 2017
1 parent 70e7185 commit 327d311e2135264b089d6327e9f97d2c3ed8bdcc
Showing with 13 additions and 28 deletions.
  1. +12 −15 src/app/layout/qgslayoutmapwidget.cpp
  2. +1 −13 src/core/layout/qgslayoutitemmap.cpp
@@ -695,21 +695,18 @@ void QgsLayoutMapWidget::toggleAtlasScalingOptionsByLayerType()
return;
}

switch ( layer->wkbType() )
{
case QgsWkbTypes::Point:
case QgsWkbTypes::Point25D:
case QgsWkbTypes::MultiPoint:
case QgsWkbTypes::MultiPoint25D:
//For point layers buffer setting makes no sense, so set "fixed scale" on and disable margin control
mAtlasFixedScaleRadio->setChecked( true );
mAtlasMarginRadio->setEnabled( false );
mAtlasPredefinedScaleRadio->setEnabled( false );
break;
default:
//Not a point layer, so enable changes to fixed scale control
mAtlasMarginRadio->setEnabled( true );
mAtlasPredefinedScaleRadio->setEnabled( true );
if ( QgsWkbTypes::geometryType( layer->wkbType() ) == QgsWkbTypes::PointGeometry )
{
//For point layers buffer setting makes no sense, so set "fixed scale" on and disable margin control
mAtlasFixedScaleRadio->setChecked( true );
mAtlasMarginRadio->setEnabled( false );
mAtlasPredefinedScaleRadio->setEnabled( false );
}
else
{
//Not a point layer, so enable changes to fixed scale control
mAtlasMarginRadio->setEnabled( true );
mAtlasPredefinedScaleRadio->setEnabled( true );
}
}

@@ -1825,19 +1825,7 @@ void QgsLayoutItemMap::updateAtlasFeature()
QgsRectangle originalExtent = mExtent;

//sanity check - only allow fixed scale mode for point layers
bool isPointLayer = false;
switch ( mLayout->context().layer()->wkbType() )
{
case QgsWkbTypes::Point:
case QgsWkbTypes::Point25D:
case QgsWkbTypes::MultiPoint:
case QgsWkbTypes::MultiPoint25D:
isPointLayer = true;
break;
default:
isPointLayer = false;
break;
}
bool isPointLayer = QgsWkbTypes::geometryType( mLayout->context().layer()->wkbType() ) == QgsWkbTypes::PointGeometry;

if ( mAtlasScalingMode == Fixed || mAtlasScalingMode == Predefined || isPointLayer )
{

0 comments on commit 327d311

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