Skip to content

Commit

Permalink
fix(minmap): fix minimap view change (#1178)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeLafreniere18 committed Jan 31, 2023
1 parent 2559753 commit 5da63de
Showing 1 changed file with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {
Input,
AfterViewInit,
OnDestroy,
ApplicationRef
ApplicationRef,
ChangeDetectorRef
} from '@angular/core';

import { Layer, LayerOptions } from '../../layer/shared';
Expand All @@ -22,9 +23,19 @@ export class MiniBaseMapComponent implements AfterViewInit, OnDestroy {

@Input() map: IgoMap;
@Input() disabled: boolean;
@Input() display: boolean;
@Input() title: string;

@Input()
get display(): boolean {
return this._display;
}
set display(value: boolean) {
this._display = value;
this.cdRef.detectChanges();
this.basemap.ol.getView().changed();
}
private _display: boolean;

@Input()
get baseLayer(): Layer {
return this._baseLayer;
Expand All @@ -42,8 +53,9 @@ export class MiniBaseMapComponent implements AfterViewInit, OnDestroy {

constructor(
private layerService: LayerService,
private appRef: ApplicationRef
) { }
private appRef: ApplicationRef,
private cdRef: ChangeDetectorRef
) {}

ngAfterViewInit() {
this.handleMainMapViewChange(this.map.ol.getView());
Expand Down

0 comments on commit 5da63de

Please sign in to comment.