diff --git a/src/app/dataset-detail/components/dataset-data-details/dataset-data-detail-properties/dataset-data-detail-properties.component.html b/src/app/dataset-detail/components/dataset-data-details/dataset-data-detail-properties/dataset-data-detail-properties.component.html index 1bbc3e3f67fcdb1f9b71cde608a8f552e2df1099..ae4439717741051b3fd783d2bf3f38d1dd6bb356 100644 --- a/src/app/dataset-detail/components/dataset-data-details/dataset-data-detail-properties/dataset-data-detail-properties.component.html +++ b/src/app/dataset-detail/components/dataset-data-details/dataset-data-detail-properties/dataset-data-detail-properties.component.html @@ -41,10 +41,10 @@ </div> <!-- Display the value. If it is url, display a link --> <div *ngSwitchDefault class="property-value"> - <span - *ngIf="!isUrl(properties[key])">{{ (properties[key] && properties[key] !== '') ? properties[key] : '-' }}</span> + <span *ngIf="isFloat(properties[key]) && !isUrl(properties[key])">{{ roundTo(properties[key], 2) }}</span> + <span *ngIf="!isFloat(properties[key]) && !isUrl(properties[key])">{{ (properties[key] && properties[key] !== '') ? properties[key] : '-' }}</span> <a [href]="properties[key]" target="_blank" *ngIf="isUrl(properties[key])">{{ properties[key] }}</a> </div> </ng-container> </div> -</div> \ No newline at end of file +</div> diff --git a/src/app/dataset-detail/components/dataset-data-details/dataset-data-detail-properties/dataset-data-detail-properties.component.ts b/src/app/dataset-detail/components/dataset-data-details/dataset-data-detail-properties/dataset-data-detail-properties.component.ts index 33efab5687f5c682a1385a97ac5a15c810ce9341..687b0065fb173eb7c08daaa9075c1daa809ac900 100644 --- a/src/app/dataset-detail/components/dataset-data-details/dataset-data-detail-properties/dataset-data-detail-properties.component.ts +++ b/src/app/dataset-detail/components/dataset-data-details/dataset-data-detail-properties/dataset-data-detail-properties.component.ts @@ -94,4 +94,13 @@ export class DatasetDataDetailPropertiesComponent implements OnInit { const isStringAndNotNull = value ? typeof value === 'string' : false; return isStringAndNotNull ? value.match(regex) : false; } + + isFloat(n: any) { + return Number(n) === n && n % 1 !== 0; + } + + roundTo(num: number, places: number) { + const factor = 10 ** places; + return Math.round(num * factor) / factor; + } } diff --git a/src/app/dataset-detail/components/dataset-info/dataset-info.component.ts b/src/app/dataset-detail/components/dataset-info/dataset-info.component.ts index a3e454c8ae42751bd4751e8499fb2ced310f97cc..97a4ff2e3f3b12aaccaa21ecf6ee275a62050101 100644 --- a/src/app/dataset-detail/components/dataset-info/dataset-info.component.ts +++ b/src/app/dataset-detail/components/dataset-info/dataset-info.component.ts @@ -78,7 +78,7 @@ export class DatasetInfoComponent implements OnInit, OnDestroy { maxSouth: `${this.metadata.max_south} sud,`, maxNorth: `${this.metadata.max_north} nord,`, }, - coordinatesSystem: this.metadata.crs, + coordinatesSystem: this.metadata.crsDetails.code, }; } diff --git a/src/app/dataset-detail/components/dataset-table/dataset-table.component.html b/src/app/dataset-detail/components/dataset-table/dataset-table.component.html index 72108716e5c10f0fc678096a3053fe15c32e87ef..8d952fae062b039e0fd18ec646ff1af9962910ef 100644 --- a/src/app/dataset-detail/components/dataset-table/dataset-table.component.html +++ b/src/app/dataset-detail/components/dataset-table/dataset-table.component.html @@ -20,12 +20,9 @@ *ngFor="let key of displayedProperties; let indexRow=index;" (click)="emitSelectedData(element)" [attr.role]="'cell'"> <ng-container *ngIf="!isPropertyComplex(element,key)"> - <span *ngIf="!isUrl(element.properties[key]); else urlPropTemplate" - class="data-property-value">{{ element.properties[key] }}</span> - <ng-template #urlPropTemplate> - <a class="data-property-value" target="_blank" - [href]="element.properties[key]">{{ element.properties[key] }}</a> - </ng-template> + <span *ngIf="isFloat(element.properties[key]) && !isUrl(element.properties[key])" class="data-property-value">{{ roundTo(element.properties[key], 2) }}</span> + <span *ngIf="!isFloat(element.properties[key]) && !isUrl(element.properties[key])" class="data-property-value">{{ element.properties[key] }}</span> + <a *ngIf="isUrl(element.properties[key])" [href]="element.properties[key]" target="_blank" class="data-property-value">{{ element.properties[key] }}</a> </ng-container> <span *ngIf="isPropertyComplex(element,key)"> <span i18n-data-tooltip="@@dataset.data.tooltip" diff --git a/src/app/dataset-detail/components/dataset-table/dataset-table.component.ts b/src/app/dataset-detail/components/dataset-table/dataset-table.component.ts index 8f571dac8b8d29c22152d4f630c624bb418c2408..4565953b24c47d0af37c0a6ead8d2777a26ef972 100644 --- a/src/app/dataset-detail/components/dataset-table/dataset-table.component.ts +++ b/src/app/dataset-detail/components/dataset-table/dataset-table.component.ts @@ -166,4 +166,13 @@ export class DatasetTableComponent implements OnInit, OnDestroy { // Make there are no duplicates in the array this.visitedFeatures = [...new Set(this.visitedFeatures)] } + + isFloat(n: any) { + return Number(n) === n && n % 1 !== 0; + } + + roundTo(num: number, places: number) { + const factor = 10 ** places; + return Math.round(num * factor) / factor; + } } diff --git a/src/app/map/services/map.service.ts b/src/app/map/services/map.service.ts index d97753b189dc66ffff7f28007be07a1ff5524ba3..56d6eba5e1098158a97252fe1f52f4efe1ac7fc4 100644 --- a/src/app/map/services/map.service.ts +++ b/src/app/map/services/map.service.ts @@ -170,7 +170,7 @@ export class MapService { type: 'raster', tiles: [ `${APP_CONFIG.backendUrls.proxyQuery}/map/ign?bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1` + - '&request=GetMap&srs=EPSG:3857&width=512&height=512&transparent=true&layers=ORTHOIMAGERY.ORTHOPHOTOS.BDORTHO&styles=normal', + '&request=GetMap&srs=EPSG:3857&width=512&height=512&transparent=true&layers=ORTHOIMAGERY.ORTHOPHOTOS&styles=normal', ], maxzoom: 21, }); diff --git a/src/app/shared/models/metadata.model.ts b/src/app/shared/models/metadata.model.ts index c12f53164a0131181dd66ab69c4e1a88c2d2d1b6..a6389d522eec53d084f3e7460d1851165a2b273f 100644 --- a/src/app/shared/models/metadata.model.ts +++ b/src/app/shared/models/metadata.model.ts @@ -25,6 +25,7 @@ export interface IMetadata { 'popularity': string; 'updateFrequency': string; 'crs': string; + 'crsDetails': ICrsDetails; 'parentId'?: string; 'image': [{ url: string; @@ -50,6 +51,13 @@ interface IMetadataGeonet { isPublishedToAll: string; } +interface ICrsDetails { + code: string; + name: string; + codeSpace: string; + url: string; +} + export interface IResponsibleParty { logo: string; role: string; @@ -177,6 +185,7 @@ export class Metadata { 'max_west': number; updateFrequency: string; crs: string; + crsDetails: ICrsDetails; parentDataset: IParentDataset; providers: string[]; 'image': { @@ -231,6 +240,7 @@ export class Metadata { this.updateFrequency = data.updateFrequency; this.geonet = data['geonet\:info']; this.crs = data.crs; + this.crsDetails = data.crsDetails; this.categories = []; if (data.category) { data.category.forEach((category) => {