|
1 | 1 | import { Component, OnDestroy, OnInit, Input } from '@angular/core'; |
2 | | -import { control, Collection } from 'openlayers'; |
| 2 | +import { Control, defaults } from 'ol/control'; |
| 3 | +import { Collection } from 'ol'; |
| 4 | +import { Options as AttributionOptions } from 'ol/control/Attribution'; |
| 5 | +import { Options as RotateOptions } from 'ol/control/Rotate'; |
| 6 | +import { Options as ZoomOptions } from 'ol/control/Zoom'; |
| 7 | + |
3 | 8 | import { MapComponent } from '../map.component'; |
4 | 9 |
|
5 | 10 | @Component({ |
6 | 11 | selector: 'aol-control-defaults', |
7 | 12 | template: '', |
8 | 13 | }) |
9 | 14 | export class DefaultControlComponent implements OnInit, OnDestroy { |
10 | | - instance: Collection<control.Control>; |
| 15 | + instance: Collection<Control>; |
11 | 16 | @Input() |
12 | 17 | attribution: boolean; |
13 | 18 | @Input() |
14 | | - attributionOptions: olx.control.AttributionOptions; |
| 19 | + attributionOptions: AttributionOptions; |
15 | 20 | @Input() |
16 | 21 | rotate: boolean; |
17 | 22 | @Input() |
18 | | - rotateOptions: olx.control.RotateOptions; |
| 23 | + rotateOptions: RotateOptions; |
19 | 24 | @Input() |
20 | 25 | zoom: boolean; |
21 | 26 | @Input() |
22 | | - zoomOptions: olx.control.ZoomOptions; |
| 27 | + zoomOptions: ZoomOptions; |
23 | 28 |
|
24 | 29 | constructor(private map: MapComponent) {} |
25 | 30 |
|
26 | 31 | ngOnInit() { |
27 | 32 | // console.log('ol.control.defaults init: ', this); |
28 | | - this.instance = control.defaults(this); |
| 33 | + this.instance = defaults(this); |
29 | 34 | this.instance.forEach(c => this.map.instance.addControl(c)); |
30 | 35 | } |
31 | 36 |
|
|
0 commit comments