From d946755dc9541efbadc1a1cd109bc924cdf99753 Mon Sep 17 00:00:00 2001 From: Gasperi <32667788+gasperiguillaume@users.noreply.github.com> Date: Wed, 27 Jun 2018 05:59:11 +0200 Subject: [PATCH] feat(sources): add source tileutfgrid component (#179) --- src/components/sources/index.ts | 1 + .../sources/tileutfgrid.component.ts | 25 +++++++++++++++++++ src/index.ts | 3 ++- 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 src/components/sources/tileutfgrid.component.ts diff --git a/src/components/sources/index.ts b/src/components/sources/index.ts index 9db12eb7..00b93a05 100644 --- a/src/components/sources/index.ts +++ b/src/components/sources/index.ts @@ -7,6 +7,7 @@ export * from './xyz.component'; export * from './tilewms.component'; export * from './geojson.component'; export * from './tilejson.component'; +export * from './tileutfgrid.component'; export * from './tilewmts.component'; export * from './imagewms.component'; export * from './imagestatic.component'; diff --git a/src/components/sources/tileutfgrid.component.ts b/src/components/sources/tileutfgrid.component.ts new file mode 100644 index 00000000..9b8cdb7c --- /dev/null +++ b/src/components/sources/tileutfgrid.component.ts @@ -0,0 +1,25 @@ +import { Component, Host, Input, OnInit, forwardRef } from '@angular/core'; +import { source } from 'openlayers'; +import { LayerTileComponent } from '../layers'; +import { SourceComponent } from './source.component'; + +@Component({ + selector: 'aol-source-tileutfgrid', + template: ``, + providers: [ + { provide: SourceComponent, useExisting: forwardRef(() => SourceTileUTFGridComponent) } + ] +}) +export class SourceTileUTFGridComponent extends SourceComponent implements OnInit { + instance: source.TileUTFGrid; + @Input() tileJSON: JSON; + + constructor(@Host() layer: LayerTileComponent) { + super(layer); + } + + ngOnInit() { + this.instance = new source.TileUTFGrid(this); + this.host.instance.setSource(this.instance); + } +} diff --git a/src/index.ts b/src/index.ts index dd327959..1466f8aa 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,7 +4,7 @@ import { MapComponent, ViewComponent, GraticuleComponent, LayerGroupComponent, LayerTileComponent, LayerVectorComponent, LayerVectorTileComponent, LayerImageComponent, SourceClusterComponent, SourceRasterComponent, - SourceBingmapsComponent, SourceOsmComponent, SourceVectorComponent, SourceVectorTileComponent, SourceXYZComponent, SourceTileWMSComponent, + SourceBingmapsComponent, SourceOsmComponent, SourceVectorComponent, SourceVectorTileComponent, SourceXYZComponent, SourceTileUTFGridComponent, SourceTileWMSComponent, SourceGeoJSONComponent, SourceTileWMTSComponent, SourceTileJSONComponent, SourceImageStaticComponent, SourceImageWMSComponent, FeatureComponent, GeometryLinestringComponent, GeometryPointComponent, GeometryPolygonComponent, CollectionCoordinatesComponent, CoordinateComponent, @@ -45,6 +45,7 @@ const COMPONENTS = [ SourceVectorComponent, SourceXYZComponent, SourceVectorTileComponent, + SourceTileUTFGridComponent, SourceTileWMSComponent, SourceTileWMTSComponent, SourceTileJSONComponent,