Skip to content

Commit

Permalink
Merge pull request #33 from boeckMt/boeckMt-patch-1
Browse files Browse the repository at this point in the history
Update map.utills.ts
  • Loading branch information
boeckMt committed Oct 12, 2023
2 parents 6f1d1a4 + cd2981d commit 69a8494
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
</main>
<section class="map-time-control">
<mat-toolbar>
<mat-toolbar-row>
<mat-toolbar-row class="bottom-toolbar">
<app-time-slider [dates]="datesString" [startTime]="startState.time"
(dateChange)="sliderOnChange($event)"></app-time-slider>
</mat-toolbar-row>
<mat-toolbar-row>
<mat-toolbar-row class="bottom-toolbar">
<span class="title">
{{ currentState.time | date: 'dd/M/yyyy - HH:mm:ss'}}
{{ currentState.time | date: 'dd/M/yyyy - HH:mm'}}
</span>
<button mat-icon-button aria-label="share map" title="share current map view" (click)="shareLink()">
<mat-icon >share</mat-icon>
Expand Down
6 changes: 6 additions & 0 deletions src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,15 @@ $bottom-toolbar-height-mobile: 112px;
.mat-toolbar {
background: rgb(0, 77, 64);
color: rgba(255, 255, 255, 0.9);

.bottom-toolbar {
padding: 0 0.3rem
}
}




.mat-progress-bar.mat-debug {
.mat-progress-bar-background {
fill: #bf00ef80;
Expand Down
6 changes: 5 additions & 1 deletion src/app/map.utills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import VectorSource from 'ol/source/Vector';
import { Coordinate } from 'ol/coordinate';
import { Feature } from 'ol';
import CircleStyle from 'ol/style/Circle';
import { Fill, Style } from 'ol/style';
import { Fill, Style, Stroke } from 'ol/style';


export function findLayerRecursive(lLayergroup: Layer | LayerEntity, path: string) {
Expand Down Expand Up @@ -72,6 +72,10 @@ export function addLocationLayer(map: Map, coordinates: Coordinate) {
return new Style({
image: new CircleStyle({
radius: 6,
stroke: new Stroke({
color: 'black',
width: 1,
}),
fill: new Fill({
color: 'rgba(235, 156, 70, 0.8)',
})
Expand Down
2 changes: 1 addition & 1 deletion src/app/time-slider/time-slider.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</button>

<mat-slider showTickMarks discrete (change)="sliderOnChange($event)" [min]="sMin" [max]="sMax" [step]="sStep"
[disabled]="isdisabled">
[disabled]="isdisabled" [displayWith]="formatLabel">
<input [value]="sMin" [(ngModel)]="sValue" matSliderThumb>
</mat-slider>

Expand Down
1 change: 1 addition & 0 deletions src/app/time-slider/time-slider.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

mat-slider {
width: calc(100% - (92px + 30px));
margin: 0 1.5rem;

--mdc-slider-handle-color: rgb(235, 156, 70);
--mdc-slider-focus-handle-color: rgb(235, 156, 70);
Expand Down
11 changes: 9 additions & 2 deletions src/app/time-slider/time-slider.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Component, OnInit, OnChanges } from '@angular/core';
import { Input, Output, EventEmitter } from '@angular/core';
import { DatePipe } from '@angular/common';
import { findClosestDate } from '../utills';

export interface IdateChange {
Expand All @@ -9,7 +10,8 @@ export interface IdateChange {
@Component({
selector: 'app-time-slider',
templateUrl: './time-slider.component.html',
styleUrls: ['./time-slider.component.scss']
styleUrls: ['./time-slider.component.scss'],
providers: [DatePipe]
})
export class TimeSliderComponent implements OnChanges {

Expand All @@ -27,10 +29,15 @@ export class TimeSliderComponent implements OnChanges {
playing = false;
intervalID: any;
isdisabled = true;
constructor() {
constructor(private datePipe: DatePipe) {

}

formatLabel = (value: number) => {
const now = (this.dates && this.sValue) ? this.dates[this.sValue] : this.dates[this.sMin];
return this.datePipe.transform(now,'HH:mm');
}

setSlider(value: '+' | '-') {
if (value === '+') {
this.sValue += this.sStep;
Expand Down

0 comments on commit 69a8494

Please sign in to comment.