diff --git a/package.json b/package.json index dc84ca14..232e4827 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "@angular/platform-browser": "~9.1.0", "@angular/platform-browser-dynamic": "~9.1.0", "@angular/router": "~9.1.0", + "@types/ol": "^6.3.1", "hammerjs": "^2.0.8", "ol": "~6.3.1", "rxjs": "~6.5.4", diff --git a/projects/ngx-openlayers/src/lib/attribution.component.ts b/projects/ngx-openlayers/src/lib/attribution.component.ts index 9d0300f6..28b0c990 100644 --- a/projects/ngx-openlayers/src/lib/attribution.component.ts +++ b/projects/ngx-openlayers/src/lib/attribution.component.ts @@ -1,18 +1,15 @@ import { Component, ElementRef, OnInit } from '@angular/core'; -import { Attribution } from 'ol/control'; @Component({ selector: 'aol-attribution', template: '', }) export class AttributionComponent implements OnInit { - instance: Attribution; - html: string; + label: string; constructor(private elementRef: ElementRef) {} ngOnInit() { - this.html = this.elementRef.nativeElement.innerHTML; - this.instance = new Attribution(this); + this.label = this.elementRef.nativeElement.innerHTML; } } diff --git a/projects/ngx-openlayers/src/lib/attributions.component.ts b/projects/ngx-openlayers/src/lib/attributions.component.ts index e5880573..a66c6eeb 100644 --- a/projects/ngx-openlayers/src/lib/attributions.component.ts +++ b/projects/ngx-openlayers/src/lib/attributions.component.ts @@ -8,7 +8,7 @@ import { AttributionComponent } from './attribution.component'; template: '', }) export class AttributionsComponent implements AfterViewInit { - instance: Array; + instance: Array; @ContentChildren(AttributionComponent) attributions: QueryList; @@ -18,7 +18,7 @@ export class AttributionsComponent implements AfterViewInit { /* we can do this at the very end */ ngAfterViewInit() { if (this.attributions.length) { - this.instance = this.attributions.map((cmp) => cmp.instance); + this.instance = this.attributions.map((cmp) => cmp.label); // console.log('setting attributions:', this.instance); this.source.instance.setAttributions(this.instance); } diff --git a/projects/ngx-openlayers/src/lib/controls/attribution.component.ts b/projects/ngx-openlayers/src/lib/controls/attribution.component.ts index 6de9ed71..2814db12 100644 --- a/projects/ngx-openlayers/src/lib/controls/attribution.component.ts +++ b/projects/ngx-openlayers/src/lib/controls/attribution.component.ts @@ -9,7 +9,7 @@ import { MapComponent } from '../map.component'; export class ControlAttributionComponent implements OnInit, OnDestroy { public componentType = 'control'; instance: Attribution; - target: Element; + target: HTMLElement; @Input() collapsible: boolean; diff --git a/projects/ngx-openlayers/src/lib/controls/control.component.ts b/projects/ngx-openlayers/src/lib/controls/control.component.ts index 780794c7..4b54224b 100644 --- a/projects/ngx-openlayers/src/lib/controls/control.component.ts +++ b/projects/ngx-openlayers/src/lib/controls/control.component.ts @@ -2,7 +2,6 @@ import { Component, ContentChild, OnDestroy, OnInit } from '@angular/core'; import { Control } from 'ol/control'; import { MapComponent } from '../map.component'; import { ContentComponent } from '../content.component'; -import { TileGridComponent } from '../tilegrid.component'; @Component({ selector: 'aol-control', @@ -11,7 +10,7 @@ import { TileGridComponent } from '../tilegrid.component'; export class ControlComponent implements OnInit, OnDestroy { public componentType = 'control'; instance: Control; - element: Element; + element: HTMLElement; @ContentChild(ContentComponent, { static: true }) content: ContentComponent; diff --git a/projects/ngx-openlayers/src/lib/controls/mouseposition.component.ts b/projects/ngx-openlayers/src/lib/controls/mouseposition.component.ts index fc4b8f1e..bdad2488 100644 --- a/projects/ngx-openlayers/src/lib/controls/mouseposition.component.ts +++ b/projects/ngx-openlayers/src/lib/controls/mouseposition.component.ts @@ -14,7 +14,7 @@ export class ControlMousePositionComponent implements OnInit, OnDestroy { coordinateFormat: CoordinateFormat; @Input() projection: ProjectionLike; - target: Element; + target: HTMLElement; constructor(private map: MapComponent, private element: ElementRef) {} diff --git a/projects/ngx-openlayers/src/lib/controls/overviewmap.component.ts b/projects/ngx-openlayers/src/lib/controls/overviewmap.component.ts index 33d7d4e1..c7ca3b4b 100644 --- a/projects/ngx-openlayers/src/lib/controls/overviewmap.component.ts +++ b/projects/ngx-openlayers/src/lib/controls/overviewmap.component.ts @@ -21,7 +21,7 @@ export class ControlOverviewMapComponent implements OnInit, OnChanges, OnDestroy @Input() layers: Layer[]; @Input() - target: Element; + target: HTMLElement; @Input() tipLabel: string; @Input() diff --git a/projects/ngx-openlayers/src/lib/controls/zoom.component.ts b/projects/ngx-openlayers/src/lib/controls/zoom.component.ts index 858ec8a2..4743ba26 100644 --- a/projects/ngx-openlayers/src/lib/controls/zoom.component.ts +++ b/projects/ngx-openlayers/src/lib/controls/zoom.component.ts @@ -12,9 +12,9 @@ export class ControlZoomComponent implements OnInit, OnDestroy { @Input() duration: number; @Input() - zoomInLabel: string | Node; + zoomInLabel: string | HTMLElement; @Input() - zoomOutLabel: string | Node; + zoomOutLabel: string | HTMLElement; @Input() zoomInTipLabel: string; @Input() diff --git a/projects/ngx-openlayers/src/lib/controls/zoomtoextent.component.ts b/projects/ngx-openlayers/src/lib/controls/zoomtoextent.component.ts index cda5d5e6..9f537b71 100644 --- a/projects/ngx-openlayers/src/lib/controls/zoomtoextent.component.ts +++ b/projects/ngx-openlayers/src/lib/controls/zoomtoextent.component.ts @@ -13,7 +13,7 @@ export class ControlZoomToExtentComponent implements OnInit, OnDestroy { @Input() className: string; @Input() - label: string | Node; + label: string | HTMLElement; @Input() tipLabel: string; @Input() diff --git a/projects/ngx-openlayers/src/lib/formats/mvt.component.ts b/projects/ngx-openlayers/src/lib/formats/mvt.component.ts index 89df4058..339580d4 100644 --- a/projects/ngx-openlayers/src/lib/formats/mvt.component.ts +++ b/projects/ngx-openlayers/src/lib/formats/mvt.component.ts @@ -1,8 +1,7 @@ import { Component, forwardRef, Input } from '@angular/core'; import { FormatComponent } from './format.component'; import { MVT } from 'ol/format'; -import { Geometry } from 'ol/geom'; -import GeometryType from 'ol/geom/GeometryType'; +import { FeatureClass } from 'ol/Feature'; @Component({ selector: 'aol-format-mvt', @@ -13,9 +12,7 @@ export class FormatMVTComponent extends FormatComponent { instance: MVT; @Input() - featureClass: - | ((geom: Geometry | { [k: string]: any }) => any) - | ((geom: GeometryType, arg2: number[], arg3: number[] | number[][], arg4: { [k: string]: any }) => any); + featureClass: FeatureClass; @Input() geometryName: string; @Input() diff --git a/projects/ngx-openlayers/src/lib/interactions/draganddrop.component.ts b/projects/ngx-openlayers/src/lib/interactions/draganddrop.component.ts index 4f4e353f..6db442fe 100644 --- a/projects/ngx-openlayers/src/lib/interactions/draganddrop.component.ts +++ b/projects/ngx-openlayers/src/lib/interactions/draganddrop.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnDestroy, OnInit } from '@angular/core'; import { DragAndDrop } from 'ol/interaction'; -import Feature from 'ol/format/Feature'; +import FeatureFormat from 'ol/format/Feature'; import { MapComponent } from '../map.component'; import { ProjectionLike } from 'ol/proj'; @@ -12,11 +12,11 @@ export class DragAndDropInteractionComponent implements OnInit, OnDestroy { instance: DragAndDrop; @Input() - formatConstructors: ((n: Feature) => any)[]; + formatConstructors: FeatureFormat[]; @Input() projection: ProjectionLike; @Input() - target: Element; + target: HTMLElement; constructor(private map: MapComponent) {} diff --git a/projects/ngx-openlayers/src/lib/layers/layer.component.ts b/projects/ngx-openlayers/src/lib/layers/layer.component.ts index 44dbbc9d..881a17ca 100644 --- a/projects/ngx-openlayers/src/lib/layers/layer.component.ts +++ b/projects/ngx-openlayers/src/lib/layers/layer.component.ts @@ -1,5 +1,5 @@ import { OnDestroy, OnInit, OnChanges, Input, SimpleChanges } from '@angular/core'; -import { Event } from 'ol/events'; +import Event from 'ol/events/Event'; import { MapComponent } from '../map.component'; import { LayerGroupComponent } from './layergroup.component'; import { Extent } from 'ol/extent'; diff --git a/projects/ngx-openlayers/src/lib/layers/layerimage.component.ts b/projects/ngx-openlayers/src/lib/layers/layerimage.component.ts index 094be961..66a6d9ca 100644 --- a/projects/ngx-openlayers/src/lib/layers/layerimage.component.ts +++ b/projects/ngx-openlayers/src/lib/layers/layerimage.component.ts @@ -10,8 +10,6 @@ import { Extent } from 'ol/extent'; template: ` `, }) export class LayerImageComponent extends LayerComponent implements OnInit, OnChanges { - public source: Image; - @Input() opacity: number; @Input() diff --git a/projects/ngx-openlayers/src/lib/layers/layertile.component.ts b/projects/ngx-openlayers/src/lib/layers/layertile.component.ts index 044a14d1..cfffe676 100644 --- a/projects/ngx-openlayers/src/lib/layers/layertile.component.ts +++ b/projects/ngx-openlayers/src/lib/layers/layertile.component.ts @@ -9,8 +9,6 @@ import { LayerGroupComponent } from './layergroup.component'; template: ` `, }) export class LayerTileComponent extends LayerComponent implements OnInit, OnDestroy, OnChanges { - public source: Tile; - @Input() preload: number; @Input() diff --git a/projects/ngx-openlayers/src/lib/layers/layervector.component.ts b/projects/ngx-openlayers/src/lib/layers/layervector.component.ts index bc204f87..06839093 100644 --- a/projects/ngx-openlayers/src/lib/layers/layervector.component.ts +++ b/projects/ngx-openlayers/src/lib/layers/layervector.component.ts @@ -11,8 +11,6 @@ import { LayerGroupComponent } from './layergroup.component'; template: ` `, }) export class LayerVectorComponent extends LayerComponent implements OnInit, OnDestroy, OnChanges { - public source: Vector; - @Input() renderBuffer: number; diff --git a/projects/ngx-openlayers/src/lib/layers/layervectortile.component.ts b/projects/ngx-openlayers/src/lib/layers/layervectortile.component.ts index c50d8f90..010dffbb 100644 --- a/projects/ngx-openlayers/src/lib/layers/layervectortile.component.ts +++ b/projects/ngx-openlayers/src/lib/layers/layervectortile.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit, Input, Optional, SimpleChanges, OnChanges } from '@angular/core'; import { VectorTile } from 'ol/layer'; -import { RenderType } from 'ol/layer/VectorTile'; +import VectorTileRenderType from 'ol/layer/VectorTileRenderType'; import { Feature } from 'ol'; import { Style } from 'ol/style'; import { MapComponent } from '../map.component'; @@ -16,7 +16,7 @@ export class LayerVectorTileComponent extends LayerComponent implements OnInit, @Input() renderBuffer: number; @Input() - renderMode: RenderType | string; + renderMode: VectorTileRenderType | string; /* not marked as optional in the typings */ @Input() renderOrder: (feature1: Feature, feature2: Feature) => number; diff --git a/projects/ngx-openlayers/src/lib/map.component.ts b/projects/ngx-openlayers/src/lib/map.component.ts index bab66eb9..82fc0c1d 100644 --- a/projects/ngx-openlayers/src/lib/map.component.ts +++ b/projects/ngx-openlayers/src/lib/map.component.ts @@ -9,10 +9,10 @@ import { SimpleChanges, OnChanges, } from '@angular/core'; -import Map from 'ol/Map'; +import { Map } from 'ol'; import MapBrowserEvent from 'ol/MapBrowserEvent'; import MapEvent from 'ol/MapEvent'; -import ObjectEvent from 'ol/Object'; +import { ObjectEvent } from 'ol/Object'; import RenderEvent from 'ol/render/Event'; import { Control } from 'ol/control'; import { Interaction } from 'ol/interaction'; @@ -35,7 +35,7 @@ export class MapComponent implements OnInit, AfterViewInit, OnChanges { @Input() pixelRatio: number; @Input() - keyboardEventTarget: Element | string; + keyboardEventTarget: HTMLElement | string; @Input() loadTilesWhileAnimating: boolean; @Input() diff --git a/projects/ngx-openlayers/src/lib/overlay.component.ts b/projects/ngx-openlayers/src/lib/overlay.component.ts index c48f3a8b..13d2992b 100644 --- a/projects/ngx-openlayers/src/lib/overlay.component.ts +++ b/projects/ngx-openlayers/src/lib/overlay.component.ts @@ -1,6 +1,6 @@ import { Component, ContentChild, Input, OnDestroy, OnInit } from '@angular/core'; import { MapComponent } from './map.component'; -import { Overlay, PanOptions } from 'ol'; +import Overlay, { PanOptions } from 'ol/Overlay'; import { ContentComponent } from './content.component'; import OverlayPositioning from 'ol/OverlayPositioning'; @@ -11,7 +11,7 @@ import OverlayPositioning from 'ol/OverlayPositioning'; export class OverlayComponent implements OnInit, OnDestroy { componentType = 'overlay'; instance: Overlay; - element: Element; + element: HTMLElement; @ContentChild(ContentComponent, { static: true }) content: ContentComponent; @@ -20,7 +20,7 @@ export class OverlayComponent implements OnInit, OnDestroy { @Input() offset: number[]; @Input() - positioning: OverlayPositioning | string; + positioning: OverlayPositioning; @Input() stopEvent: boolean; @Input() diff --git a/projects/ngx-openlayers/src/lib/sources/geojson.component.ts b/projects/ngx-openlayers/src/lib/sources/geojson.component.ts index 184f6602..1f23eca2 100644 --- a/projects/ngx-openlayers/src/lib/sources/geojson.component.ts +++ b/projects/ngx-openlayers/src/lib/sources/geojson.component.ts @@ -1,7 +1,7 @@ import { Component, Host, Input, OnInit, forwardRef } from '@angular/core'; import { LayerVectorComponent } from '../layers/layervector.component'; import { SourceComponent } from './source.component'; -import { Feature } from 'ol'; +import FeatureFormat from 'ol/format/Feature'; import { Vector } from 'ol/source'; import { GeoJSON } from 'ol/format'; import { ProjectionLike } from 'ol/proj'; @@ -13,7 +13,7 @@ import { ProjectionLike } from 'ol/proj'; }) export class SourceGeoJSONComponent extends SourceComponent implements OnInit { instance: Vector; - format: Feature; + format: FeatureFormat; @Input() defaultDataProjection: ProjectionLike; @Input() diff --git a/projects/ngx-openlayers/src/lib/sources/imagearcgisrest.component.ts b/projects/ngx-openlayers/src/lib/sources/imagearcgisrest.component.ts index 346f3aa5..2bb7ba1b 100644 --- a/projects/ngx-openlayers/src/lib/sources/imagearcgisrest.component.ts +++ b/projects/ngx-openlayers/src/lib/sources/imagearcgisrest.component.ts @@ -9,7 +9,7 @@ import { Output, SimpleChanges, } from '@angular/core'; -import { ImageArcGISRest } from 'ol/source'; +import ImageArcGISRest from 'ol/source/ImageArcGISRest'; import { LayerImageComponent } from '../layers/layerimage.component'; import { SourceComponent } from './source.component'; import { ProjectionLike } from 'ol/proj'; @@ -27,7 +27,7 @@ export class SourceImageArcGISRestComponent extends SourceComponent implements O @Input() projection: ProjectionLike | string; @Input() url: string; - @Input() attributions: AttributionLike[]; + @Input() attributions: AttributionLike; @Input() crossOrigin?: string; @Input() imageLoadFunction?: LoadFunction; @Input() params?: { [k: string]: any }; diff --git a/projects/ngx-openlayers/src/lib/sources/raster.component.ts b/projects/ngx-openlayers/src/lib/sources/raster.component.ts index 98ce81e3..153c39ed 100644 --- a/projects/ngx-openlayers/src/lib/sources/raster.component.ts +++ b/projects/ngx-openlayers/src/lib/sources/raster.component.ts @@ -9,7 +9,7 @@ import { Output, } from '@angular/core'; import { Raster, Source } from 'ol/source'; -import { Operation, RasterOperationType, RasterSourceEvent } from 'ol/source/Raster'; +import { Operation, RasterSourceEvent } from 'ol/source/Raster'; import { LayerImageComponent } from '../layers/layerimage.component'; import { SourceComponent } from './source.component'; @@ -34,7 +34,7 @@ export class SourceRasterComponent extends SourceComponent implements AfterConte @Input() lib?: any; @Input() - operationType?: RasterOperationType; + operationType?: 'pixel' | 'image'; @Output() beforeOperations: EventEmitter = new EventEmitter(); diff --git a/projects/ngx-openlayers/src/lib/sources/source.component.ts b/projects/ngx-openlayers/src/lib/sources/source.component.ts index e11878a3..7f831185 100644 --- a/projects/ngx-openlayers/src/lib/sources/source.component.ts +++ b/projects/ngx-openlayers/src/lib/sources/source.component.ts @@ -1,5 +1,5 @@ import { Input, OnDestroy } from '@angular/core'; -import { Source } from 'ol'; +import Source from 'ol/source/Source'; import { LayerComponent } from '../layers/layer.component'; diff --git a/projects/ngx-openlayers/src/lib/sources/tilewms.component.ts b/projects/ngx-openlayers/src/lib/sources/tilewms.component.ts index 2c1bc289..88761d57 100644 --- a/projects/ngx-openlayers/src/lib/sources/tilewms.component.ts +++ b/projects/ngx-openlayers/src/lib/sources/tilewms.component.ts @@ -2,7 +2,7 @@ import { Component, Host, Input, OnChanges, OnInit, forwardRef, SimpleChanges } import { LayerTileComponent } from '../layers/layertile.component'; import { SourceComponent } from './source.component'; import { TileWMS } from 'ol/source'; -import { TileGrid } from 'ol/tilegrid'; +import TileGrid from 'ol/tilegrid/TileGrid'; import { LoadFunction } from 'ol/Tile'; @Component({ diff --git a/projects/ngx-openlayers/src/lib/sources/tilewmts.component.ts b/projects/ngx-openlayers/src/lib/sources/tilewmts.component.ts index de51c365..a1cdadc0 100644 --- a/projects/ngx-openlayers/src/lib/sources/tilewmts.component.ts +++ b/projects/ngx-openlayers/src/lib/sources/tilewmts.component.ts @@ -14,8 +14,8 @@ import { LayerTileComponent } from '../layers/layertile.component'; import { SourceComponent } from './source.component'; import { TileGridWMTSComponent } from '../tilegridwmts.component'; import { WMTS } from 'ol/source'; -import { WMTS as TileGridWMTS } from 'ol/tilegrid'; -import { WMTSRequestEncoding } from 'ol/source'; +import TileGridWMTS from 'ol/tilegrid/WMTS'; +import WMTSRequestEncoding from 'ol/source/WMTSRequestEncoding'; import { ProjectionLike } from 'ol/proj'; import { LoadFunction } from 'ol/Tile'; import { TileSourceEvent } from 'ol/source/Tile'; diff --git a/projects/ngx-openlayers/src/lib/sources/utfgrid.component.ts b/projects/ngx-openlayers/src/lib/sources/utfgrid.component.ts index 3715843c..bf17e301 100644 --- a/projects/ngx-openlayers/src/lib/sources/utfgrid.component.ts +++ b/projects/ngx-openlayers/src/lib/sources/utfgrid.component.ts @@ -2,6 +2,7 @@ import { Component, Host, Input, OnInit, forwardRef } from '@angular/core'; import { SourceComponent } from './source.component'; import { LayerTileComponent } from '../layers/layertile.component'; import { UTFGrid } from 'ol/source'; +import { Config } from 'ol/source/TileJSON'; @Component({ selector: 'aol-source-utfgrid', @@ -10,7 +11,7 @@ import { UTFGrid } from 'ol/source'; }) export class SourceUTFGridComponent extends SourceComponent implements OnInit { instance: UTFGrid; - @Input() tileJSON: JSON; + @Input() tileJSON: Config; @Input() url: string; constructor(@Host() layer: LayerTileComponent) { diff --git a/projects/ngx-openlayers/src/lib/sources/vectortile.component.ts b/projects/ngx-openlayers/src/lib/sources/vectortile.component.ts index a6598ab9..e087b4e3 100644 --- a/projects/ngx-openlayers/src/lib/sources/vectortile.component.ts +++ b/projects/ngx-openlayers/src/lib/sources/vectortile.component.ts @@ -1,5 +1,5 @@ import { Component, Host, Input, forwardRef, ContentChild, AfterContentInit } from '@angular/core'; -import { VectorTile } from 'ol'; +import { VectorTile } from 'ol/source'; import Feature from 'ol/format/Feature'; import TileGrid from 'ol/tilegrid/TileGrid'; import { LayerVectorTileComponent } from '../layers/layervectortile.component'; diff --git a/projects/ngx-openlayers/src/lib/styles/circle.component.ts b/projects/ngx-openlayers/src/lib/styles/circle.component.ts index e92d6a87..b2b96ca4 100644 --- a/projects/ngx-openlayers/src/lib/styles/circle.component.ts +++ b/projects/ngx-openlayers/src/lib/styles/circle.component.ts @@ -1,5 +1,5 @@ import { Component, Input, Host, AfterContentInit, OnChanges, OnDestroy, SimpleChanges } from '@angular/core'; -import { AtlasManager, Circle, Fill, Stroke } from 'ol/style'; +import { Circle, Fill, Stroke } from 'ol/style'; import { StyleComponent } from './style.component'; @Component({ @@ -18,8 +18,6 @@ export class StyleCircleComponent implements AfterContentInit, OnChanges, OnDest snapToPixel: boolean; @Input() stroke: Stroke; - @Input() - atlasManager: AtlasManager; constructor(@Host() private host: StyleComponent) {} diff --git a/projects/ngx-openlayers/src/lib/styles/icon.component.ts b/projects/ngx-openlayers/src/lib/styles/icon.component.ts index f794439a..f793fb59 100644 --- a/projects/ngx-openlayers/src/lib/styles/icon.component.ts +++ b/projects/ngx-openlayers/src/lib/styles/icon.component.ts @@ -24,7 +24,7 @@ export class StyleIconComponent implements OnInit, OnChanges { @Input() crossOrigin: IconOrigin; @Input() - img: string; + img: HTMLCanvasElement | HTMLImageElement; @Input() offset: [number, number]; @Input() diff --git a/projects/ngx-openlayers/src/lib/styles/stroke.component.ts b/projects/ngx-openlayers/src/lib/styles/stroke.component.ts index c9194e2f..d45626c2 100644 --- a/projects/ngx-openlayers/src/lib/styles/stroke.component.ts +++ b/projects/ngx-openlayers/src/lib/styles/stroke.component.ts @@ -17,11 +17,11 @@ export class StyleStrokeComponent implements OnInit, OnChanges { @Input() color: Color | undefined; @Input() - lineCap: string | undefined; + lineCap: CanvasLineCap | undefined; @Input() lineDash: number[] | undefined; @Input() - lineJoin: string | undefined; + lineJoin: CanvasLineJoin | undefined; @Input() miterLimit: number | undefined; @Input() diff --git a/projects/ngx-openlayers/src/lib/tilegridwmts.component.ts b/projects/ngx-openlayers/src/lib/tilegridwmts.component.ts index 5ef6584a..40b21fdc 100644 --- a/projects/ngx-openlayers/src/lib/tilegridwmts.component.ts +++ b/projects/ngx-openlayers/src/lib/tilegridwmts.component.ts @@ -22,7 +22,7 @@ export class TileGridWMTSComponent extends TileGridComponent implements OnInit { @Input() sizes?: Size[]; @Input() - tileSizes?: (number | Size)[]; + tileSizes?: Size[]; @Input() widths?: number[]; diff --git a/projects/ngx-openlayers/src/lib/view.component.ts b/projects/ngx-openlayers/src/lib/view.component.ts index 91b80369..12922c69 100644 --- a/projects/ngx-openlayers/src/lib/view.component.ts +++ b/projects/ngx-openlayers/src/lib/view.component.ts @@ -1,7 +1,7 @@ import { Component, Input, OnInit, OnChanges, OnDestroy, SimpleChanges, EventEmitter, Output } from '@angular/core'; import View from 'ol/View'; import { MapComponent } from './map.component'; -import { ObjectEvent } from 'ol'; +import { ObjectEvent } from 'ol/Object'; import { Extent } from 'ol/extent'; import { Coordinate } from 'ol/coordinate'; diff --git a/src/app/image-static/image-static.component.ts b/src/app/image-static/image-static.component.ts index a85b5586..688dbfb4 100644 --- a/src/app/image-static/image-static.component.ts +++ b/src/app/image-static/image-static.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; import { Extent, getCenter } from 'ol/extent'; -import Projection from 'ol/proj/Projection'; +import Projection, { Options as ProjectionOptions } from 'ol/proj/Projection'; @Component({ selector: 'app-root', @@ -14,12 +14,12 @@ import Projection from 'ol/proj/Projection';
Current image url:
`, @@ -47,7 +47,7 @@ export class ImageStaticComponent { public opacity = 1.0; extent: Extent = [0, 0, 1024, 968]; - po = { + po: ProjectionOptions = { code: 'xkcd-image', units: 'pixels', extent: [0, 0, 1024, 968], diff --git a/src/app/modify-polygon/modify-polygon.component.ts b/src/app/modify-polygon/modify-polygon.component.ts index b94974ed..fd88e89f 100644 --- a/src/app/modify-polygon/modify-polygon.component.ts +++ b/src/app/modify-polygon/modify-polygon.component.ts @@ -1,5 +1,6 @@ import { Component, OnInit } from '@angular/core'; -import { Feature } from 'ol'; +import { Feature, Polygon } from 'geojson'; +import OLFeature from 'ol/Feature'; import Projection from 'ol/proj/Projection'; import { GeoJSON } from 'ol/format'; @@ -66,7 +67,7 @@ export class ModifyPolygonComponent implements OnInit { displayProj = new Projection({ code: 'EPSG:3857' }); inputProj = new Projection({ code: 'EPSG:4326' }); - feature: Feature = { + feature: Feature = { geometry: { coordinates: [ [ @@ -85,10 +86,10 @@ export class ModifyPolygonComponent implements OnInit { ngOnInit() {} - modifyEnd(feature: Feature) { + modifyEnd(feature: OLFeature) { this.feature = this.format.writeFeatureObject(feature, { dataProjection: this.inputProj, featureProjection: this.displayProj, - }); + }) as Feature; } }