dlr-eoc / ukis-frontend-libraries

A collection of angular ui-components, services, interfaces... to help you create geospatial mapping applications for the web.
Apache License 2.0
17 stars 4 forks source link

Layer-control: Deactivating sorting for layer control elements #179

Closed lucas-angermann closed 1 year ago

lucas-angermann commented 1 year ago

Description

At the moment there is no possibility to deactivate the sorting inside a <ukis-layer-control> element, e.g. inside 'Layers'. Inside <ukis-base-layer-control> there is no sorting, but there is only one layer allowed at a time. The proposed behavior would be to insert an optional flag to a <ukis-layer-control> element, which deactivates both the sorting per dag and drop and with the arrow buttons. e.g.

<ukis-layer-control [sort]="false" [layersSvc]="layerSvc" [mapStateSvc]="mapStateSvc" [layerfilter]="'Overlays'">
</ukis-layer-control>

This change should not affect the existing behavior of the layer-control, but extend its functionality.

Relevant Package

This feature request is for @dlr-eoc/layer-control, especially this layer-control template and the drop function.

Examples

The motivation for this change comes from the development of map-cesium. There the layer-control is used to handle 3D tile layers, which cannot be sorted. Therefore, the option to disable the sorting for the 3D layer area inside the layer control for the user would help to clarify the funcctionality of the 3D tiles layer control.

boeckMt commented 1 year ago

The sorting is done in cdkDropList. Maybe a input sorting: boolean for LayerControlComponent and https://github.com/angular/components/blob/main/src/cdk/drag-drop/drag-drop.md#disabled-dragging should fix it.