AW-6046 ng-openlayers
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
import { Component, ElementRef, Input, OnDestroy, OnInit } from '@angular/core';
|
||||
import MousePosition from 'ol/control/MousePosition';
|
||||
import { MapComponent } from '../map.component';
|
||||
import { CoordinateFormat } from 'ol/coordinate';
|
||||
import { ProjectionLike } from 'ol/proj';
|
||||
|
||||
@Component({
|
||||
selector: 'aol-control-mouseposition',
|
||||
template: ``,
|
||||
})
|
||||
export class ControlMousePositionComponent implements OnInit, OnDestroy {
|
||||
@Input()
|
||||
coordinateFormat: CoordinateFormat;
|
||||
@Input()
|
||||
projection: ProjectionLike;
|
||||
|
||||
instance: MousePosition;
|
||||
target: HTMLElement;
|
||||
|
||||
constructor(
|
||||
private map: MapComponent,
|
||||
private element: ElementRef
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.target = this.element.nativeElement;
|
||||
// console.log('ol.control.MousePosition init: ', this);
|
||||
this.instance = new MousePosition(this);
|
||||
this.map.instance.addControl(this.instance);
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
// console.log('removing aol-control-mouseposition');
|
||||
this.map.instance.removeControl(this.instance);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user