AW-6046 ng-openlayers

This commit is contained in:
2024-04-10 14:06:44 +02:00
parent 9c270bfe75
commit 4384b12944
100 changed files with 43 additions and 4228 deletions

View File

@@ -1,33 +0,0 @@
import { Component, ContentChild, OnDestroy, OnInit } from '@angular/core';
import { Control } from 'ol/control';
import { MapComponent } from '../map.component';
import { ContentComponent } from '../content.component';
@Component({
selector: 'aol-control',
template: ` <ng-content></ng-content> `,
})
export class ControlComponent implements OnInit, OnDestroy {
@ContentChild(ContentComponent, { static: true })
content: ContentComponent;
public componentType = 'control';
instance: Control;
element: HTMLElement;
constructor(private map: MapComponent) {}
ngOnInit() {
if (this.content) {
this.element = this.content.elementRef.nativeElement;
this.instance = new Control(this);
this.map.instance.addControl(this.instance);
}
}
ngOnDestroy() {
if (this.instance) {
this.map.instance.removeControl(this.instance);
}
}
}