mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-16 00:03:12 -04:00
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
This commit is contained in:
parent
7d69e5f5af
commit
355cff191d
@ -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 @@ class ModelerParameterDefinitionDialog(QDialog):
|
||||
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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user