diff --git a/packages/base/src/formbuilder/formselectors.ts b/packages/base/src/formbuilder/formselectors.ts index 87ade70b..6e96150d 100644 --- a/packages/base/src/formbuilder/formselectors.ts +++ b/packages/base/src/formbuilder/formselectors.ts @@ -1,9 +1,10 @@ import { LayerType, SourceType } from '@jupytergis/schema'; import { BaseForm } from './objectform/baseform'; import { GeoJSONSourcePropertiesForm } from './objectform/geojsonsource'; +import { HillshadeLayerPropertiesForm } from './objectform/hillshadeLayerForm'; +import { LayerPropertiesForm } from './objectform/layerform'; import { TileSourcePropertiesForm } from './objectform/tilesourceform'; import { VectorLayerPropertiesForm } from './objectform/vectorlayerform'; -import { LayerPropertiesForm } from './objectform/layerform'; export function getLayerTypeForm( layerType: LayerType @@ -14,6 +15,9 @@ export function getLayerTypeForm( case 'VectorLayer': LayerForm = VectorLayerPropertiesForm; break; + case 'HillshadeLayer': + LayerForm = HillshadeLayerPropertiesForm; + break; // ADD MORE FORM TYPES HERE } diff --git a/packages/base/src/formbuilder/objectform/hillshadeLayerForm.ts b/packages/base/src/formbuilder/objectform/hillshadeLayerForm.ts new file mode 100644 index 00000000..871c83fe --- /dev/null +++ b/packages/base/src/formbuilder/objectform/hillshadeLayerForm.ts @@ -0,0 +1,18 @@ +import { IDict } from '@jupytergis/schema'; +import { LayerPropertiesForm } from './layerform'; + +/** + * The form to modify a hillshade layer. + */ +export class HillshadeLayerPropertiesForm extends LayerPropertiesForm { + protected processSchema( + data: IDict | undefined, + schema: IDict, + uiSchema: IDict + ) { + super.processSchema(data, schema, uiSchema); + uiSchema['shadowColor'] = { + 'ui:widget': 'color' + }; + } +}