diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts index 6630be72c3c16ae587037871d72f3f2672128e8e..e198b3374fc1476714e8b73b4c4170b1ca24c13c 100644 --- a/src/app/home/home.component.ts +++ b/src/app/home/home.component.ts @@ -52,6 +52,7 @@ export class HomeComponent implements OnInit { private getStructurePosition(structure: Structure): Promise<Structure> { return new Promise((resolve, reject) => { this.getCoord(structure.voie).subscribe((coord: GeoJson) => { + structure.address = coord.properties.name + ' - ' + coord.properties.postcode + ' ' + coord.properties.city; structure.distance = this.geoJsonService.getDistance( coord.geometry.getLon(), coord.geometry.getLat(), diff --git a/src/app/map/models/geoJsonProperties.model.ts b/src/app/map/models/geoJsonProperties.model.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc9abed8dfa0c6db0cbd2e0c3a1f93d651ec5195 --- /dev/null +++ b/src/app/map/models/geoJsonProperties.model.ts @@ -0,0 +1,7 @@ +export class GeoJsonProperties { + public city: string; + public country: string; + public name: string; + public postcode: string; + public state: string; +} diff --git a/src/app/map/models/geojson.model.ts b/src/app/map/models/geojson.model.ts index 3407c70da879424646eeff1ad4ad17893ac9ed7b..8ca263895f084b62e528a5dc49280ded859bdab9 100644 --- a/src/app/map/models/geojson.model.ts +++ b/src/app/map/models/geojson.model.ts @@ -1,9 +1,10 @@ import { AddressGeometry } from './addressGeometry.model'; +import { GeoJsonProperties } from './geoJsonProperties.model'; export class GeoJson { public geometry: AddressGeometry; public type: string; - public properties: object; + public properties: GeoJsonProperties; constructor(obj?: any) { Object.assign(this, obj, { diff --git a/src/app/models/structure.model.ts b/src/app/models/structure.model.ts index 16f2781e638a2c68288a9a21aefee746a03457ed..6cc2c585f5c142d79a99e779438b47f97ce96614 100644 --- a/src/app/models/structure.model.ts +++ b/src/app/models/structure.model.ts @@ -36,6 +36,7 @@ export class Structure { public isOpen: boolean; public openedOn: OpeningDay; public distance?: string; + public address?: string; constructor(obj?: any) { Object.assign(this, obj, { diff --git a/src/app/structure-list/components/structure-details/structure-details.component.html b/src/app/structure-list/components/structure-details/structure-details.component.html index 03cbfe8704900a3316bba2195f2312e9c939e520..ba303e734c3a332a6c018c34b0a1cfbaf1b1aaaf 100644 --- a/src/app/structure-list/components/structure-details/structure-details.component.html +++ b/src/app/structure-list/components/structure-details/structure-details.component.html @@ -12,7 +12,7 @@ <div fxLayout="column" fxFlex="60%"> <div *ngIf="structure.voie" fxLayout="row" fxLayoutAlign="none center"> <em class="ico-marker-pin-sm absolute"></em> - <p>{{ structure.voie }}</p> + <p>{{ structure.n }} {{ structure.address }}</p> </div> <div *ngIf="structure.siteWeb" fxLayout="row" fxLayoutAlign="none center"> <em class="ic-globe-alt"></em>