Skip to content
Snippets Groups Projects
Commit bbbef0bb authored by Dimitri DI GUSTO's avatar Dimitri DI GUSTO
Browse files

Merge branch 'Sollicit_10-02-2022' into 'master'

Sollicit 10 02 2022

See merge request !159
parents 12283349 c9166174
Branches
Tags
1 merge request!159Sollicit 10 02 2022
Pipeline #21331 passed
......@@ -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>
......@@ -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;
}
}
......@@ -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,
};
}
......
......@@ -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"
......
......@@ -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;
}
}
......@@ -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,
});
......
......@@ -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) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment