Files
FarmMapsLib/projects/ngx-openlayers/src/lib/sources/tilejson.component.ts
Peter Bastiani 8e8f18ad7c
Some checks failed
FarmMaps.Develop/FarmMapsLib/pipeline/head There was a failure building this commit
Aw5739 Add ngx openlayers
2023-12-29 11:01:36 +01:00

26 lines
747 B
TypeScript

import { Component, Host, Input, OnInit, forwardRef } from '@angular/core';
import { TileJSON } from 'ol/source';
import { LayerTileComponent } from '../layers/layertile.component';
import { SourceComponent } from './source.component';
@Component({
selector: 'aol-source-tilejson',
template: ` <ng-content></ng-content> `,
providers: [{ provide: SourceComponent, useExisting: forwardRef(() => SourceTileJSONComponent) }],
})
export class SourceTileJSONComponent extends SourceComponent implements OnInit {
@Input()
url: string;
instance: TileJSON;
constructor(@Host() layer: LayerTileComponent) {
super(layer);
}
ngOnInit() {
this.instance = new TileJSON(this);
this.host.instance.setSource(this.instance);
}
}