-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
736 additions
and
66 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
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,25 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<title>VgiFrontend</title> | ||
<base href="/"> | ||
<link rel="stylesheet" href="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.1.3/css/ol.css" | ||
type="text/css"> | ||
<style> | ||
html, | ||
body { | ||
margin: 0; | ||
} | ||
</style> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="icon" type="image/x-icon" href="favicon.ico"> | ||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> | ||
<link rel="stylesheet" href="styles.bbc3f9d7e04063d29d7e.css"></head> | ||
|
||
<body> | ||
<app-root ></app-root> | ||
<script type="text/javascript" src="runtime.26209474bfa8dc87a77c.js"></script><script type="text/javascript" src="polyfills.7e61eeabe4f75fabb7d3.js"></script><script type="text/javascript" src="main.b92d2b6cc58007ca41d8.js"></script></body> | ||
|
||
</html> |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.point-form { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
.modal-name { | ||
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif; | ||
font-size: 1.5rem; | ||
letter-spacing: 1px; | ||
color: darkRed; | ||
} | ||
|
||
.search-form-container { | ||
text-align: center; | ||
|
||
display: flex; | ||
justify-content: flex-start; | ||
flex-direction: column; | ||
width: 400px; | ||
height: 400px; | ||
} |
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,31 @@ | ||
<div class="search-form-container"> | ||
<h2 mat-dialog-title class="modal-name">Ricerca localizzazioni</h2> | ||
<mat-divider></mat-divider> | ||
<br/> | ||
<br/> | ||
<mat-dialog-content [formGroup]="formSearch" class="form"> | ||
<div> | ||
<mat-form-field class="mat-field"> | ||
<input matInput placeholder="Età da" type="number" formControlName="annoDa" required> | ||
</mat-form-field> | ||
</div> | ||
<div> | ||
<mat-form-field class="input-fullwidth"> | ||
<input matInput placeholder="Età a" type= "number" formControlName="annoA"> | ||
</mat-form-field> | ||
</div> | ||
<div> | ||
<mat-form-field class="mat-field"> | ||
<mat-select placeholder="Selezione legenda" formControlName="idLegenda" [(ngModel)]="selectedLegenda" required> | ||
<mat-option *ngFor="let l of legende" [value]="l.id"> | ||
{{l.codice}} | ||
</mat-option> | ||
</mat-select> | ||
</mat-form-field> | ||
</div> | ||
<div> | ||
<br/> | ||
<button mat-raised-button color="primary" class="white-text" (click)="search()">Avvia Ricerca</button> | ||
</div> | ||
</mat-dialog-content> | ||
</div> |
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,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { SearchComponent } from './search.component'; | ||
|
||
describe('SearchComponent', () => { | ||
let component: SearchComponent; | ||
let fixture: ComponentFixture<SearchComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ SearchComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(SearchComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
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,68 @@ | ||
import { Component, OnInit, Output, EventEmitter } from '@angular/core'; | ||
import { Legenda } from 'src/app/model/legenda'; | ||
import { MapService } from 'src/app/services/map.service'; | ||
import { LegendaService } from 'src/app/services/legenda.service'; | ||
import { VgiPoint } from 'src/app/model/point'; | ||
import { FormGroup, FormBuilder } from '@angular/forms'; | ||
import { Search } from 'src/app/model/search'; | ||
import { ModalService } from 'src/app/services/modal-popups.service'; | ||
import { MatDialogRef } from '@angular/material'; | ||
|
||
@Component({ | ||
selector: 'app-search', | ||
templateUrl: './search.component.html', | ||
styleUrls: ['./search.component.css'] | ||
}) | ||
export class SearchComponent implements OnInit { | ||
|
||
legende: Legenda []; | ||
|
||
points: VgiPoint []; | ||
|
||
formSearch: FormGroup; | ||
|
||
@Output() | ||
searchCompleted: EventEmitter<any> = new EventEmitter(); | ||
|
||
constructor(private fb: FormBuilder, private modalService: ModalService<Search>, | ||
private dialogRef: MatDialogRef<SearchComponent>, | ||
private mapService: MapService, private legendaService: LegendaService) { } | ||
|
||
ngOnInit() { | ||
this.createFormGroup(); | ||
this.legendaService.getLegende().subscribe( | ||
(data: Legenda[]) => { | ||
this.legende = data; | ||
}, | ||
(error) => { | ||
console.log(error); | ||
} | ||
); | ||
} | ||
|
||
search () { | ||
this.modalService.save(this.dialogRef, this.formSearch); | ||
this.dialogRef.afterClosed().subscribe( | ||
(search: Search) => { | ||
this.mapService.searchLocations(search.annoDa, search.annoA, search.idLegenda).subscribe( | ||
(points: VgiPoint []) => { | ||
this.mapService.points = points; | ||
this.searchCompleted.emit(); | ||
} | ||
); | ||
} | ||
); | ||
|
||
} | ||
|
||
createFormGroup () { | ||
this.formSearch = this.fb.group( | ||
{ | ||
annoDa: [''], | ||
annoA: [''], | ||
idLegenda: [''], | ||
} | ||
); | ||
} | ||
|
||
} |
Oops, something went wrong.