Aw5739 Add ngx openlayers
Some checks failed
FarmMaps.Develop/FarmMapsLib/pipeline/head There was a failure building this commit

This commit is contained in:
2023-12-29 11:01:36 +01:00
parent 5cbb6f32f9
commit 8e8f18ad7c
92 changed files with 6555 additions and 2465 deletions

View File

@@ -0,0 +1,27 @@
import { Directive, Input, OnDestroy } from '@angular/core';
import { Source } from 'ol';
import { LayerComponent } from '../layers/layer.component';
@Directive()
export abstract class SourceComponent implements OnDestroy {
@Input()
attributions: any;
public instance: Source;
public componentType = 'source';
constructor(protected host: LayerComponent) {}
ngOnDestroy() {
if (this.host && this.host.instance) {
this.host.instance.setSource(null);
}
}
protected _register(s: Source) {
if (this.host) {
this.host.instance.setSource(s);
}
}
}