Aw5739 ngx openlayers -> fm aol

This commit is contained in:
2023-12-28 12:29:57 +01:00
parent 0c10d998a1
commit eb9a8489b8
96 changed files with 8078 additions and 3791 deletions

View File

@@ -0,0 +1,31 @@
import { Component, OnDestroy, OnInit, Input } from '@angular/core';
import { control, Collection } from 'openlayers';
import { MapComponent } from '../map.component';
@Component({
selector: 'aol-control-defaults',
template: ''
})
export class DefaultControlComponent implements OnInit, OnDestroy {
instance: Collection<control.Control>;
@Input() attribution: boolean;
@Input() attributionOptions: olx.control.AttributionOptions;
@Input() rotate: boolean;
@Input() rotateOptions: olx.control.RotateOptions;
@Input() zoom: boolean;
@Input() zoomOptions: olx.control.ZoomOptions;
constructor(private map: MapComponent) {
}
ngOnInit() {
// console.log('ol.control.defaults init: ', this);
this.instance = control.defaults(this);
this.instance.forEach((control) => this.map.instance.addControl(control));
}
ngOnDestroy() {
// console.log('removing aol-control-defaults');
this.instance.forEach((control) => this.map.instance.removeControl(control));
}
}