Skip to content

refactor: use standalone components #306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions projects/ngx-openlayers/src/lib/attribution.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import { Component, ElementRef, OnInit } from '@angular/core';
import { Attribution } from 'ol/control';

@Component({
selector: 'aol-attribution',
template: '<ng-content></ng-content>',
selector: 'aol-attribution',
template: '<ng-content></ng-content>',
standalone: true,
})
export class AttributionComponent implements OnInit {
instance: Attribution;
Expand Down
5 changes: 3 additions & 2 deletions projects/ngx-openlayers/src/lib/attributions.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { AttributionComponent } from './attribution.component';
import { SourceComponent } from './sources/source.component';

@Component({
selector: 'aol-attributions',
template: '<ng-content></ng-content>',
selector: 'aol-attributions',
template: '<ng-content></ng-content>',
standalone: true,
})
export class AttributionsComponent implements AfterViewInit {
@ContentChildren(AttributionComponent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import { GeometryPolygonComponent } from './geom/geometrypolygon.component';
import { MapComponent } from './map.component';

@Component({
selector: 'aol-collection-coordinates',
template: ` <div class="aol-collection-coordinates"></div> `,
selector: 'aol-collection-coordinates',
template: ` <div class="aol-collection-coordinates"></div> `,
standalone: true,
})
export class CollectionCoordinatesComponent implements OnChanges, OnInit {
@Input()
Expand Down
5 changes: 3 additions & 2 deletions projects/ngx-openlayers/src/lib/content.component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Component, ElementRef } from '@angular/core';

@Component({
selector: 'aol-content',
template: '<ng-content></ng-content>',
selector: 'aol-content',
template: '<ng-content></ng-content>',
standalone: true,
})
export class ContentComponent {
constructor(public elementRef: ElementRef) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { Attribution } from 'ol/control';
import { MapComponent } from '../map.component';

@Component({
selector: 'aol-control-attribution',
template: ``,
selector: 'aol-control-attribution',
template: ``,
standalone: true,
})
export class ControlAttributionComponent implements OnInit, OnDestroy {
@Input()
Expand Down
5 changes: 3 additions & 2 deletions projects/ngx-openlayers/src/lib/controls/control.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { ContentComponent } from '../content.component';
import { MapComponent } from '../map.component';

@Component({
selector: 'aol-control',
template: ` <ng-content></ng-content> `,
selector: 'aol-control',
template: ` <ng-content></ng-content> `,
standalone: true,
})
export class ControlComponent implements OnInit, OnDestroy {
@ContentChild(ContentComponent, { static: true })
Expand Down
5 changes: 3 additions & 2 deletions projects/ngx-openlayers/src/lib/controls/default.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import { Options as ZoomOptions } from 'ol/control/Zoom';
import { MapComponent } from '../map.component';

@Component({
selector: 'aol-control-defaults',
template: '',
selector: 'aol-control-defaults',
template: '',
standalone: true,
})
export class DefaultControlComponent implements OnInit, OnDestroy {
@Input()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { FullScreen } from 'ol/control';
import { MapComponent } from '../map.component';

@Component({
selector: 'aol-control-fullscreen',
template: ` <ng-content></ng-content> `,
selector: 'aol-control-fullscreen',
template: ` <ng-content></ng-content> `,
standalone: true,
})
export class ControlFullScreenComponent implements OnInit, OnDestroy {
@Input()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { ProjectionLike } from 'ol/proj';
import { MapComponent } from '../map.component';

@Component({
selector: 'aol-control-mouseposition',
template: ``,
selector: 'aol-control-mouseposition',
template: ``,
standalone: true,
})
export class ControlMousePositionComponent implements OnInit, OnDestroy {
@Input()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { Layer } from 'ol/layer';
import { MapComponent } from '../map.component';

@Component({
selector: 'aol-control-overviewmap',
template: ` <ng-content></ng-content> `,
selector: 'aol-control-overviewmap',
template: ` <ng-content></ng-content> `,
standalone: true,
})
export class ControlOverviewMapComponent implements OnInit, OnChanges, OnDestroy {
@Input()
Expand Down
5 changes: 3 additions & 2 deletions projects/ngx-openlayers/src/lib/controls/rotate.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { Rotate } from 'ol/control';
import { MapComponent } from '../map.component';

@Component({
selector: 'aol-control-rotate',
template: ` <ng-content></ng-content> `,
selector: 'aol-control-rotate',
template: ` <ng-content></ng-content> `,
standalone: true,
})
export class ControlRotateComponent implements OnInit, OnDestroy {
@Input()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { MapComponent } from '../map.component';
import { Units } from 'ol/control/ScaleLine';

@Component({
selector: 'aol-control-scaleline',
template: ` <ng-content></ng-content> `,
selector: 'aol-control-scaleline',
template: ` <ng-content></ng-content> `,
standalone: true,
})
export class ControlScaleLineComponent implements OnInit, OnDestroy {
@Input()
Expand Down
5 changes: 3 additions & 2 deletions projects/ngx-openlayers/src/lib/controls/zoom.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { Zoom } from 'ol/control';
import { MapComponent } from '../map.component';

@Component({
selector: 'aol-control-zoom',
template: ` <ng-content></ng-content> `,
selector: 'aol-control-zoom',
template: ` <ng-content></ng-content> `,
standalone: true,
})
export class ControlZoomComponent implements OnInit, OnDestroy {
@Input()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { ZoomSlider } from 'ol/control';
import { MapComponent } from '../map.component';

@Component({
selector: 'aol-control-zoomslider',
template: ` <ng-content></ng-content> `,
selector: 'aol-control-zoomslider',
template: ` <ng-content></ng-content> `,
standalone: true,
})
export class ControlZoomSliderComponent implements OnInit, OnDestroy {
@Input()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { Extent } from 'ol/extent';
import { MapComponent } from '../map.component';

@Component({
selector: 'aol-control-zoomtoextent',
template: ` <ng-content></ng-content> `,
selector: 'aol-control-zoomtoextent',
template: ` <ng-content></ng-content> `,
standalone: true,
})
export class ControlZoomToExtentComponent implements OnInit, OnDestroy {
@Input()
Expand Down
5 changes: 3 additions & 2 deletions projects/ngx-openlayers/src/lib/coordinate.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import { OverlayComponent } from './overlay.component';
import { ViewComponent } from './view.component';

@Component({
selector: 'aol-coordinate',
template: ` <div class="aol-coordinate"></div> `,
selector: 'aol-coordinate',
template: ` <div class="aol-coordinate"></div> `,
standalone: true,
})
export class CoordinateComponent implements OnChanges, OnInit {
@Input()
Expand Down
5 changes: 3 additions & 2 deletions projects/ngx-openlayers/src/lib/feature.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { Feature } from 'ol';
import { SourceVectorComponent } from './sources/vector.component';

@Component({
selector: 'aol-feature',
template: ` <ng-content></ng-content> `,
selector: 'aol-feature',
template: ` <ng-content></ng-content> `,
standalone: true,
})
export class FeatureComponent implements OnInit, OnDestroy, OnChanges {
@Input()
Expand Down
7 changes: 4 additions & 3 deletions projects/ngx-openlayers/src/lib/formats/mvt.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import { MVT } from 'ol/format';
import { FormatComponent } from './format.component';

@Component({
selector: 'aol-format-mvt',
template: '',
providers: [{ provide: FormatComponent, useExisting: forwardRef(() => FormatMVTComponent) }],
selector: 'aol-format-mvt',
template: '',
providers: [{ provide: FormatComponent, useExisting: forwardRef(() => FormatMVTComponent) }],
standalone: true,
})
export class FormatMVTComponent extends FormatComponent {
@Input()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { MapComponent } from '../map.component';
import { SimpleGeometryComponent } from './simplegeometry.component';

@Component({
selector: 'aol-geometry-circle',
template: ` <ng-content></ng-content> `,
selector: 'aol-geometry-circle',
template: ` <ng-content></ng-content> `,
standalone: true,
})
export class GeometryCircleComponent extends SimpleGeometryComponent implements OnInit {
componentType = 'geometry-circle';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { MapComponent } from '../map.component';
import { LineString } from 'ol/geom';

@Component({
selector: 'aol-geometry-linestring',
template: ` <ng-content></ng-content> `,
selector: 'aol-geometry-linestring',
template: ` <ng-content></ng-content> `,
standalone: true,
})
export class GeometryLinestringComponent extends SimpleGeometryComponent implements OnInit {
public componentType = 'geometry-linestring';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { MapComponent } from '../map.component';
import { MultiLineString } from 'ol/geom';

@Component({
selector: 'aol-geometry-multilinestring',
template: ` <ng-content></ng-content> `,
selector: 'aol-geometry-multilinestring',
template: ` <ng-content></ng-content> `,
standalone: true,
})
export class GeometryMultiLinestringComponent extends SimpleGeometryComponent implements OnInit {
public componentType = 'geometry-multilinestring';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { MapComponent } from '../map.component';
import { MultiPoint } from 'ol/geom';

@Component({
selector: 'aol-geometry-multipoint',
template: ` <ng-content></ng-content> `,
selector: 'aol-geometry-multipoint',
template: ` <ng-content></ng-content> `,
standalone: true,
})
export class GeometryMultiPointComponent extends SimpleGeometryComponent implements OnInit {
public componentType = 'geometry-multipoint';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { MapComponent } from '../map.component';
import { MultiPolygon } from 'ol/geom';

@Component({
selector: 'aol-geometry-multipolygon',
template: ` <ng-content></ng-content> `,
selector: 'aol-geometry-multipolygon',
template: ` <ng-content></ng-content> `,
standalone: true,
})
export class GeometryMultiPolygonComponent extends SimpleGeometryComponent implements OnInit {
public componentType = 'geometry-multipolygon';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { MapComponent } from '../map.component';
import { Point } from 'ol/geom';

@Component({
selector: 'aol-geometry-point',
template: ` <ng-content></ng-content> `,
selector: 'aol-geometry-point',
template: ` <ng-content></ng-content> `,
standalone: true,
})
export class GeometryPointComponent extends SimpleGeometryComponent implements OnInit {
public componentType = 'geometry-point';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { MapComponent } from '../map.component';
import { Polygon } from 'ol/geom';

@Component({
selector: 'aol-geometry-polygon',
template: ` <ng-content></ng-content> `,
selector: 'aol-geometry-polygon',
template: ` <ng-content></ng-content> `,
standalone: true,
})
export class GeometryPolygonComponent extends SimpleGeometryComponent implements OnInit {
public componentType = 'geometry-polygon';
Expand Down
5 changes: 3 additions & 2 deletions projects/ngx-openlayers/src/lib/graticule.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { MapComponent } from './map.component';
import { Options } from 'ol/layer/Graticule';

@Component({
selector: 'aol-graticule',
template: '<ng-content></ng-content>',
selector: 'aol-graticule',
template: '<ng-content></ng-content>',
standalone: true,
})
export class GraticuleComponent implements AfterContentInit, OnChanges, OnDestroy {
@Input()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { Collection } from 'ol';
import { MapComponent } from '../map.component';

@Component({
selector: 'aol-interaction-default',
template: '',
selector: 'aol-interaction-default',
template: '',
standalone: true,
})
export class DefaultInteractionComponent implements OnInit, OnDestroy {
instance: Collection<Interaction>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { DoubleClickZoom } from 'ol/interaction';
import { MapComponent } from '../map.component';

@Component({
selector: 'aol-interaction-doubleclickzoom',
template: '',
selector: 'aol-interaction-doubleclickzoom',
template: '',
standalone: true,
})
export class DoubleClickZoomInteractionComponent implements OnInit, OnDestroy {
@Input()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { ProjectionLike } from 'ol/proj';
import { MapComponent } from '../map.component';

@Component({
selector: 'aol-interaction-draganddrop',
template: '',
selector: 'aol-interaction-draganddrop',
template: '',
standalone: true,
})
export class DragAndDropInteractionComponent implements OnInit, OnDestroy {
@Input()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { EndCondition } from 'ol/interaction/DragBox';
import { MapComponent } from '../map.component';

@Component({
selector: 'aol-interaction-dragbox',
template: '',
selector: 'aol-interaction-dragbox',
template: '',
standalone: true,
})
export class DragBoxInteractionComponent implements OnInit, OnDestroy {
@Input()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { DragPan } from 'ol/interaction';
import { MapComponent } from '../map.component';

@Component({
selector: 'aol-interaction-dragpan',
template: '',
selector: 'aol-interaction-dragpan',
template: '',
standalone: true,
})
export class DragPanInteractionComponent implements OnInit, OnDestroy {
@Input()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { DragRotate } from 'ol/interaction';
import { MapComponent } from '../map.component';

@Component({
selector: 'aol-interaction-dragrotate',
template: '',
selector: 'aol-interaction-dragrotate',
template: '',
standalone: true,
})
export class DragRotateInteractionComponent implements OnInit, OnDestroy {
@Input()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { DragRotateAndZoom } from 'ol/interaction';
import { MapComponent } from '../map.component';

@Component({
selector: 'aol-interaction-dragrotateandzoom',
template: '',
selector: 'aol-interaction-dragrotateandzoom',
template: '',
standalone: true,
})
export class DragRotateAndZoomInteractionComponent implements OnInit, OnDestroy {
@Input()
Expand Down
Loading