Closed boeckMt closed 3 years ago
@MichaelLangbein and @voinSR what do you think about this change.
Another option (to make no breaking change) would be, to only extend the current Layer.pupup to
popup?: boolean | Array<string> | popup | popup[];
I have a basic implementation now with popup and events separated like described in https://github.com/dlr-eoc/ukis-frontend-libraries/issues/85#issuecomment-851550912
https://github.com/dlr-eoc/ukis-frontend-libraries/compare/layer-events
It is not implemented as following
export interface ILayerEvent {
event: string;
listener: (args?: any) => void;
}
popup?: boolean | Array<string> | popup | popup[];
events?: {
/** e.g. https://openlayers.org/en/v6.5.0/apidoc/module-ol_layer_Layer-Layer.html Fires */
layer?: ILayerEvent[];
/** e.g. https://openlayers.org/en/v6.5.0/apidoc/module-ol_source_Source.html Tile | Image | Raster | Vector */
source?: ILayerEvent[];
};
Description
When a
CustomLayer
is used, it is possible to listen on "OpenLayers" events for thelayer
or thesource
e.g.source.on('tileloadend', () =>)
Such an interface should also be available forUkisLayers
(RasterLayer
|VectorLayer
)Popups are also sometimes needed for several events e.g. show something on click and something different on move.
I would propose to use one Interface for all this Events because the are all bound to the layer and then remove the
Layer.popup
. This would be a breaking change, but then there is only one interface for events which looks nearly the same for all.Relevant Package
This feature request is for @dlr-eoc/....
Examples