FarmMapsLib/projects/ngx-openlayers/src/lib/interactions/dragrotateandzoom.component.ts
Peter Bastiani 8e8f18ad7c
Some checks failed
FarmMaps.Develop/FarmMapsLib/pipeline/head There was a failure building this commit
Aw5739 Add ngx openlayers
2023-12-29 11:01:36 +01:00

29 lines
729 B
TypeScript

import { Component, Input, OnDestroy, OnInit } from '@angular/core';
import { Condition } from 'ol/events/condition';
import { DragRotateAndZoom } from 'ol/interaction';
import { MapComponent } from '../map.component';
@Component({
selector: 'aol-interaction-dragrotateandzoom',
template: '',
})
export class DragRotateAndZoomInteractionComponent implements OnInit, OnDestroy {
@Input()
condition: Condition;
@Input()
duration: number;
instance: DragRotateAndZoom;
constructor(private map: MapComponent) {}
ngOnInit() {
this.instance = new DragRotateAndZoom(this);
this.map.instance.addInteraction(this.instance);
}
ngOnDestroy() {
this.map.instance.removeInteraction(this.instance);
}
}