Skip to content

Commit

Permalink
feat(sources): add source tileutfgrid component (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
gasperiguillaume authored and davinkevin committed Jun 27, 2018
1 parent ca0c9bb commit d946755
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/sources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
25 changes: 25 additions & 0 deletions src/components/sources/tileutfgrid.component.ts
Original file line number Diff line number Diff line change
@@ -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: `<ng-content></ng-content>`,
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);
}
}
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -45,6 +45,7 @@ const COMPONENTS = [
SourceVectorComponent,
SourceXYZComponent,
SourceVectorTileComponent,
SourceTileUTFGridComponent,
SourceTileWMSComponent,
SourceTileWMTSComponent,
SourceTileJSONComponent,
Expand Down

0 comments on commit d946755

Please sign in to comment.