Aw5739 Add ngx openlayers
Some checks failed
FarmMaps.Develop/FarmMapsLib/pipeline/head There was a failure building this commit
Some checks failed
FarmMaps.Develop/FarmMapsLib/pipeline/head There was a failure building this commit
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
|
||||
import { Condition } from 'ol/events/condition';
|
||||
import { DragBox } from 'ol/interaction';
|
||||
import { EndCondition } from 'ol/interaction/DragBox';
|
||||
import { MapComponent } from '../map.component';
|
||||
|
||||
@Component({
|
||||
selector: 'aol-interaction-dragbox',
|
||||
template: '',
|
||||
})
|
||||
export class DragBoxInteractionComponent implements OnInit, OnDestroy {
|
||||
@Input()
|
||||
className: string;
|
||||
@Input()
|
||||
condition: Condition;
|
||||
@Input()
|
||||
boxEndCondition: EndCondition;
|
||||
|
||||
instance: DragBox;
|
||||
|
||||
constructor(private map: MapComponent) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.instance = new DragBox(this);
|
||||
this.map.instance.addInteraction(this.instance);
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.map.instance.removeInteraction(this.instance);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user