Skip to content

Commit

Permalink
Add Map Layer input parameter type for models
Browse files Browse the repository at this point in the history
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 355cff1
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -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,
Expand All @@ -88,6 +89,7 @@ class ModelerParameterDefinitionDialog(QDialog):
PARAMETER_RASTER,
PARAMETER_STRING,
PARAMETER_EXPRESSION,
PARAMETER_MAP_LAYER,
PARAMETER_TABLE,
PARAMETER_TABLE_FIELD,
PARAMETER_VECTOR,
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 355cff1

Please sign in to comment.