Skip to content
Permalink
Browse files

Add Map Layer input parameter type for models

Since algorithms now use this parameter type (render map alg)
we also need to allow its use in models
  • Loading branch information
nyalldawson committed Aug 18, 2017
1 parent 7d69e5f commit 355cff191d931e47292e6fe88e78e9dfd2274e97
Showing with 7 additions and 1 deletion.
  1. +7 −1 python/plugins/processing/modeler/ModelerParameterDefinitionDialog.py
@@ -78,7 +78,8 @@ class ModelerParameterDefinitionDialog(QDialog):
PARAMETER_POINT = 'Point'
PARAMETER_CRS = 'CRS'
PARAMETER_MULTIPLE = 'Multiple Input'
PARAMETER_BAND = 'Raster band'
PARAMETER_BAND = 'Raster Band'
PARAMETER_MAP_LAYER = 'Map Layer'

paramTypes = [
PARAMETER_BOOLEAN,
@@ -88,6 +89,7 @@ class ModelerParameterDefinitionDialog(QDialog):
PARAMETER_RASTER,
PARAMETER_STRING,
PARAMETER_EXPRESSION,
PARAMETER_MAP_LAYER,
PARAMETER_TABLE,
PARAMETER_TABLE_FIELD,
PARAMETER_VECTOR,
@@ -346,6 +348,10 @@ def accept(self):
return
parent = self.parentCombo.currentData()
self.param = QgsProcessingParameterBand(name, description, None, parent)
elif (self.paramType == ModelerParameterDefinitionDialog.PARAMETER_MAP_LAYER or
isinstance(self.param, QgsProcessingParameterMapLayer)):
self.param = QgsProcessingParameterMapLayer(
name, description)
elif (self.paramType == ModelerParameterDefinitionDialog.PARAMETER_RASTER or
isinstance(self.param, QgsProcessingParameterRasterLayer)):
self.param = QgsProcessingParameterRasterLayer(

0 comments on commit 355cff1

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