-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: query component (info panel) renamed to query, info component (compositionLoadingProgress) renamed to info and configuration moved from panels to components
- Loading branch information
1 parent
b1af6f7
commit e315647
Showing
29 changed files
with
178 additions
and
130 deletions.
There are no files selected for viewing
10 changes: 8 additions & 2 deletions
10
projects/hslayers/src/components/draw/draw-toolbar/draw-toolbar.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
projects/hslayers/src/components/layermanager/gallery/layermanager-gallery.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
projects/hslayers/src/components/layout/panels/gui-overlay-base.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import {Component, OnInit, ViewRef} from '@angular/core'; | ||
import {Observable, map, of} from 'rxjs'; | ||
import {takeUntilDestroyed} from '@angular/core/rxjs-interop'; | ||
|
||
import {HsLayoutService} from '../layout.service'; | ||
import {HsPanelComponent} from './panel-component.interface'; | ||
|
||
@Component({ | ||
template: '<div></div>', | ||
standalone: true, | ||
}) | ||
export class HsGuiOverlayBaseComponent implements HsPanelComponent, OnInit { | ||
name: string; | ||
viewRef: ViewRef; | ||
data: any; | ||
isVisible$ = new Observable<boolean>(); | ||
|
||
/** | ||
* Control to make sure HsPanelBaseComponent ngOnInit was run eg. | ||
* was called from parent ngOnInit or when parents ngOnInit is not defined | ||
*/ | ||
private baseComponentInitRun = false; | ||
|
||
constructor(public hsLayoutService: HsLayoutService) { | ||
setTimeout(() => { | ||
if (!this.baseComponentInitRun) { | ||
console.warn( | ||
`${ | ||
this.name || this.constructor.name | ||
} implements ngOnInit lifecycle hook without calling HsGuiOverlayBaseComponent ngOnInit. | ||
Make sure it is executed by calling super.ngOnInit() from component's ngOnInit manually`, | ||
); | ||
} | ||
}, 3000); | ||
} | ||
|
||
ngOnInit(): void { | ||
this.baseComponentInitRun = true; | ||
this.isVisible$ = this.componentEnabled(); | ||
this.hsLayoutService.hsConfig.configChanges | ||
//.pipe(takeUntilDestroyed()) | ||
.subscribe(() => { | ||
this.isVisible$ = this.componentEnabled(); | ||
}); | ||
|
||
if (!this.name) { | ||
console.error(`${this.constructor.name} is missing a name property!`); | ||
} | ||
} | ||
|
||
/** | ||
* Determine component visiblity | ||
*/ | ||
componentEnabled(): Observable<boolean> { | ||
return of( | ||
this.hsLayoutService.componentEnabled(this.name) && | ||
this.hsLayoutService.componentEnabled('guiOverlay'), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 14 additions & 9 deletions
23
projects/hslayers/src/components/measure/measure-toolbar.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,31 @@ | ||
import {Component} from '@angular/core'; | ||
import {of} from 'rxjs'; | ||
|
||
import {HsGuiOverlayBaseComponent} from '../layout/panels/gui-overlay-base.component'; | ||
import {HsLayoutService} from '../layout/layout.service'; | ||
import {HsToolbarPanelBaseComponent} from '../toolbar/toolbar-panel-base.component'; | ||
|
||
@Component({ | ||
selector: 'hs-measure-toolbar', | ||
templateUrl: './measure-toolbar.component.html', | ||
}) | ||
export class HsMeasureToolbarComponent extends HsToolbarPanelBaseComponent { | ||
export class HsMeasureToolbarComponent extends HsGuiOverlayBaseComponent { | ||
constructor(public hsLayoutService: HsLayoutService) { | ||
super(hsLayoutService); | ||
} | ||
name = 'measureToolbar'; | ||
|
||
isVisible(): boolean { | ||
return ( | ||
this.hsLayoutService.panelEnabled('measure') && | ||
this.hsLayoutService.componentEnabled('measureToolbar') | ||
); | ||
} | ||
|
||
measureButtonClicked(): void { | ||
this.hsLayoutService.setMainPanel('measure', true); | ||
} | ||
|
||
/** | ||
* Override parent class componentEnabled. Used to determine isVisible$ value | ||
*/ | ||
componentEnabled() { | ||
return of( | ||
this.hsLayoutService.panelEnabled('measure') && | ||
this.hsLayoutService.componentEnabled(this.name) && | ||
this.hsLayoutService.componentEnabled('guiOverlay'), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.