diff --git a/package.json b/package.json index 09bf3f8f..2681477d 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "@angular/compiler-cli": "^14.3.0", "@angular/language-service": "^14.3.0", "@types/arcgis-rest-api": "^10.4.5", + "@types/hammerjs": "^2.0.41", "@types/jasmine": "~4.3.1", "@types/node": "^12.11.1", "@types/topojson-specification": "^1.0.2", diff --git a/projects/ngx-openlayers/src/lib/attribution.component.ts b/projects/ngx-openlayers/src/lib/attribution.component.ts index fe43fb17..3cd22c3a 100644 --- a/projects/ngx-openlayers/src/lib/attribution.component.ts +++ b/projects/ngx-openlayers/src/lib/attribution.component.ts @@ -11,7 +11,7 @@ export class AttributionComponent implements OnInit { constructor(private elementRef: ElementRef) {} - ngOnInit() { + ngOnInit(): void { this.html = this.elementRef.nativeElement.innerHTML; this.instance = new Attribution(); } diff --git a/projects/ngx-openlayers/src/lib/attributions.component.ts b/projects/ngx-openlayers/src/lib/attributions.component.ts index abc70a6b..0bd08fa5 100644 --- a/projects/ngx-openlayers/src/lib/attributions.component.ts +++ b/projects/ngx-openlayers/src/lib/attributions.component.ts @@ -15,7 +15,7 @@ export class AttributionsComponent implements AfterViewInit { constructor(@Host() private source: SourceComponent) {} /* we can do this at the very end */ - ngAfterViewInit() { + ngAfterViewInit(): void { if (this.attributions.length) { this.instance = this.attributions.map((cmp) => cmp.html); // console.log('setting attributions:', this.instance); diff --git a/projects/ngx-openlayers/src/lib/collectioncoordinates.component.ts b/projects/ngx-openlayers/src/lib/collectioncoordinates.component.ts index 277bc9fe..574f69d2 100644 --- a/projects/ngx-openlayers/src/lib/collectioncoordinates.component.ts +++ b/projects/ngx-openlayers/src/lib/collectioncoordinates.component.ts @@ -44,22 +44,22 @@ export class CollectionCoordinatesComponent implements OnChanges, OnInit { } } - ngOnInit() { + ngOnInit(): void { this.map.instance.on('change:view', (e) => this.onMapViewChanged(e)); this.mapSrid = this.map.instance.getView().getProjection().getCode(); this.transformCoordinates(); } - ngOnChanges(changes: SimpleChanges) { + ngOnChanges(changes: SimpleChanges): void { this.transformCoordinates(); } - private onMapViewChanged(event) { + private onMapViewChanged(event): void { this.mapSrid = event.target.get(event.key).getProjection().getCode(); this.transformCoordinates(); } - private transformCoordinates() { + private transformCoordinates(): void { let transformedCoordinates: Coordinate[] | Coordinate[][] | Coordinate[][][]; if (this.srid === this.mapSrid) { diff --git a/projects/ngx-openlayers/src/lib/controls/attribution.component.ts b/projects/ngx-openlayers/src/lib/controls/attribution.component.ts index d0b1b841..b49654d4 100644 --- a/projects/ngx-openlayers/src/lib/controls/attribution.component.ts +++ b/projects/ngx-openlayers/src/lib/controls/attribution.component.ts @@ -16,14 +16,14 @@ export class ControlAttributionComponent implements OnInit, OnDestroy { constructor(private map: MapComponent, private element: ElementRef) {} - ngOnInit() { + ngOnInit(): void { this.target = this.element.nativeElement; // console.log('ol.control.Attribution init: ', this); this.instance = new Attribution(this); this.map.instance.addControl(this.instance); } - ngOnDestroy() { + ngOnDestroy(): void { // console.log('removing aol-control-attribution'); this.map.instance.removeControl(this.instance); } diff --git a/projects/ngx-openlayers/src/lib/controls/control.component.ts b/projects/ngx-openlayers/src/lib/controls/control.component.ts index a7b69dd4..294e74fc 100644 --- a/projects/ngx-openlayers/src/lib/controls/control.component.ts +++ b/projects/ngx-openlayers/src/lib/controls/control.component.ts @@ -17,7 +17,7 @@ export class ControlComponent implements OnInit, OnDestroy { constructor(private map: MapComponent) {} - ngOnInit() { + ngOnInit(): void { if (this.content) { this.element = this.content.elementRef.nativeElement; this.instance = new Control(this); @@ -25,7 +25,7 @@ export class ControlComponent implements OnInit, OnDestroy { } } - ngOnDestroy() { + ngOnDestroy(): void { if (this.instance) { this.map.instance.removeControl(this.instance); } diff --git a/projects/ngx-openlayers/src/lib/controls/default.component.ts b/projects/ngx-openlayers/src/lib/controls/default.component.ts index f98afeec..219b49d2 100644 --- a/projects/ngx-openlayers/src/lib/controls/default.component.ts +++ b/projects/ngx-openlayers/src/lib/controls/default.component.ts @@ -29,13 +29,13 @@ export class DefaultControlComponent implements OnInit, OnDestroy { constructor(private map: MapComponent) {} - ngOnInit() { + ngOnInit(): void { // console.log('ol.control.defaults init: ', this); this.instance = defaults(this); this.instance.forEach((c) => this.map.instance.addControl(c)); } - ngOnDestroy() { + ngOnDestroy(): void { // console.log('removing aol-control-defaults'); this.instance.forEach((c) => this.map.instance.removeControl(c)); } diff --git a/projects/ngx-openlayers/src/lib/controls/fullscreen.component.ts b/projects/ngx-openlayers/src/lib/controls/fullscreen.component.ts index b4dca7f6..77281e53 100644 --- a/projects/ngx-openlayers/src/lib/controls/fullscreen.component.ts +++ b/projects/ngx-openlayers/src/lib/controls/fullscreen.component.ts @@ -24,12 +24,12 @@ export class ControlFullScreenComponent implements OnInit, OnDestroy { // console.log('instancing aol-control-fullscreen'); } - ngOnInit() { + ngOnInit(): void { this.instance = new FullScreen(this); this.map.instance.addControl(this.instance); } - ngOnDestroy() { + ngOnDestroy(): void { // console.log('removing aol-control-fullscreen'); this.map.instance.removeControl(this.instance); } diff --git a/projects/ngx-openlayers/src/lib/controls/mouseposition.component.ts b/projects/ngx-openlayers/src/lib/controls/mouseposition.component.ts index d32593e5..0a5f21c8 100644 --- a/projects/ngx-openlayers/src/lib/controls/mouseposition.component.ts +++ b/projects/ngx-openlayers/src/lib/controls/mouseposition.component.ts @@ -19,14 +19,14 @@ export class ControlMousePositionComponent implements OnInit, OnDestroy { constructor(private map: MapComponent, private element: ElementRef) {} - ngOnInit() { + ngOnInit(): void { this.target = this.element.nativeElement; // console.log('ol.control.MousePosition init: ', this); this.instance = new MousePosition(this); this.map.instance.addControl(this.instance); } - ngOnDestroy() { + ngOnDestroy(): void { // console.log('removing aol-control-mouseposition'); this.map.instance.removeControl(this.instance); } diff --git a/projects/ngx-openlayers/src/lib/controls/overviewmap.component.ts b/projects/ngx-openlayers/src/lib/controls/overviewmap.component.ts index 716f56c8..927529f4 100644 --- a/projects/ngx-openlayers/src/lib/controls/overviewmap.component.ts +++ b/projects/ngx-openlayers/src/lib/controls/overviewmap.component.ts @@ -30,22 +30,22 @@ export class ControlOverviewMapComponent implements OnInit, OnChanges, OnDestroy constructor(private map: MapComponent) {} - ngOnInit() { + ngOnInit(): void { this.instance = new OverviewMap(this); this.map.instance.addControl(this.instance); } - ngOnDestroy() { + ngOnDestroy(): void { this.map.instance.removeControl(this.instance); } - ngOnChanges(changes: SimpleChanges) { + ngOnChanges(changes: SimpleChanges): void { if (this.instance != null && changes.hasOwnProperty('view')) { this.reloadInstance(); } } - private reloadInstance() { + private reloadInstance(): void { this.map.instance.removeControl(this.instance); this.instance = new OverviewMap(this); this.map.instance.addControl(this.instance); diff --git a/projects/ngx-openlayers/src/lib/controls/rotate.component.ts b/projects/ngx-openlayers/src/lib/controls/rotate.component.ts index 775866f9..650eb378 100644 --- a/projects/ngx-openlayers/src/lib/controls/rotate.component.ts +++ b/projects/ngx-openlayers/src/lib/controls/rotate.component.ts @@ -24,12 +24,12 @@ export class ControlRotateComponent implements OnInit, OnDestroy { // console.log('instancing aol-control-rotate'); } - ngOnInit() { + ngOnInit(): void { this.instance = new Rotate(this); this.map.instance.addControl(this.instance); } - ngOnDestroy() { + ngOnDestroy(): void { // console.log('removing aol-control-rotate'); this.map.instance.removeControl(this.instance); } diff --git a/projects/ngx-openlayers/src/lib/controls/scaleline.component.ts b/projects/ngx-openlayers/src/lib/controls/scaleline.component.ts index 4f86891a..3f91e137 100644 --- a/projects/ngx-openlayers/src/lib/controls/scaleline.component.ts +++ b/projects/ngx-openlayers/src/lib/controls/scaleline.component.ts @@ -16,12 +16,12 @@ export class ControlScaleLineComponent implements OnInit, OnDestroy { // console.log('instancing aol-control-scaleline'); } - ngOnInit() { + ngOnInit(): void { this.instance = new ScaleLine(this); this.map.instance.addControl(this.instance); } - ngOnDestroy() { + ngOnDestroy(): void { // console.log('removing aol-control-scaleline'); this.map.instance.removeControl(this.instance); } diff --git a/projects/ngx-openlayers/src/lib/controls/zoom.component.ts b/projects/ngx-openlayers/src/lib/controls/zoom.component.ts index 0aee1707..cbd6a194 100644 --- a/projects/ngx-openlayers/src/lib/controls/zoom.component.ts +++ b/projects/ngx-openlayers/src/lib/controls/zoom.component.ts @@ -26,12 +26,12 @@ export class ControlZoomComponent implements OnInit, OnDestroy { // console.log('instancing aol-control-zoom'); } - ngOnInit() { + ngOnInit(): void { this.instance = new Zoom(this); this.map.instance.addControl(this.instance); } - ngOnDestroy() { + ngOnDestroy(): void { // console.log('removing aol-control-zoom'); this.map.instance.removeControl(this.instance); } diff --git a/projects/ngx-openlayers/src/lib/controls/zoomslider.component.ts b/projects/ngx-openlayers/src/lib/controls/zoomslider.component.ts index c7d11ba1..33797072 100644 --- a/projects/ngx-openlayers/src/lib/controls/zoomslider.component.ts +++ b/projects/ngx-openlayers/src/lib/controls/zoomslider.component.ts @@ -22,12 +22,12 @@ export class ControlZoomSliderComponent implements OnInit, OnDestroy { // console.log('instancing aol-control-zoomslider'); } - ngOnInit() { + ngOnInit(): void { this.instance = new ZoomSlider(this); this.map.instance.addControl(this.instance); } - ngOnDestroy() { + ngOnDestroy(): void { // console.log('removing aol-control-zoomslider'); this.map.instance.removeControl(this.instance); } diff --git a/projects/ngx-openlayers/src/lib/controls/zoomtoextent.component.ts b/projects/ngx-openlayers/src/lib/controls/zoomtoextent.component.ts index 472d97de..db53bd7a 100644 --- a/projects/ngx-openlayers/src/lib/controls/zoomtoextent.component.ts +++ b/projects/ngx-openlayers/src/lib/controls/zoomtoextent.component.ts @@ -23,12 +23,12 @@ export class ControlZoomToExtentComponent implements OnInit, OnDestroy { // console.log('instancing aol-control-zoomtoextent'); } - ngOnInit() { + ngOnInit(): void { this.instance = new ZoomToExtent(this); this.map.instance.addControl(this.instance); } - ngOnDestroy() { + ngOnDestroy(): void { // console.log('removing aol-control-zoomtoextent'); this.map.instance.removeControl(this.instance); } diff --git a/projects/ngx-openlayers/src/lib/coordinate.component.ts b/projects/ngx-openlayers/src/lib/coordinate.component.ts index 17f3a38f..7276bd57 100644 --- a/projects/ngx-openlayers/src/lib/coordinate.component.ts +++ b/projects/ngx-openlayers/src/lib/coordinate.component.ts @@ -40,22 +40,22 @@ export class CoordinateComponent implements OnChanges, OnInit { } } - ngOnInit() { + ngOnInit(): void { this.map.instance.on('change:view', (e) => this.onMapViewChanged(e)); this.mapSrid = this.map.instance.getView().getProjection().getCode(); this.transformCoordinates(); } - ngOnChanges(changes: SimpleChanges) { + ngOnChanges(changes: SimpleChanges): void { this.transformCoordinates(); } - private onMapViewChanged(event) { + private onMapViewChanged(event): void { this.mapSrid = event.target.get(event.key).getProjection().getCode(); this.transformCoordinates(); } - private transformCoordinates() { + private transformCoordinates(): void { let transformedCoordinates: number[]; if (this.srid === this.mapSrid) { diff --git a/projects/ngx-openlayers/src/lib/feature.component.ts b/projects/ngx-openlayers/src/lib/feature.component.ts index d6a5acf4..47a9e54c 100644 --- a/projects/ngx-openlayers/src/lib/feature.component.ts +++ b/projects/ngx-openlayers/src/lib/feature.component.ts @@ -15,7 +15,7 @@ export class FeatureComponent implements OnInit, OnDestroy, OnChanges { constructor(private host: SourceVectorComponent) {} - ngOnInit() { + ngOnInit(): void { this.instance = new Feature(); if (this.id !== undefined) { this.instance.setId(this.id); @@ -23,11 +23,11 @@ export class FeatureComponent implements OnInit, OnDestroy, OnChanges { this.host.instance.addFeature(this.instance); } - ngOnDestroy() { + ngOnDestroy(): void { this.host.instance.removeFeature(this.instance); } - ngOnChanges(changes: SimpleChanges) { + ngOnChanges(changes: SimpleChanges): void { if (this.instance) { this.instance.setId(this.id); } diff --git a/projects/ngx-openlayers/src/lib/geom/geometrylinestring.component.ts b/projects/ngx-openlayers/src/lib/geom/geometrylinestring.component.ts index 23f9d1c1..6e821c4d 100644 --- a/projects/ngx-openlayers/src/lib/geom/geometrylinestring.component.ts +++ b/projects/ngx-openlayers/src/lib/geom/geometrylinestring.component.ts @@ -16,7 +16,7 @@ export class GeometryLinestringComponent extends SimpleGeometryComponent impleme super(map, host); } - ngOnInit() { + ngOnInit(): void { this.instance = new LineString([ [0, 0], [1, 1], diff --git a/projects/ngx-openlayers/src/lib/geom/geometrymultilinestring.component.ts b/projects/ngx-openlayers/src/lib/geom/geometrymultilinestring.component.ts index 92316cb3..c471cddb 100644 --- a/projects/ngx-openlayers/src/lib/geom/geometrymultilinestring.component.ts +++ b/projects/ngx-openlayers/src/lib/geom/geometrymultilinestring.component.ts @@ -16,7 +16,7 @@ export class GeometryMultiLinestringComponent extends SimpleGeometryComponent im super(map, host); } - ngOnInit() { + ngOnInit(): void { this.instance = new MultiLineString([ [ [0, 0], diff --git a/projects/ngx-openlayers/src/lib/geom/geometrymultipoint.component.ts b/projects/ngx-openlayers/src/lib/geom/geometrymultipoint.component.ts index 71414c20..2966bb1c 100644 --- a/projects/ngx-openlayers/src/lib/geom/geometrymultipoint.component.ts +++ b/projects/ngx-openlayers/src/lib/geom/geometrymultipoint.component.ts @@ -16,7 +16,7 @@ export class GeometryMultiPointComponent extends SimpleGeometryComponent impleme super(map, host); } - ngOnInit() { + ngOnInit(): void { this.instance = new MultiPoint([ [0, 0], [1, 1], diff --git a/projects/ngx-openlayers/src/lib/geom/geometrymultipolygon.component.ts b/projects/ngx-openlayers/src/lib/geom/geometrymultipolygon.component.ts index d802b131..6d55fc46 100644 --- a/projects/ngx-openlayers/src/lib/geom/geometrymultipolygon.component.ts +++ b/projects/ngx-openlayers/src/lib/geom/geometrymultipolygon.component.ts @@ -16,7 +16,7 @@ export class GeometryMultiPolygonComponent extends SimpleGeometryComponent imple super(map, host); } - ngOnInit() { + ngOnInit(): void { this.instance = new MultiPolygon([ [ [ diff --git a/projects/ngx-openlayers/src/lib/geom/geometrypoint.component.ts b/projects/ngx-openlayers/src/lib/geom/geometrypoint.component.ts index 23b19971..b927c719 100644 --- a/projects/ngx-openlayers/src/lib/geom/geometrypoint.component.ts +++ b/projects/ngx-openlayers/src/lib/geom/geometrypoint.component.ts @@ -16,7 +16,7 @@ export class GeometryPointComponent extends SimpleGeometryComponent implements O super(map, host); } - ngOnInit() { + ngOnInit(): void { this.instance = new Point([0, 0]); super.ngOnInit(); } diff --git a/projects/ngx-openlayers/src/lib/geom/geometrypolygon.component.ts b/projects/ngx-openlayers/src/lib/geom/geometrypolygon.component.ts index 8a1158ff..fc6ed139 100644 --- a/projects/ngx-openlayers/src/lib/geom/geometrypolygon.component.ts +++ b/projects/ngx-openlayers/src/lib/geom/geometrypolygon.component.ts @@ -16,7 +16,7 @@ export class GeometryPolygonComponent extends SimpleGeometryComponent implements super(map, host); } - ngOnInit() { + ngOnInit(): void { this.instance = new Polygon([ [ [0, 0], diff --git a/projects/ngx-openlayers/src/lib/geom/simplegeometry.component.ts b/projects/ngx-openlayers/src/lib/geom/simplegeometry.component.ts index 0c7c8a91..a75fa8fa 100644 --- a/projects/ngx-openlayers/src/lib/geom/simplegeometry.component.ts +++ b/projects/ngx-openlayers/src/lib/geom/simplegeometry.component.ts @@ -12,7 +12,7 @@ export abstract class SimpleGeometryComponent implements OnInit { constructor(protected map: MapComponent, protected host: FeatureComponent) {} - ngOnInit() { + ngOnInit(): void { this.host.instance.setGeometry(this.instance); } } diff --git a/projects/ngx-openlayers/src/lib/graticule.component.ts b/projects/ngx-openlayers/src/lib/graticule.component.ts index db7c48e5..5e573fac 100644 --- a/projects/ngx-openlayers/src/lib/graticule.component.ts +++ b/projects/ngx-openlayers/src/lib/graticule.component.ts @@ -22,7 +22,7 @@ export class GraticuleComponent implements AfterContentInit, OnChanges, OnDestro constructor(private map: MapComponent) {} - ngOnChanges(changes: SimpleChanges) { + ngOnChanges(changes: SimpleChanges): void { const properties: { [index: string]: any } = {}; if (!this.instance) { diff --git a/projects/ngx-openlayers/src/lib/interactions/default.component.ts b/projects/ngx-openlayers/src/lib/interactions/default.component.ts index e0a44e2e..7d662240 100644 --- a/projects/ngx-openlayers/src/lib/interactions/default.component.ts +++ b/projects/ngx-openlayers/src/lib/interactions/default.component.ts @@ -12,12 +12,12 @@ export class DefaultInteractionComponent implements OnInit, OnDestroy { constructor(private map: MapComponent) {} - ngOnInit() { + ngOnInit(): void { this.instance = defaults(); this.instance.forEach((i) => this.map.instance.addInteraction(i)); } - ngOnDestroy() { + ngOnDestroy(): void { this.instance.forEach((i) => this.map.instance.removeInteraction(i)); } } diff --git a/projects/ngx-openlayers/src/lib/interactions/doubleclickzoom.component.ts b/projects/ngx-openlayers/src/lib/interactions/doubleclickzoom.component.ts index b82d6c20..da1bcf1c 100644 --- a/projects/ngx-openlayers/src/lib/interactions/doubleclickzoom.component.ts +++ b/projects/ngx-openlayers/src/lib/interactions/doubleclickzoom.component.ts @@ -16,12 +16,12 @@ export class DoubleClickZoomInteractionComponent implements OnInit, OnDestroy { constructor(private map: MapComponent) {} - ngOnInit() { + ngOnInit(): void { this.instance = new DoubleClickZoom(this); this.map.instance.addInteraction(this.instance); } - ngOnDestroy() { + ngOnDestroy(): void { this.map.instance.removeInteraction(this.instance); } } diff --git a/projects/ngx-openlayers/src/lib/interactions/draganddrop.component.ts b/projects/ngx-openlayers/src/lib/interactions/draganddrop.component.ts index c4bd754b..9ed5004c 100644 --- a/projects/ngx-openlayers/src/lib/interactions/draganddrop.component.ts +++ b/projects/ngx-openlayers/src/lib/interactions/draganddrop.component.ts @@ -20,12 +20,12 @@ export class DragAndDropInteractionComponent implements OnInit, OnDestroy { constructor(private map: MapComponent) {} - ngOnInit() { + ngOnInit(): void { this.instance = new DragAndDrop(this); this.map.instance.addInteraction(this.instance); } - ngOnDestroy() { + ngOnDestroy(): void { this.map.instance.removeInteraction(this.instance); } } diff --git a/projects/ngx-openlayers/src/lib/interactions/dragbox.component.ts b/projects/ngx-openlayers/src/lib/interactions/dragbox.component.ts index d25b1169..3f3b4f65 100644 --- a/projects/ngx-openlayers/src/lib/interactions/dragbox.component.ts +++ b/projects/ngx-openlayers/src/lib/interactions/dragbox.component.ts @@ -20,12 +20,12 @@ export class DragBoxInteractionComponent implements OnInit, OnDestroy { constructor(private map: MapComponent) {} - ngOnInit() { + ngOnInit(): void { this.instance = new DragBox(this); this.map.instance.addInteraction(this.instance); } - ngOnDestroy() { + ngOnDestroy(): void { this.map.instance.removeInteraction(this.instance); } } diff --git a/projects/ngx-openlayers/src/lib/interactions/dragpan.component.ts b/projects/ngx-openlayers/src/lib/interactions/dragpan.component.ts index 9e521e61..9f55aaca 100644 --- a/projects/ngx-openlayers/src/lib/interactions/dragpan.component.ts +++ b/projects/ngx-openlayers/src/lib/interactions/dragpan.component.ts @@ -18,12 +18,12 @@ export class DragPanInteractionComponent implements OnInit, OnDestroy { constructor(private map: MapComponent) {} - ngOnInit() { + ngOnInit(): void { this.instance = new DragPan(this); this.map.instance.addInteraction(this.instance); } - ngOnDestroy() { + ngOnDestroy(): void { this.map.instance.removeInteraction(this.instance); } } diff --git a/projects/ngx-openlayers/src/lib/interactions/dragrotate.component.ts b/projects/ngx-openlayers/src/lib/interactions/dragrotate.component.ts index 9b34a9b3..5ea8929b 100644 --- a/projects/ngx-openlayers/src/lib/interactions/dragrotate.component.ts +++ b/projects/ngx-openlayers/src/lib/interactions/dragrotate.component.ts @@ -17,12 +17,12 @@ export class DragRotateInteractionComponent implements OnInit, OnDestroy { constructor(private map: MapComponent) {} - ngOnInit() { + ngOnInit(): void { this.instance = new DragRotate(this); this.map.instance.addInteraction(this.instance); } - ngOnDestroy() { + ngOnDestroy(): void { this.map.instance.removeInteraction(this.instance); } } diff --git a/projects/ngx-openlayers/src/lib/interactions/dragrotateandzoom.component.ts b/projects/ngx-openlayers/src/lib/interactions/dragrotateandzoom.component.ts index 263259a3..910dfd29 100644 --- a/projects/ngx-openlayers/src/lib/interactions/dragrotateandzoom.component.ts +++ b/projects/ngx-openlayers/src/lib/interactions/dragrotateandzoom.component.ts @@ -17,12 +17,12 @@ export class DragRotateAndZoomInteractionComponent implements OnInit, OnDestroy constructor(private map: MapComponent) {} - ngOnInit() { + ngOnInit(): void { this.instance = new DragRotateAndZoom(this); this.map.instance.addInteraction(this.instance); } - ngOnDestroy() { + ngOnDestroy(): void { this.map.instance.removeInteraction(this.instance); } } diff --git a/projects/ngx-openlayers/src/lib/interactions/dragzoom.component.ts b/projects/ngx-openlayers/src/lib/interactions/dragzoom.component.ts index 3d13b1ac..bbc7e154 100644 --- a/projects/ngx-openlayers/src/lib/interactions/dragzoom.component.ts +++ b/projects/ngx-openlayers/src/lib/interactions/dragzoom.component.ts @@ -21,12 +21,12 @@ export class DragZoomInteractionComponent implements OnInit, OnDestroy { constructor(private map: MapComponent) {} - ngOnInit() { + ngOnInit(): void { this.instance = new DragZoom(this); this.map.instance.addInteraction(this.instance); } - ngOnDestroy() { + ngOnDestroy(): void { this.map.instance.removeInteraction(this.instance); } } diff --git a/projects/ngx-openlayers/src/lib/interactions/draw.component.ts b/projects/ngx-openlayers/src/lib/interactions/draw.component.ts index a994845c..317c5746 100644 --- a/projects/ngx-openlayers/src/lib/interactions/draw.component.ts +++ b/projects/ngx-openlayers/src/lib/interactions/draw.component.ts @@ -61,7 +61,7 @@ export class DrawInteractionComponent implements OnInit, OnDestroy { constructor(private map: MapComponent) {} - ngOnInit() { + ngOnInit(): void { this.instance = new Draw(this); this.instance.on('change', (event: DrawEvent) => this.olChange.emit(event)); this.instance.on('change:active', (event: ObjectEvent) => this.olChangeActive.emit(event)); @@ -71,7 +71,7 @@ export class DrawInteractionComponent implements OnInit, OnDestroy { this.map.instance.addInteraction(this.instance); } - ngOnDestroy() { + ngOnDestroy(): void { this.map.instance.removeInteraction(this.instance); } } diff --git a/projects/ngx-openlayers/src/lib/interactions/modify.component.ts b/projects/ngx-openlayers/src/lib/interactions/modify.component.ts index 5090298b..c3d216d7 100644 --- a/projects/ngx-openlayers/src/lib/interactions/modify.component.ts +++ b/projects/ngx-openlayers/src/lib/interactions/modify.component.ts @@ -44,7 +44,7 @@ export class ModifyInteractionComponent implements OnInit, OnDestroy { constructor(private map: MapComponent) {} - ngOnInit() { + ngOnInit(): void { this.instance = new Modify(this); this.instance.on('change', (event: ModifyEvent) => this.olChange.emit(event)); this.instance.on('change:active', (event: ObjectEvent) => this.olChangeActive.emit(event)); @@ -54,7 +54,7 @@ export class ModifyInteractionComponent implements OnInit, OnDestroy { this.map.instance.addInteraction(this.instance); } - ngOnDestroy() { + ngOnDestroy(): void { this.map.instance.removeInteraction(this.instance); } } diff --git a/projects/ngx-openlayers/src/lib/interactions/mousewheelzoom.component.ts b/projects/ngx-openlayers/src/lib/interactions/mousewheelzoom.component.ts index 39b3b9c2..479bdd3b 100644 --- a/projects/ngx-openlayers/src/lib/interactions/mousewheelzoom.component.ts +++ b/projects/ngx-openlayers/src/lib/interactions/mousewheelzoom.component.ts @@ -18,12 +18,12 @@ export class MouseWheelZoomInteractionComponent implements OnInit, OnDestroy { constructor(private map: MapComponent) {} - ngOnInit() { + ngOnInit(): void { this.instance = new MouseWheelZoom(this); this.map.instance.addInteraction(this.instance); } - ngOnDestroy() { + ngOnDestroy(): void { this.map.instance.removeInteraction(this.instance); } } diff --git a/projects/ngx-openlayers/src/lib/interactions/pinchzoom.component.ts b/projects/ngx-openlayers/src/lib/interactions/pinchzoom.component.ts index c6811c19..3d28f4ac 100644 --- a/projects/ngx-openlayers/src/lib/interactions/pinchzoom.component.ts +++ b/projects/ngx-openlayers/src/lib/interactions/pinchzoom.component.ts @@ -16,12 +16,12 @@ export class PinchZoomInteractionComponent implements OnInit, OnDestroy { constructor(private map: MapComponent) {} - ngOnInit() { + ngOnInit(): void { this.instance = new PinchZoom(this); this.map.instance.addInteraction(this.instance); } - ngOnDestroy() { + ngOnDestroy(): void { this.map.instance.removeInteraction(this.instance); } } diff --git a/projects/ngx-openlayers/src/lib/interactions/select.component.ts b/projects/ngx-openlayers/src/lib/interactions/select.component.ts index c78644ba..c3d03af8 100644 --- a/projects/ngx-openlayers/src/lib/interactions/select.component.ts +++ b/projects/ngx-openlayers/src/lib/interactions/select.component.ts @@ -46,7 +46,7 @@ export class SelectInteractionComponent implements OnInit, OnDestroy { constructor(private map: MapComponent) {} - ngOnInit() { + ngOnInit(): void { this.instance = new Select(this); this.instance.on('change', (event: SelectEvent) => this.olChange.emit(event)); @@ -56,7 +56,7 @@ export class SelectInteractionComponent implements OnInit, OnDestroy { this.map.instance.addInteraction(this.instance); } - ngOnDestroy() { + ngOnDestroy(): void { this.map.instance.removeInteraction(this.instance); } } diff --git a/projects/ngx-openlayers/src/lib/interactions/translate.component.ts b/projects/ngx-openlayers/src/lib/interactions/translate.component.ts index 8396bcef..f3e3e04b 100644 --- a/projects/ngx-openlayers/src/lib/interactions/translate.component.ts +++ b/projects/ngx-openlayers/src/lib/interactions/translate.component.ts @@ -39,7 +39,7 @@ export class TranslateInteractionComponent implements OnInit, OnDestroy { this.translating = new EventEmitter(); } - ngOnInit() { + ngOnInit(): void { this.instance = new Translate(this); this.instance.on('change', (event: TranslateEvent) => this.olChange.emit(event)); @@ -51,7 +51,7 @@ export class TranslateInteractionComponent implements OnInit, OnDestroy { this.map.instance.addInteraction(this.instance); } - ngOnDestroy() { + ngOnDestroy(): void { this.map.instance.removeInteraction(this.instance); } } diff --git a/projects/ngx-openlayers/src/lib/layers/layer.component.ts b/projects/ngx-openlayers/src/lib/layers/layer.component.ts index 4a4594be..f530a820 100644 --- a/projects/ngx-openlayers/src/lib/layers/layer.component.ts +++ b/projects/ngx-openlayers/src/lib/layers/layer.component.ts @@ -29,7 +29,7 @@ export abstract class LayerComponent implements OnInit, OnChanges, OnDestroy { constructor(protected host: MapComponent | LayerGroupComponent) {} - ngOnInit() { + ngOnInit(): void { if (this.prerender !== null && this.prerender !== undefined) { this.instance.on('prerender', this.prerender); } @@ -39,11 +39,11 @@ export abstract class LayerComponent implements OnInit, OnChanges, OnDestroy { this.host.instance.getLayers().push(this.instance); } - ngOnDestroy() { + ngOnDestroy(): void { this.host.instance.getLayers().remove(this.instance); } - ngOnChanges(changes: SimpleChanges) { + ngOnChanges(changes: SimpleChanges): void { const properties: { [index: string]: any } = {}; if (!this.instance) { return; diff --git a/projects/ngx-openlayers/src/lib/layers/layergroup.component.ts b/projects/ngx-openlayers/src/lib/layers/layergroup.component.ts index 00b07375..6579015d 100644 --- a/projects/ngx-openlayers/src/lib/layers/layergroup.component.ts +++ b/projects/ngx-openlayers/src/lib/layers/layergroup.component.ts @@ -19,7 +19,7 @@ export class LayerGroupComponent extends LayerComponent implements OnInit, OnDes super(group || map); } - ngOnInit() { + ngOnInit(): void { // console.log(`creating ol.layer.Group instance with:`, this); this.instance = new Group(this); super.ngOnInit(); diff --git a/projects/ngx-openlayers/src/lib/layers/layerimage.component.ts b/projects/ngx-openlayers/src/lib/layers/layerimage.component.ts index 382fda0e..7a7ea0ba 100644 --- a/projects/ngx-openlayers/src/lib/layers/layerimage.component.ts +++ b/projects/ngx-openlayers/src/lib/layers/layerimage.component.ts @@ -30,12 +30,12 @@ export class LayerImageComponent extends LayerComponent implements OnInit, OnCha super(group || map); } - ngOnInit() { + ngOnInit(): void { this.instance = new Image(this); super.ngOnInit(); } - ngOnChanges(changes: SimpleChanges) { + ngOnChanges(changes: SimpleChanges): void { super.ngOnChanges(changes); } } diff --git a/projects/ngx-openlayers/src/lib/layers/layertile.component.ts b/projects/ngx-openlayers/src/lib/layers/layertile.component.ts index f60b6972..1af4de1e 100644 --- a/projects/ngx-openlayers/src/lib/layers/layertile.component.ts +++ b/projects/ngx-openlayers/src/lib/layers/layertile.component.ts @@ -21,13 +21,13 @@ export class LayerTileComponent extends LayerComponent implements OnInit, OnDest super(group || map); } - ngOnInit() { + ngOnInit(): void { // console.log('creating ol.layer.Tile instance with:', this); this.instance = new Tile(this); super.ngOnInit(); } - ngOnChanges(changes: SimpleChanges) { + ngOnChanges(changes: SimpleChanges): void { super.ngOnChanges(changes); } } diff --git a/projects/ngx-openlayers/src/lib/layers/layervector.component.ts b/projects/ngx-openlayers/src/lib/layers/layervector.component.ts index 7ac3dc75..b706437f 100644 --- a/projects/ngx-openlayers/src/lib/layers/layervector.component.ts +++ b/projects/ngx-openlayers/src/lib/layers/layervector.component.ts @@ -30,13 +30,13 @@ export class LayerVectorComponent extends LayerComponent implements OnInit, OnDe super(group || map); } - ngOnInit() { + ngOnInit(): void { // console.log('creating ol.layer.Vector instance with:', this); this.instance = new Vector(this); super.ngOnInit(); } - ngOnChanges(changes: SimpleChanges) { + ngOnChanges(changes: SimpleChanges): void { super.ngOnChanges(changes); } } diff --git a/projects/ngx-openlayers/src/lib/layers/layervectortile.component.ts b/projects/ngx-openlayers/src/lib/layers/layervectortile.component.ts index ffccd9bf..82f9e354 100644 --- a/projects/ngx-openlayers/src/lib/layers/layervectortile.component.ts +++ b/projects/ngx-openlayers/src/lib/layers/layervectortile.component.ts @@ -35,13 +35,13 @@ export class LayerVectorTileComponent extends LayerComponent implements OnInit, super(group || map); } - ngOnInit() { + ngOnInit(): void { // console.log('creating ol.layer.VectorTile instance with:', this); this.instance = new VectorTile(this); super.ngOnInit(); } - ngOnChanges(changes: SimpleChanges) { + ngOnChanges(changes: SimpleChanges): void { super.ngOnChanges(changes); } } diff --git a/projects/ngx-openlayers/src/lib/map.component.ts b/projects/ngx-openlayers/src/lib/map.component.ts index 805efae8..683850e8 100644 --- a/projects/ngx-openlayers/src/lib/map.component.ts +++ b/projects/ngx-openlayers/src/lib/map.component.ts @@ -85,7 +85,7 @@ export class MapComponent implements OnInit, AfterViewInit, OnChanges { this.singleClick = new EventEmitter>(); } - ngOnInit() { + ngOnInit(): void { // console.log('creating ol.Map instance with:', this); this.instance = new Map(this); this.instance.setTarget(this.host.nativeElement.firstElementChild); @@ -102,7 +102,7 @@ export class MapComponent implements OnInit, AfterViewInit, OnChanges { this.instance.on('singleclick', (event: MapBrowserEvent) => this.singleClick.emit(event)); } - ngOnChanges(changes: SimpleChanges) { + ngOnChanges(changes: SimpleChanges): void { const properties: { [index: string]: any } = {}; if (!this.instance) { return; @@ -116,7 +116,7 @@ export class MapComponent implements OnInit, AfterViewInit, OnChanges { this.instance.setProperties(properties, false); } - ngAfterViewInit() { + ngAfterViewInit(): void { this.instance.updateSize(); } } diff --git a/projects/ngx-openlayers/src/lib/overlay.component.ts b/projects/ngx-openlayers/src/lib/overlay.component.ts index e0ba6e18..b5a8e639 100644 --- a/projects/ngx-openlayers/src/lib/overlay.component.ts +++ b/projects/ngx-openlayers/src/lib/overlay.component.ts @@ -35,7 +35,7 @@ export class OverlayComponent implements OnInit, OnDestroy { constructor(private map: MapComponent) {} - ngOnInit() { + ngOnInit(): void { if (this.content) { this.element = this.content.elementRef.nativeElement; this.instance = new Overlay(this); @@ -43,7 +43,7 @@ export class OverlayComponent implements OnInit, OnDestroy { } } - ngOnDestroy() { + ngOnDestroy(): void { if (this.instance) { this.map.instance.removeOverlay(this.instance); } diff --git a/projects/ngx-openlayers/src/lib/sources/bingmaps.component.ts b/projects/ngx-openlayers/src/lib/sources/bingmaps.component.ts index 1eeb7d19..56c08bf8 100644 --- a/projects/ngx-openlayers/src/lib/sources/bingmaps.component.ts +++ b/projects/ngx-openlayers/src/lib/sources/bingmaps.component.ts @@ -35,7 +35,7 @@ export class SourceBingmapsComponent extends SourceComponent implements OnInit { super(layer); } - ngOnInit() { + ngOnInit(): void { this.instance = new BingMaps(this); this.host.instance.setSource(this.instance); } diff --git a/projects/ngx-openlayers/src/lib/sources/cluster.component.ts b/projects/ngx-openlayers/src/lib/sources/cluster.component.ts index b732a8c7..755066c3 100644 --- a/projects/ngx-openlayers/src/lib/sources/cluster.component.ts +++ b/projects/ngx-openlayers/src/lib/sources/cluster.component.ts @@ -38,14 +38,14 @@ export class SourceClusterComponent extends SourceComponent implements AfterCont super(layer); } - ngAfterContentInit() { + ngAfterContentInit(): void { this.source = this.sourceVectorComponent.instance; this.instance = new Cluster(this); this.host.instance.setSource(this.instance); } - ngOnChanges(changes: SimpleChanges) { + ngOnChanges(changes: SimpleChanges): void { if (this.instance && changes.hasOwnProperty('distance')) { this.instance.setDistance(this.distance); } diff --git a/projects/ngx-openlayers/src/lib/sources/geojson.component.ts b/projects/ngx-openlayers/src/lib/sources/geojson.component.ts index 02943ae2..0d84f2c0 100644 --- a/projects/ngx-openlayers/src/lib/sources/geojson.component.ts +++ b/projects/ngx-openlayers/src/lib/sources/geojson.component.ts @@ -28,7 +28,7 @@ export class SourceGeoJSONComponent extends SourceComponent implements OnInit { super(layer); } - ngOnInit() { + ngOnInit(): void { this.format = new GeoJSON(this); this.instance = new Vector(this); this.host.instance.setSource(this.instance); diff --git a/projects/ngx-openlayers/src/lib/sources/imagearcgisrest.component.ts b/projects/ngx-openlayers/src/lib/sources/imagearcgisrest.component.ts index c59f5f56..36c2edc2 100644 --- a/projects/ngx-openlayers/src/lib/sources/imagearcgisrest.component.ts +++ b/projects/ngx-openlayers/src/lib/sources/imagearcgisrest.component.ts @@ -46,7 +46,7 @@ export class SourceImageArcGISRestComponent extends SourceComponent implements O super(layer); } - ngOnInit() { + ngOnInit(): void { this.instance = new ImageArcGISRest(this); this.host.instance.setSource(this.instance); this.instance.on('imageloadstart', (event: ImageSourceEvent) => this.imageLoadStart.emit(event)); @@ -54,7 +54,7 @@ export class SourceImageArcGISRestComponent extends SourceComponent implements O this.instance.on('imageloaderror', (event: ImageSourceEvent) => this.imageLoadError.emit(event)); } - ngOnChanges(changes: SimpleChanges) { + ngOnChanges(changes: SimpleChanges): void { if (this.instance && changes.hasOwnProperty('params')) { this.instance.updateParams(this.params); } diff --git a/projects/ngx-openlayers/src/lib/sources/imagestatic.component.ts b/projects/ngx-openlayers/src/lib/sources/imagestatic.component.ts index 0df30445..45006d2d 100644 --- a/projects/ngx-openlayers/src/lib/sources/imagestatic.component.ts +++ b/projects/ngx-openlayers/src/lib/sources/imagestatic.component.ts @@ -61,11 +61,11 @@ export class SourceImageStaticComponent extends SourceComponent implements OnIni this.instance.on('imageloaderror', (event: ImageSourceEvent) => this.imageLoadError.emit(event)); } - ngOnInit() { + ngOnInit(): void { this.setLayerSource(); } - ngOnChanges(changes: SimpleChanges) { + ngOnChanges(changes: SimpleChanges): void { const properties: { [index: string]: any } = {}; if (!this.instance) { return; diff --git a/projects/ngx-openlayers/src/lib/sources/imagewms.component.ts b/projects/ngx-openlayers/src/lib/sources/imagewms.component.ts index 6cd1e04a..ee4371c8 100644 --- a/projects/ngx-openlayers/src/lib/sources/imagewms.component.ts +++ b/projects/ngx-openlayers/src/lib/sources/imagewms.component.ts @@ -58,7 +58,7 @@ export class SourceImageWMSComponent extends SourceComponent implements OnChange super(layer); } - ngOnInit() { + ngOnInit(): void { this.instance = new ImageWMS(this); this.host.instance.setSource(this.instance); this.instance.on('imageloadstart', (event: ImageSourceEvent) => this.imageLoadStart.emit(event)); @@ -66,7 +66,7 @@ export class SourceImageWMSComponent extends SourceComponent implements OnChange this.instance.on('imageloaderror', (event: ImageSourceEvent) => this.imageLoadError.emit(event)); } - ngOnChanges(changes: SimpleChanges) { + ngOnChanges(changes: SimpleChanges): void { if (this.instance && changes.hasOwnProperty('params')) { this.instance.updateParams(this.params); } diff --git a/projects/ngx-openlayers/src/lib/sources/osm.component.ts b/projects/ngx-openlayers/src/lib/sources/osm.component.ts index 62cf7c48..f9cf67fa 100644 --- a/projects/ngx-openlayers/src/lib/sources/osm.component.ts +++ b/projects/ngx-openlayers/src/lib/sources/osm.component.ts @@ -49,7 +49,7 @@ export class SourceOsmComponent extends SourceXYZComponent implements AfterConte super(layer); } - ngAfterContentInit() { + ngAfterContentInit(): void { if (this.tileGridXYZ) { this.tileGrid = this.tileGridXYZ.instance; } diff --git a/projects/ngx-openlayers/src/lib/sources/raster.component.ts b/projects/ngx-openlayers/src/lib/sources/raster.component.ts index a497cd29..4d30d865 100644 --- a/projects/ngx-openlayers/src/lib/sources/raster.component.ts +++ b/projects/ngx-openlayers/src/lib/sources/raster.component.ts @@ -55,11 +55,11 @@ export class SourceRasterComponent extends SourceComponent implements AfterConte } } - ngAfterContentInit() { + ngAfterContentInit(): void { this.init(); } - init() { + init(): void { this.instance = new Raster(this); this.instance.on('beforeoperations', (event: RasterSourceEvent) => this.beforeOperations.emit(event)); this.instance.on('afteroperations', (event: RasterSourceEvent) => this.afterOperations.emit(event)); diff --git a/projects/ngx-openlayers/src/lib/sources/source.component.ts b/projects/ngx-openlayers/src/lib/sources/source.component.ts index b0e32923..c4ac82f7 100644 --- a/projects/ngx-openlayers/src/lib/sources/source.component.ts +++ b/projects/ngx-openlayers/src/lib/sources/source.component.ts @@ -13,13 +13,13 @@ export abstract class SourceComponent implements OnDestroy { constructor(protected host: LayerComponent) {} - ngOnDestroy() { + ngOnDestroy(): void { if (this.host && this.host.instance) { this.host.instance.setSource(null); } } - protected _register(s: Source) { + protected _register(s: Source): void { if (this.host) { this.host.instance.setSource(s); } diff --git a/projects/ngx-openlayers/src/lib/sources/tilejson.component.ts b/projects/ngx-openlayers/src/lib/sources/tilejson.component.ts index f98a0ede..a8ac1eae 100644 --- a/projects/ngx-openlayers/src/lib/sources/tilejson.component.ts +++ b/projects/ngx-openlayers/src/lib/sources/tilejson.component.ts @@ -1,4 +1,4 @@ -import { Component, Host, Input, OnInit, forwardRef } from '@angular/core'; +import { Component, forwardRef, Host, Input, OnInit } from '@angular/core'; import { TileJSON } from 'ol/source'; import { LayerTileComponent } from '../layers/layertile.component'; import { SourceComponent } from './source.component'; @@ -18,7 +18,7 @@ export class SourceTileJSONComponent extends SourceComponent implements OnInit { super(layer); } - ngOnInit() { + ngOnInit(): void { this.instance = new TileJSON(this); this.host.instance.setSource(this.instance); } diff --git a/projects/ngx-openlayers/src/lib/sources/tilewms.component.ts b/projects/ngx-openlayers/src/lib/sources/tilewms.component.ts index fa016558..d77e12bb 100644 --- a/projects/ngx-openlayers/src/lib/sources/tilewms.component.ts +++ b/projects/ngx-openlayers/src/lib/sources/tilewms.component.ts @@ -46,12 +46,12 @@ export class SourceTileWMSComponent extends SourceComponent implements OnChanges super(layer); } - ngOnInit() { + ngOnInit(): void { this.instance = new TileWMS(this); this.host.instance.setSource(this.instance); } - ngOnChanges(changes: SimpleChanges) { + ngOnChanges(changes: SimpleChanges): void { if (this.instance && changes.hasOwnProperty('params')) { this.instance.updateParams(this.params); } diff --git a/projects/ngx-openlayers/src/lib/sources/tilewmts.component.ts b/projects/ngx-openlayers/src/lib/sources/tilewmts.component.ts index 0f29dc67..1aa9bca6 100644 --- a/projects/ngx-openlayers/src/lib/sources/tilewmts.component.ts +++ b/projects/ngx-openlayers/src/lib/sources/tilewmts.component.ts @@ -79,8 +79,8 @@ export class SourceTileWMTSComponent extends SourceComponent implements AfterCon super(layer); } - ngOnChanges(changes: SimpleChanges) { - const properties: { [index: string]: any } = {}; + ngOnChanges(changes: SimpleChanges): void { + const properties: { [index: string]: unknown } = {}; if (!this.instance) { return; } diff --git a/projects/ngx-openlayers/src/lib/sources/utfgrid.component.ts b/projects/ngx-openlayers/src/lib/sources/utfgrid.component.ts index c324f5d1..e61b822b 100644 --- a/projects/ngx-openlayers/src/lib/sources/utfgrid.component.ts +++ b/projects/ngx-openlayers/src/lib/sources/utfgrid.component.ts @@ -1,4 +1,4 @@ -import { Component, Host, Input, OnInit, forwardRef } from '@angular/core'; +import { Component, forwardRef, Host, Input, OnInit } from '@angular/core'; import { UTFGrid } from 'ol/source'; import { Config } from 'ol/source/TileJSON'; import { LayerTileComponent } from '../layers/layertile.component'; @@ -19,7 +19,7 @@ export class SourceUTFGridComponent extends SourceComponent implements OnInit { super(layer); } - ngOnInit() { + ngOnInit(): void { this.instance = new UTFGrid(this); this.host.instance.setSource(this.instance); } diff --git a/projects/ngx-openlayers/src/lib/sources/vector.component.ts b/projects/ngx-openlayers/src/lib/sources/vector.component.ts index 6a58c905..7c162205 100644 --- a/projects/ngx-openlayers/src/lib/sources/vector.component.ts +++ b/projects/ngx-openlayers/src/lib/sources/vector.component.ts @@ -1,4 +1,4 @@ -import { Component, Host, Input, OnInit, forwardRef } from '@angular/core'; +import { Component, forwardRef, Host, Input, OnInit } from '@angular/core'; import { Vector } from 'ol/source'; import Feature from 'ol/format/Feature'; import { LayerVectorComponent } from '../layers/layervector.component'; @@ -30,7 +30,7 @@ export class SourceVectorComponent extends SourceComponent implements OnInit { super(layer); } - ngOnInit() { + ngOnInit(): void { this.instance = new Vector(this); this.host.instance.setSource(this.instance); } diff --git a/projects/ngx-openlayers/src/lib/sources/vectortile.component.ts b/projects/ngx-openlayers/src/lib/sources/vectortile.component.ts index eca83cce..9ddab894 100644 --- a/projects/ngx-openlayers/src/lib/sources/vectortile.component.ts +++ b/projects/ngx-openlayers/src/lib/sources/vectortile.component.ts @@ -47,7 +47,7 @@ export class SourceVectorTileComponent extends SourceComponent implements AfterC } /* need the children to construct the OL3 object */ - ngAfterContentInit() { + ngAfterContentInit(): void { this.format = this.formatComponent.instance; this.tileGrid = this.tileGridComponent.instance; // console.log('creating ol.source.VectorTile instance with:', this); diff --git a/projects/ngx-openlayers/src/lib/sources/xyz.component.ts b/projects/ngx-openlayers/src/lib/sources/xyz.component.ts index fd869e30..c209ead0 100644 --- a/projects/ngx-openlayers/src/lib/sources/xyz.component.ts +++ b/projects/ngx-openlayers/src/lib/sources/xyz.component.ts @@ -78,15 +78,15 @@ export class SourceXYZComponent extends SourceComponent implements AfterContentI super(layer); } - ngAfterContentInit() { + ngAfterContentInit(): void { if (this.tileGridXYZ) { this.tileGrid = this.tileGridXYZ.instance; } this.init(); } - ngOnChanges(changes: SimpleChanges) { - const properties: { [index: string]: any } = {}; + ngOnChanges(changes: SimpleChanges): void { + const properties: { [index: string]: unknown } = {}; if (!this.instance) { return; @@ -103,7 +103,7 @@ export class SourceXYZComponent extends SourceComponent implements AfterContentI } } - init() { + init(): void { this.instance = new XYZ(this); this.instance.on('tileloadstart', (event: TileSourceEvent) => this.tileLoadStart.emit(event)); diff --git a/projects/ngx-openlayers/src/lib/styles/circle.component.ts b/projects/ngx-openlayers/src/lib/styles/circle.component.ts index a8f209fe..b9490a2b 100644 --- a/projects/ngx-openlayers/src/lib/styles/circle.component.ts +++ b/projects/ngx-openlayers/src/lib/styles/circle.component.ts @@ -24,7 +24,7 @@ export class StyleCircleComponent implements AfterContentInit, OnChanges, OnDest * we trigger a radius change. * see openlayers #6233 and #5775 */ - update() { + update(): void { if (!!this.instance) { // console.log('setting ol.style.Circle instance\'s radius'); this.instance.setRadius(this.radius); @@ -32,14 +32,14 @@ export class StyleCircleComponent implements AfterContentInit, OnChanges, OnDest this.host.update(); } - ngAfterContentInit() { + ngAfterContentInit(): void { // console.log('creating ol.style.Circle instance with: ', this); this.instance = new Circle(this); this.host.instance.setImage(this.instance); this.host.update(); } - ngOnChanges(changes: SimpleChanges) { + ngOnChanges(changes: SimpleChanges): void { if (!this.instance) { return; } @@ -49,7 +49,7 @@ export class StyleCircleComponent implements AfterContentInit, OnChanges, OnDest // console.log('changes detected in aol-style-circle, setting new radius: ', changes['radius'].currentValue); } - ngOnDestroy() { + ngOnDestroy(): void { // console.log('removing aol-style-circle'); this.host.instance.setImage(null); } diff --git a/projects/ngx-openlayers/src/lib/styles/fill.component.ts b/projects/ngx-openlayers/src/lib/styles/fill.component.ts index a577716c..c0f4151a 100644 --- a/projects/ngx-openlayers/src/lib/styles/fill.component.ts +++ b/projects/ngx-openlayers/src/lib/styles/fill.component.ts @@ -36,7 +36,7 @@ export class StyleFillComponent implements OnInit, OnChanges { // console.log('creating aol-style-fill with: ', this); } - ngOnInit() { + ngOnInit(): void { // console.log('creating ol.style.Fill instance with: ', this); this.instance = new Fill(this); switch (this.host.componentType) { @@ -57,7 +57,7 @@ export class StyleFillComponent implements OnInit, OnChanges { } } - ngOnChanges(changes: SimpleChanges) { + ngOnChanges(changes: SimpleChanges): void { if (!this.instance) { return; } diff --git a/projects/ngx-openlayers/src/lib/styles/icon.component.ts b/projects/ngx-openlayers/src/lib/styles/icon.component.ts index 1534ff4b..df6bccbd 100644 --- a/projects/ngx-openlayers/src/lib/styles/icon.component.ts +++ b/projects/ngx-openlayers/src/lib/styles/icon.component.ts @@ -3,11 +3,9 @@ import { Color } from 'ol/color'; import { Size } from 'ol/size'; import { Icon } from 'ol/style'; import { StyleComponent } from './style.component'; -import IconAnchorUnits from 'ol/style/IconAnchorUnits'; -import IconOrigin from 'ol/style/IconOrigin'; -type IconAnchorUnits = typeof IconAnchorUnits; -type IconOrigin = typeof IconOrigin; +type IconAnchorUnits = 'fraction' | 'pixels'; +type IconOrigin = 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right'; @Component({ selector: 'aol-style-icon', @@ -53,13 +51,13 @@ export class StyleIconComponent implements OnInit, OnChanges { constructor(@Host() private host: StyleComponent) {} - ngOnInit() { + ngOnInit(): void { // console.log('creating ol.style.Icon instance with: ', this); this.instance = new Icon(this); this.host.instance.setImage(this.instance); } - ngOnChanges(changes: SimpleChanges) { + ngOnChanges(changes: SimpleChanges): void { if (!this.instance) { return; } diff --git a/projects/ngx-openlayers/src/lib/styles/stroke.component.ts b/projects/ngx-openlayers/src/lib/styles/stroke.component.ts index 57b68b16..00d62c93 100644 --- a/projects/ngx-openlayers/src/lib/styles/stroke.component.ts +++ b/projects/ngx-openlayers/src/lib/styles/stroke.component.ts @@ -46,7 +46,7 @@ export class StyleStrokeComponent implements OnInit, OnChanges { // console.log('creating aol-style-stroke with: ', this); } - ngOnInit() { + ngOnInit(): void { // console.log('creating ol.style.Stroke instance with: ', this); this.instance = new Stroke(this); switch (this.host.componentType) { @@ -67,7 +67,7 @@ export class StyleStrokeComponent implements OnInit, OnChanges { } } - ngOnChanges(changes: SimpleChanges) { + ngOnChanges(changes: SimpleChanges): void { if (!this.instance) { return; } diff --git a/projects/ngx-openlayers/src/lib/styles/style.component.ts b/projects/ngx-openlayers/src/lib/styles/style.component.ts index 92cec3d7..79099c7a 100644 --- a/projects/ngx-openlayers/src/lib/styles/style.component.ts +++ b/projects/ngx-openlayers/src/lib/styles/style.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, Optional, OnInit } from '@angular/core'; +import { Component, Input, OnInit, Optional } from '@angular/core'; import { Fill, Image, Stroke, Style, Text } from 'ol/style'; import { Geometry } from 'ol/geom'; import { FeatureComponent } from '../feature.component'; @@ -35,12 +35,12 @@ export class StyleComponent implements OnInit { } } - update() { + update(): void { // console.log('updating style\'s host: ', this.host); this.host.instance.changed(); } - ngOnInit() { + ngOnInit(): void { // console.log('creating aol-style instance with: ', this); this.instance = new Style(this); this.host.instance.setStyle(this.instance); diff --git a/projects/ngx-openlayers/src/lib/styles/text.component.ts b/projects/ngx-openlayers/src/lib/styles/text.component.ts index f6848bd2..b69e1d10 100644 --- a/projects/ngx-openlayers/src/lib/styles/text.component.ts +++ b/projects/ngx-openlayers/src/lib/styles/text.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, Optional, OnInit, OnChanges, SimpleChanges } from '@angular/core'; +import { Component, Input, OnChanges, OnInit, Optional, SimpleChanges } from '@angular/core'; import { Text } from 'ol/style'; import { StyleComponent } from './style.component'; @@ -36,13 +36,13 @@ export class StyleTextComponent implements OnInit, OnChanges { // console.log('creating aol-style-text with: ', this); } - ngOnInit() { + ngOnInit(): void { // console.log('creating ol.style.Text instance with: ', this); this.instance = new Text(this); this.host.instance.setText(this.instance); } - ngOnChanges(changes: SimpleChanges) { + ngOnChanges(changes: SimpleChanges): void { if (!this.instance) { return; } diff --git a/projects/ngx-openlayers/src/lib/tilegrid.component.ts b/projects/ngx-openlayers/src/lib/tilegrid.component.ts index aaf0a11a..47d689b6 100644 --- a/projects/ngx-openlayers/src/lib/tilegrid.component.ts +++ b/projects/ngx-openlayers/src/lib/tilegrid.component.ts @@ -25,7 +25,7 @@ export class TileGridComponent implements OnInit, OnChanges { instance: TileGrid; - ngOnInit() { + ngOnInit(): void { if (!this.resolutions) { this.instance = createXYZ(this); } else { @@ -33,7 +33,7 @@ export class TileGridComponent implements OnInit, OnChanges { } } - ngOnChanges(changes: SimpleChanges) { + ngOnChanges(changes: SimpleChanges): void { if (!this.resolutions) { this.instance = createXYZ(this); } else { diff --git a/projects/ngx-openlayers/src/lib/tilegridwmts.component.ts b/projects/ngx-openlayers/src/lib/tilegridwmts.component.ts index d95459d7..8c26be93 100644 --- a/projects/ngx-openlayers/src/lib/tilegridwmts.component.ts +++ b/projects/ngx-openlayers/src/lib/tilegridwmts.component.ts @@ -26,7 +26,7 @@ export class TileGridWMTSComponent extends TileGridComponent implements OnInit { instance: WMTS; - ngOnInit() { + ngOnInit(): void { this.instance = new WMTS(this); } } diff --git a/projects/ngx-openlayers/src/lib/view.component.ts b/projects/ngx-openlayers/src/lib/view.component.ts index 98992773..a8c04e56 100644 --- a/projects/ngx-openlayers/src/lib/view.component.ts +++ b/projects/ngx-openlayers/src/lib/view.component.ts @@ -1,15 +1,16 @@ -import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges } from '@angular/core'; +import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core'; import { ObjectEvent } from 'ol/Object'; import View from 'ol/View'; import { Coordinate } from 'ol/coordinate'; import { Extent } from 'ol/extent'; import { MapComponent } from './map.component'; +import { ProjectionLike } from 'ol/proj'; @Component({ selector: 'aol-view', template: ` `, }) -export class ViewComponent implements OnInit, OnChanges, OnDestroy { +export class ViewComponent implements OnInit, OnChanges { @Input() constrainRotation: boolean | number; @Input() @@ -37,7 +38,7 @@ export class ViewComponent implements OnInit, OnChanges, OnDestroy { @Input() center: Coordinate; @Input() - projection: string; + projection: ProjectionLike; @Input() constrainOnlyCenter: boolean; @Input() @@ -64,7 +65,7 @@ export class ViewComponent implements OnInit, OnChanges, OnDestroy { constructor(private host: MapComponent) {} - ngOnInit() { + ngOnInit(): void { // console.log('creating ol.View instance with: ', this); this.instance = new View(this); this.host.instance.setView(this.instance); @@ -73,8 +74,8 @@ export class ViewComponent implements OnInit, OnChanges, OnDestroy { this.instance.on('change:center', (event: ObjectEvent) => this.changeCenter.emit(event)); } - ngOnChanges(changes: SimpleChanges) { - const properties: { [index: string]: any } = {}; + ngOnChanges(changes: SimpleChanges): void { + const properties: { [index: string]: unknown } = {}; if (!this.instance) { return; } @@ -106,8 +107,4 @@ export class ViewComponent implements OnInit, OnChanges, OnDestroy { // console.log('changes detected in aol-view, setting new properties: ', properties); this.instance.setProperties(properties, false); } - - ngOnDestroy() { - // console.log('removing aol-view'); - } } diff --git a/projects/ngx-openlayers/src/test.ts b/projects/ngx-openlayers/src/test.ts index 4c670a6e..15146d5d 100644 --- a/projects/ngx-openlayers/src/test.ts +++ b/projects/ngx-openlayers/src/test.ts @@ -5,7 +5,16 @@ import 'zone.js/testing'; import { getTestBed } from '@angular/core/testing'; import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing'; -declare const require: any; +declare const require: { + context( + path: string, + deep?: boolean, + filter?: RegExp + ): { + (id: string): T; + keys(): string[]; + }; +}; // First, initialize the Angular testing environment. getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), { diff --git a/src/app/arcgis-image/arcgis-image.component.ts b/src/app/arcgis-image/arcgis-image.component.ts index af6f9785..3d263336 100644 --- a/src/app/arcgis-image/arcgis-image.component.ts +++ b/src/app/arcgis-image/arcgis-image.component.ts @@ -39,11 +39,11 @@ export class ArcgisImageComponent { public zoom = 4; public opacity = 1.0; - imageLoadStart() { + imageLoadStart(): void { console.log('image starts loading at: ' + new Date()); } - imageLoadEnd() { + imageLoadEnd(): void { console.log('image ends loading at: ' + new Date()); } } diff --git a/src/app/basic/basic.component.ts b/src/app/basic/basic.component.ts index 445a75be..f85d1803 100644 --- a/src/app/basic/basic.component.ts +++ b/src/app/basic/basic.component.ts @@ -1,6 +1,4 @@ import { Component } from '@angular/core'; -import IconAnchorUnits from 'ol/style/IconAnchorUnits'; -import IconOrigin from 'ol/style/IconOrigin'; @Component({ selector: 'app-root', @@ -36,10 +34,10 @@ import IconOrigin from 'ol/style/IconOrigin'; @@ -80,58 +78,55 @@ export class BasicComponent { public lon = 5; public lat = 45; - protected readonly IconAnchorUnits = IconAnchorUnits; - protected readonly IconOrigin = IconOrigin; - - increaseZoom() { + increaseZoom(): void { this.zoom = Math.min(this.zoom + 1, 18); console.log('zoom: ', this.zoom); } - decreaseZoom() { + decreaseZoom(): void { this.zoom = Math.max(this.zoom - 1, 1); console.log('zoom: ', this.zoom); } - increaseLat() { + increaseLat(): void { this.lat = Math.max(-90, Math.min(90, this.lat + 1)); console.log('lat: ', this.lat); } - decreaseLat() { + decreaseLat(): void { this.lat = Math.max(-90, Math.min(90, this.lat - 1)); console.log('lat: ', this.lat); } - increaseLon() { + increaseLon(): void { this.lon = Math.max(-180, Math.min(180, this.lat + 1)); console.log('lon: ', this.lon); } - decreaseLon() { + decreaseLon(): void { this.lon = Math.max(-180, Math.min(180, this.lat - 1)); console.log('lon: ', this.lon); } - increaseOpacity() { + increaseOpacity(): void { this.opacity = Math.min(this.opacity + 0.1, 1); console.log('opacity: ', this.opacity); } - decreaseOpacity() { + decreaseOpacity(): void { this.opacity = Math.max(this.opacity - 0.1, 0); console.log('opacity: ', this.opacity); } - changeResolution(evt) { + changeResolution(evt): void { console.log('Resolution changed:', evt); } - changeCenter(evt) { + changeCenter(evt): void { console.log('Center changed:', evt); } - changeZoom(evt) { + changeZoom(evt): void { console.log('Zoom changed:', evt); } } diff --git a/src/app/cluster/cluster.component.ts b/src/app/cluster/cluster.component.ts index cacecf20..b84b5a3d 100644 --- a/src/app/cluster/cluster.component.ts +++ b/src/app/cluster/cluster.component.ts @@ -91,7 +91,7 @@ export class ClusterComponent implements OnInit { distance = 60; points: Array<{ x: number; y: number }> = []; - ngOnInit() { + ngOnInit(): void { // Generate random points const nbPoints = 2000; for (let i = 0; i < nbPoints; ++i) { @@ -102,7 +102,7 @@ export class ClusterComponent implements OnInit { } } - getRandomInRange(from, to, fixed) { + getRandomInRange(from, to, fixed): number { return (Math.random() * (to - from) + from).toFixed(fixed) * 1; } } diff --git a/src/app/color-select-hover/color-select-hover.component.ts b/src/app/color-select-hover/color-select-hover.component.ts index 2849a2f6..a8497d99 100644 --- a/src/app/color-select-hover/color-select-hover.component.ts +++ b/src/app/color-select-hover/color-select-hover.component.ts @@ -21,12 +21,12 @@ import { Fill, Stroke, Style } from 'ol/style'; - + - + @@ -137,7 +137,7 @@ export class ColorSelectHoverComponent { hoveredFeatureId; - changeFeatureHovered(event) { + changeFeatureHovered(event): void { const hit: Feature = this.map.instance.forEachFeatureAtPixel(event.pixel, (f) => f, { layerFilter: inLayer(...this.aoiLayerVector.toArray()), hitTolerance: 10, diff --git a/src/app/cursor-position/cursor-position.component.ts b/src/app/cursor-position/cursor-position.component.ts index 805dbbd2..1be438e0 100644 --- a/src/app/cursor-position/cursor-position.component.ts +++ b/src/app/cursor-position/cursor-position.component.ts @@ -55,11 +55,11 @@ export class CursorPositionComponent { this.lat = transform(coordinates, 'EPSG:3857', 'EPSG:4326')[1]; } - latToString(lat: number) { + latToString(lat: number): string { return toSexagesimal(lat, '', '-'); } - lonToString(lon: number) { + lonToString(lon: number): string { return toSexagesimal(lon, '', '-'); } } diff --git a/src/app/display-geojson-source/display-geojson-source.component.ts b/src/app/display-geojson-source/display-geojson-source.component.ts index 121fc4a9..7098824d 100644 --- a/src/app/display-geojson-source/display-geojson-source.component.ts +++ b/src/app/display-geojson-source/display-geojson-source.component.ts @@ -28,8 +28,4 @@ import { Component, OnInit } from '@angular/core'; `, }) -export class DisplayGeojsonSourceComponent implements OnInit { - constructor() {} - - ngOnInit() {} -} +export class DisplayGeojsonSourceComponent {} diff --git a/src/app/display-geometry/display-geometry.component.ts b/src/app/display-geometry/display-geometry.component.ts index 38f27d1b..cc797a53 100644 --- a/src/app/display-geometry/display-geometry.component.ts +++ b/src/app/display-geometry/display-geometry.component.ts @@ -15,12 +15,12 @@ import { Component } from '@angular/core'; - + - + @@ -30,8 +30,8 @@ import { Component } from '@angular/core'; @@ -48,7 +48,7 @@ import { Component } from '@angular/core'; - + @@ -58,13 +58,13 @@ import { Component } from '@angular/core'; - + @@ -74,7 +74,7 @@ import { Component } from '@angular/core'; - + @@ -89,7 +89,7 @@ import { Component } from '@angular/core'; - + @@ -97,12 +97,12 @@ import { Component } from '@angular/core'; - + - + diff --git a/src/app/draw-polygon/draw-polygon.component.ts b/src/app/draw-polygon/draw-polygon.component.ts index 0b52beda..b83450b2 100644 --- a/src/app/draw-polygon/draw-polygon.component.ts +++ b/src/app/draw-polygon/draw-polygon.component.ts @@ -68,11 +68,11 @@ export class DrawPolygonComponent { drawBoxGeometryFunction = createBox(); feature; - drawMode() { + drawMode(): void { this.isDrawing = !this.isDrawing; } - endDraw(feature: Feature) { + endDraw(feature: Feature): void { const olGeomPolygon = fromExtent(feature.getGeometry().getExtent()); olGeomPolygon.transform(new Projection({ code: 'EPSG:3857' }), new Projection({ code: 'EPSG:4326' })); this.feature = { diff --git a/src/app/examples-item/examples-item.component.ts b/src/app/examples-item/examples-item.component.ts index be9917a2..18aeb42f 100644 --- a/src/app/examples-item/examples-item.component.ts +++ b/src/app/examples-item/examples-item.component.ts @@ -59,7 +59,7 @@ import { Router } from '@angular/router'; export class ExamplesItemComponent implements OnInit { exampleInfo; constructor(private router: Router) {} - ngOnInit() { + ngOnInit(): void { this.exampleInfo = examplesList.find((item) => this.router.url.includes(item.routerLink)); } } diff --git a/src/app/examples-list/examples-list.component.ts b/src/app/examples-list/examples-list.component.ts index bcf042d8..52a0fc9f 100644 --- a/src/app/examples-list/examples-list.component.ts +++ b/src/app/examples-list/examples-list.component.ts @@ -81,7 +81,7 @@ export class ExamplesListComponent implements OnInit { constructor(private fb: FormBuilder) {} - ngOnInit() { + ngOnInit(): void { this.form = this.fb.group({ term: '', }); diff --git a/src/app/image-static/image-static.component.ts b/src/app/image-static/image-static.component.ts index c650f49e..a6247064 100644 --- a/src/app/image-static/image-static.component.ts +++ b/src/app/image-static/image-static.component.ts @@ -57,7 +57,7 @@ export class ImageStaticComponent { getCenter = (ext) => getCenter(ext); - onUrlChange(evt) { + onUrlChange(evt): void { this.url = evt.target.value; } } diff --git a/src/app/image-wms/image-wms.component.ts b/src/app/image-wms/image-wms.component.ts index 4b1b6d7b..0430e6da 100644 --- a/src/app/image-wms/image-wms.component.ts +++ b/src/app/image-wms/image-wms.component.ts @@ -5,7 +5,7 @@ import { Component } from '@angular/core'; template: ` - + @@ -60,6 +58,4 @@ export class MarkerComponent { lon: -2.264184, lat: 46.996207, }; - protected readonly IconAnchorUnits = IconAnchorUnits; - protected readonly IconOrigin = IconOrigin; } diff --git a/src/app/overlay/overlay.component.ts b/src/app/overlay/overlay.component.ts index 9b7c79d7..d8c936ea 100644 --- a/src/app/overlay/overlay.component.ts +++ b/src/app/overlay/overlay.component.ts @@ -83,7 +83,7 @@ export class OverlayComponent implements OnInit { text: 'Lorem ipsum dolor sit amet', }; - ngOnInit() { + ngOnInit(): void { const olFeature: OlFeature = this.geoJsonFormat.readFeature(this.feature); const olGeomPolygon = fromExtent(olFeature.getGeometry().getExtent()); [, this.tooltip.lat, this.tooltip.lon] = olGeomPolygon.getExtent(); diff --git a/src/app/raster/raster.component.ts b/src/app/raster/raster.component.ts index b0bf83f4..3eb316f8 100644 --- a/src/app/raster/raster.component.ts +++ b/src/app/raster/raster.component.ts @@ -20,7 +20,7 @@ interface RasterData { layer === this.markersLayer.instance; - select($event: SelectEvent) { + select($event: SelectEvent): void { console.log($event); } } diff --git a/src/app/side-by-side/side-by-side.component.ts b/src/app/side-by-side/side-by-side.component.ts index 8fa2a351..b6991511 100644 --- a/src/app/side-by-side/side-by-side.component.ts +++ b/src/app/side-by-side/side-by-side.component.ts @@ -43,7 +43,7 @@ export class SideBySideComponent implements AfterViewInit { @ViewChild('view', { static: true }) view: ViewComponent; - ngAfterViewInit() { + ngAfterViewInit(): void { this.secondMap.instance.setView(this.view.instance); } } diff --git a/src/app/swipe/swipe.component.ts b/src/app/swipe/swipe.component.ts index b7e0980e..ea7b3769 100644 --- a/src/app/swipe/swipe.component.ts +++ b/src/app/swipe/swipe.component.ts @@ -24,7 +24,7 @@ import { MapComponent } from 'ngx-openlayers'; class="swipe-button" [style.marginLeft.px]="swipeOffsetToCenter" (panstart)="onPanStart()" - (panmove)="onPan($event)" + (panmove)="onPan($any($event))" > <> @@ -72,16 +72,16 @@ export class SwipeComponent implements OnInit { paddingSize = 16; @HostListener('window:resize', ['$event']) - onWindowResize(event) { + onWindowResize(event): void { this.resetSwipeValues(); } - ngOnInit() { + ngOnInit(): void { this.prerenderFunction = this.prerender(); this.postrenderFunction = this.postrender(); } - prerender() { + prerender(): (event) => void { return (event) => { const ctx = event.context; const width = ctx.canvas.width * (this.swipeValue / 100); @@ -93,14 +93,14 @@ export class SwipeComponent implements OnInit { }; } - postrender() { + postrender(): (event) => void { return (event) => { const ctx = event.context; ctx.restore(); }; } - resetSwipeValues() { + resetSwipeValues(): void { this.startX = 0; this.swipeOffsetToCenter = 0; this.swipeValue = 50; @@ -111,7 +111,7 @@ export class SwipeComponent implements OnInit { this.startX = this.swipeOffsetToCenter; } - onPan(event: any): void { + onPan(event: HammerInput): void { event.preventDefault(); const swipePercentageMax = 98; const swipePercentageMin = 2; diff --git a/src/app/utfgrid/utfgrid.component.ts b/src/app/utfgrid/utfgrid.component.ts index 24f33467..6ed8dee5 100644 --- a/src/app/utfgrid/utfgrid.component.ts +++ b/src/app/utfgrid/utfgrid.component.ts @@ -16,7 +16,7 @@ import { SourceUTFGridComponent, ViewComponent } from 'ngx-openlayers'; [url]="'https://api.tiles.mapbox.com/v4/mapbox.geography-class.json?secure&access_token=' + key" > - + @@ -46,7 +46,7 @@ export class UTFGridComponent { coords: [number, number]; key = 'pk.eyJ1IjoieWFrb3VzdCIsImEiOiJjanVkc3Y0b2cwNWppM3lwaXd5M3JidHRzIn0.rJmuWPJnuKA9MJ9z5RPKZw'; - displayInfo(c) { + displayInfo(c): void { this.utfGrid.instance.forDataAtCoordinateAndResolution(c, this.view.instance.getResolution(), (data) => { if (data !== null && data !== undefined && data !== '') { this.info = data; diff --git a/src/app/view-projection-update/view-projection-update.component.ts b/src/app/view-projection-update/view-projection-update.component.ts index efd803a5..c6537aea 100644 --- a/src/app/view-projection-update/view-projection-update.component.ts +++ b/src/app/view-projection-update/view-projection-update.component.ts @@ -1,6 +1,4 @@ import { Component } from '@angular/core'; -import IconAnchorUnits from 'ol/style/IconAnchorUnits'; -import IconOrigin from 'ol/style/IconOrigin'; @Component({ selector: 'app-root', @@ -32,10 +30,10 @@ import IconOrigin from 'ol/style/IconOrigin'; @@ -72,10 +70,7 @@ import IconOrigin from 'ol/style/IconOrigin'; export class ViewProjectionUpdateComponent { public viewProjection = 'EPSG:3857'; - protected readonly IconAnchorUnits = IconAnchorUnits; - protected readonly IconOrigin = IconOrigin; - - projectionChange(evt) { + projectionChange(evt): void { console.log(`Projection changed to ${evt.target.value}`); this.viewProjection = evt.target.value; } diff --git a/tsconfig.json b/tsconfig.json index 715080c5..887f5c86 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -30,7 +30,8 @@ }, "angularCompilerOptions": { "enableI18nLegacyMessageIdFormat": false, - "fullTemplateTypeCheck": true, - "strictInjectionParameters": true + "strictInjectionParameters": true, + "strictInputAccessModifiers": true, + "strictTemplates": true } } diff --git a/yarn.lock b/yarn.lock index 9107b527..3d60c66b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1823,6 +1823,11 @@ resolved "https://registry.yarnpkg.com/@types/geojson/-/geojson-7946.0.14.tgz#319b63ad6df705ee2a65a73ef042c8271e696613" integrity sha512-WCfD5Ht3ZesJUsONdhvm84dmzWOiOzOAqOncN0++w0lBw1o8OuDNJF2McvvCef/yBqb/HYRahp1BYtODFQ8bRg== +"@types/hammerjs@^2.0.41": + version "2.0.45" + resolved "https://registry.yarnpkg.com/@types/hammerjs/-/hammerjs-2.0.45.tgz#ffa764bb68a66c08db6efb9c816eb7be850577b1" + integrity sha512-qkcUlZmX6c4J8q45taBKTL3p+LbITgyx7qhlPYOdOHZB7B31K0mXbP5YA7i7SgDeEGuI9MnumiKPEMrxg8j3KQ== + "@types/http-errors@*": version "2.0.4" resolved "https://registry.yarnpkg.com/@types/http-errors/-/http-errors-2.0.4.tgz#7eb47726c391b7345a6ec35ad7f4de469cf5ba4f"