AW6241 ng-18 adopt ng-openlayers

This commit is contained in:
2024-09-05 08:50:27 +02:00
parent 1bddc28767
commit 07d6c1bc10
92 changed files with 4148 additions and 1 deletions

View File

@@ -0,0 +1,37 @@
import { Component, Host, Input, OnInit, forwardRef } from '@angular/core';
import { Vector } from 'ol/source';
import Feature from 'ol/format/Feature';
import { LayerVectorComponent } from '../layers/layervector.component';
import { SourceComponent } from './source.component';
import { LoadingStrategy } from 'ol/source/Vector';
@Component({
selector: 'aol-source-vector',
template: ` <ng-content></ng-content> `,
providers: [{ provide: SourceComponent, useExisting: forwardRef(() => SourceVectorComponent) }],
})
export class SourceVectorComponent extends SourceComponent implements OnInit {
@Input()
overlaps: boolean;
@Input()
useSpatialIndex: boolean;
@Input()
wrapX: boolean;
@Input()
url: string;
@Input()
format: Feature;
@Input()
strategy: LoadingStrategy;
instance: Vector;
constructor(@Host() layer: LayerVectorComponent) {
super(layer);
}
ngOnInit() {
this.instance = new Vector(this);
this.host.instance.setSource(this.instance);
}
}