Skip to content

Commit 355cff1

Browse files
committedAug 18, 2017
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
1 parent 7d69e5f commit 355cff1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎python/plugins/processing/modeler/ModelerParameterDefinitionDialog.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ class ModelerParameterDefinitionDialog(QDialog):
7878
PARAMETER_POINT = 'Point'
7979
PARAMETER_CRS = 'CRS'
8080
PARAMETER_MULTIPLE = 'Multiple Input'
81-
PARAMETER_BAND = 'Raster band'
81+
PARAMETER_BAND = 'Raster Band'
82+
PARAMETER_MAP_LAYER = 'Map Layer'
8283

8384
paramTypes = [
8485
PARAMETER_BOOLEAN,
@@ -88,6 +89,7 @@ class ModelerParameterDefinitionDialog(QDialog):
8889
PARAMETER_RASTER,
8990
PARAMETER_STRING,
9091
PARAMETER_EXPRESSION,
92+
PARAMETER_MAP_LAYER,
9193
PARAMETER_TABLE,
9294
PARAMETER_TABLE_FIELD,
9395
PARAMETER_VECTOR,
@@ -346,6 +348,10 @@ def accept(self):
346348
return
347349
parent = self.parentCombo.currentData()
348350
self.param = QgsProcessingParameterBand(name, description, None, parent)
351+
elif (self.paramType == ModelerParameterDefinitionDialog.PARAMETER_MAP_LAYER or
352+
isinstance(self.param, QgsProcessingParameterMapLayer)):
353+
self.param = QgsProcessingParameterMapLayer(
354+
name, description)
349355
elif (self.paramType == ModelerParameterDefinitionDialog.PARAMETER_RASTER or
350356
isinstance(self.param, QgsProcessingParameterRasterLayer)):
351357
self.param = QgsProcessingParameterRasterLayer(

0 commit comments

Comments
 (0)
Please sign in to comment.