Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #11 from umr-dbs/map-grid
Browse files Browse the repository at this point in the history
Map grid
  • Loading branch information
ChristianBeilschmidt committed Dec 16, 2019
2 parents ad7ed23 + df39b88 commit 54797dd
Show file tree
Hide file tree
Showing 15 changed files with 934 additions and 889 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"lodash": "4.17.15",
"moment": "2.24.0",
"ngx-color-picker": "7.3.1",
"ol": "5.3.0",
"ol": "6.1.1",
"papaparse": "4.6.3",
"rxjs": "6.4.0",
"ts-helpers": "1.1.2",
Expand Down
14 changes: 9 additions & 5 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<mat-sidenav-container fullscreen>
<mat-sidenav #sidenavRight position="end" mode="side" (openedChange)="mapComponent.resize()">
<wave-sidenav-container #sidenavContainer></wave-sidenav-container>
<mat-sidenav position="end" mode="side" (openedChange)="mapComponent.resize()">
<wave-sidenav-container></wave-sidenav-container>
</mat-sidenav>
<div class="time-container" fxLayoutAlign="space-around center">
<wave-zoom-handles (zoomIn)="map.zoomIn()" (zoomOut)="map.zoomOut()" class="mat-elevation-z4"></wave-zoom-handles>
Expand All @@ -12,15 +12,16 @@
<wave-layer-list class="mat-elevation-z4" [height]="middleContainerHeight$ | async"></wave-layer-list>

<div class="mid-container" [style.height.px]="middleContainerHeight$ | async">
<wave-ol-map #map>
<ng-template ngFor let-layer [ngForOf]='layersReverse$ | async'>
<wave-map-container #map [grid]="mapIsGrid$ | async">
<ng-template ngFor let-layer [ngForOf]="layersReverse$ | async">
<ng-template [ngIf]="layer.operator.resultType === ResultTypes.POINTS">
<wave-ol-point-layer
[layer]="layer"
[visible]="layer.visible"
[symbology]="layer.symbology"
[projection]="projectService.getProjectionStream() | async"
[time]="projectService.getTimeStream() | async"
(mapRedraw)="map.layerForcesRedraw()"
></wave-ol-point-layer>
</ng-template>
<ng-template [ngIf]="layer.operator.resultType === ResultTypes.LINES">
Expand All @@ -30,6 +31,7 @@
[symbology]="layer.symbology"
[projection]="projectService.getProjectionStream() | async"
[time]="projectService.getTimeStream() | async"
(mapRedraw)="map.layerForcesRedraw()"
></wave-ol-line-layer>
</ng-template>
<ng-template [ngIf]="layer.operator.resultType === ResultTypes.POLYGONS">
Expand All @@ -39,6 +41,7 @@
[symbology]="layer.symbology"
[projection]="projectService.getProjectionStream() | async"
[time]="projectService.getTimeStream() | async"
(mapRedraw)="map.layerForcesRedraw()"
></wave-ol-polygon-layer>
</ng-template>
<ng-template [ngIf]="layer.operator.resultType === ResultTypes.RASTER">
Expand All @@ -48,10 +51,11 @@
[symbology]="layer.symbology"
[projection]="projectService.getProjectionStream() | async"
[time]="projectService.getTimeStream() | async"
(mapRedraw)="map.layerForcesRedraw()"
></wave-ol-raster-layer>
</ng-template>
</ng-template>
</wave-ol-map>
</wave-map-container>
</div>
<div
class="bottom-container mat-elevation-z4"
Expand Down
8 changes: 6 additions & 2 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {ProjectService} from './project/project.service';
import {UserService} from './users/user.service';
import {StorageService, StorageStatus} from './storage/storage.service';

import {MapComponent} from './map/map.component';
import {MapContainerComponent} from './map/map-container/map-container.component';

import {Layer, VectorLayer} from './layers/layer.model';
import {LayerService} from './layers/layer.service';
Expand Down Expand Up @@ -66,7 +66,7 @@ import {combineLatest} from 'rxjs/internal/observable/combineLatest';
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AppComponent implements OnInit, AfterViewInit {
@ViewChild(MapComponent) mapComponent: MapComponent;
@ViewChild(MapContainerComponent) mapComponent: MapContainerComponent;
@ViewChild(MatTabGroup) bottomTabs: MatTabGroup;

@ViewChild(MatSidenav) rightSidenav: MatSidenav;
Expand All @@ -81,6 +81,8 @@ export class AppComponent implements OnInit, AfterViewInit {
ResultTypes = ResultTypes; // tslint:disable-line:no-unused-variable variable-name
LayoutService = LayoutService;

mapIsGrid$: Observable<boolean>;

private windowHeight$ = new BehaviorSubject<number>(window.innerHeight);

constructor(public layerService: LayerService,
Expand Down Expand Up @@ -126,6 +128,8 @@ export class AppComponent implements OnInit, AfterViewInit {

ngOnInit() {
this.mapService.registerMapComponent(this.mapComponent);
this.mapIsGrid$ = this.mapService.isGrid$;

this.middleContainerHeight$ = this.layoutService.getMapHeightStream(this.windowHeight$).pipe(
tap(() => this.mapComponent.resize()));
this.bottomContainerHeight$ = this.layoutService.getLayerDetailViewStream(this.windowHeight$);
Expand Down
4 changes: 2 additions & 2 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'hammerjs';

import {AppComponent} from './app.component';
import {DataRepositoryComponent} from './operators/dialogs/data-repository/data-repository.component';
import {MapComponent} from './map/map.component';
import {MapContainerComponent} from './map/map-container/map-container.component';
import {
OlLineLayerComponent,
OlPointLayerComponent,
Expand Down Expand Up @@ -231,7 +231,7 @@ export function configInitializer(config: Config) {
LineageGraphComponent,
LoadProjectComponent,
LoginComponent,
MapComponent,
MapContainerComponent,
MappingColorizerToGradientPipe,
MappingDataSourceFilter,
MediaviewAudioComponent,
Expand Down
Loading

0 comments on commit 54797dd

Please sign in to comment.