Skip to content

Commit

Permalink
data(unesco): better GFI
Browse files Browse the repository at this point in the history
  • Loading branch information
azarz committed Feb 10, 2025
1 parent d4f6946 commit 4556921
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 12 deletions.
12 changes: 12 additions & 0 deletions src/css/position.css
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,25 @@
margin-left: 10px;
}

.positionTitle2 {
font-family: "Open Sans Semibold";
font-size: 15px;
margin: 4px 0;
}

.positionSubTitle {
font-family: "Open Sans";
font-size: 13px;
color: var(--mid-grey);
margin: 0;
}

.unescoDate {
display: flex;
align-items: center;
gap: 10px;
}

.positionHtmlBefore {
line-height: 20px;
}
Expand Down
Binary file modified src/html/img/layers/IGNF_SITES-UNESCO.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/js/data-layer/layers-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
"format": "image/png"
},
"IGNF_SITES-UNESCO$WMS": {
"title": "Sites du patrimoine mondial de l'UNESCO",
"title": "Patrimoine mondial de l'UNESCO",
"description": "Sites du patrimoine mondial de l'UNESCO : Le patrimoine mondial est une appellation attribuée à des lieux ou des biens, situés à travers le monde, possédant une valeur universelle exceptionnelle. A ce titre, ils sont inscrits sur la Liste du patrimoine mondial afin d’être protégés pour que les générations futures puissent encore les apprécier à leur tour.",
"source": "Institut national de l'information géographique et forestière",
"maj": "Février 2025",
Expand Down
2 changes: 1 addition & 1 deletion src/js/immersive-position.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ImmersivePosion extends EventTarget {
parcHtml += `Vous êtes ${egalementStr}situé au sein de la ${this.data["BDTOPO_V3:parc_ou_reserve"][i][1]}. `;
} else if (this.data["BDTOPO_V3:parc_ou_reserve"][i][0] === "Site Natura 2000") {
let name = this.data["BDTOPO_V3:parc_ou_reserve"].length === 1 ? ` (${this.data["BDTOPO_V3:parc_ou_reserve"][i][1]})` : "";
parcHtml += `Vous êtes sur un site classé Natura 2000${name} où la faune et la flore sont protégés.`;
parcHtml += `Vous êtes sur un site classé Natura 2000${name} où la faune et la flore sont protégées.`;
} else {
parcHtml += `Vous êtes ${egalementStr}situé au sein du/de la ${this.data["BDTOPO_V3:parc_ou_reserve"][i][0]} de ${this.data["BDTOPO_V3:parc_ou_reserve"][i][1]}. `;
}
Expand Down
42 changes: 32 additions & 10 deletions src/js/map-interactivity/gfi-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const gfiRules = {
["{{cjp}}"]
],
"bodyAfter": [
["<p class=\"positionWeb positionInfo\"><a href=\"{{url}}\"", "alt=\"{{url}}\" target=\"_blank.POI\">", "Accéder à la fiche</a></p>"],
["<p class=\"positionWeb positionInfo\"><a href=\"{{url}}\"", "alt=\"{{url}}\" target=\"_blank\">", "Accéder à la fiche</a></p>"],
],
}
},
Expand All @@ -67,9 +67,13 @@ const gfiRules = {
"IGNF_SITES-UNESCO$WMS": {
0: {
"title": "@nom",
"title2": "@sous_titre",
"subtitle": "Sites du patrimoine mondial de l'UNESCO - Source : IGN",
"bodyAfter": [
["<p class=\"monumentsHistoriquesContent\">{{description}}</p>"]
["<p class=\"unescoDate\"><img class=\"unescoimg\" src=\"https://data.geopf.fr/annexes/ressources/UNESCO/Unesco-Images-Redimentionnees/{{nom_image}}\">"],
["Année d'inscription : {{date_inscription}}</p>"],
["<p class=\"monumentsHistoriquesContent\">{{description}}</p>"],
["<p class=\"positionWeb positionInfo\"><a target=\"_blank\" href=\"{{lien_unesco}}\">Accéder à la fiche UNESCO</a></p>"],
],
}
},
Expand All @@ -78,7 +82,7 @@ const gfiRules = {
"title": "@sitename",
"subtitle": "Sites NATURA 2000 au titre de la Directive Oiseaux - Source : Inventaire National du Patrimoine Naturel (INPN), Ministère de la Transition écologique, Muséum national d’Histoire naturelle (MNHN)",
"bodyAfter": [
["<p class=\"positionWeb positionInfo\"><a href=\"{{url}}\">Accéder à la fiche</a></p>"]
["<p class=\"positionWeb positionInfo\"><a href=\"{{url}}\" target=\"_blank\">Accéder à la fiche</a></p>"]
],
}
},
Expand All @@ -87,7 +91,7 @@ const gfiRules = {
"title": "@nom",
"subtitle": "Parcs nationaux - Source : Inventaire National du Patrimoine Naturel (INPN), Parcs Nationaux de France, Muséum national d’Histoire naturelle (MNHN)",
"bodyAfter": [
["<p class=\"positionWeb positionInfo\"><a href=\"{{url}}\">Accéder à la fiche</a></p>"]
["<p class=\"positionWeb positionInfo\"><a href=\"{{url}}\" target=\"_blank\">Accéder à la fiche</a></p>"]
],
}
},
Expand All @@ -96,7 +100,7 @@ const gfiRules = {
"title": "@nom",
"subtitle": "Parcs naturels régionaux - Source : Inventaire National du Patrimoine Naturel (INPN), Fédération des Parcs naturels régionaux de France, Muséum national d’Histoire naturelle (MNHN)",
"bodyAfter": [
["<p class=\"positionWeb positionInfo\"><a href=\"{{url}}\">Accéder à la fiche</a></p>"]
["<p class=\"positionWeb positionInfo\"><a href=\"{{url}}\" target=\"_blank\">Accéder à la fiche</a></p>"]
],
}
},
Expand All @@ -105,7 +109,7 @@ const gfiRules = {
"title": "@nom",
"subtitle": "Réserves naturelles nationales - Source : Inventaire National du Patrimoine Naturel (INPN), Réserves naturelles de France (RNF), Muséum national d’Histoire naturelle (MNHN)",
"bodyAfter": [
["<p class=\"positionWeb positionInfo\"><a href=\"{{url}}\">Accéder à la fiche</a></p>"]
["<p class=\"positionWeb positionInfo\"><a href=\"{{url}}\" target=\"_blank\">Accéder à la fiche</a></p>"]
],
}
},
Expand All @@ -114,7 +118,7 @@ const gfiRules = {
"title": "@nom",
"subtitle": "Réserves naturelles régionales - Source : Inventaire National du Patrimoine Naturel (INPN), Muséum national d’Histoire naturelle (MNHN)",
"bodyAfter": [
["<p class=\"positionWeb positionInfo\"><a href=\"{{url}}\">Accéder à la fiche</a></p>"]
["<p class=\"positionWeb positionInfo\"><a href=\"{{url}}\" target=\"_blank\">Accéder à la fiche</a></p>"]
],
}
},
Expand All @@ -123,7 +127,7 @@ const gfiRules = {
"title": "@nom",
"subtitle": "Réserves Naturelles de Corse - Source : Inventaire National du Patrimoine Naturel (INPN), Muséum national d’Histoire naturelle (MNHN)",
"bodyAfter": [
["<p class=\"positionWeb positionInfo\"><a href=\"{{url}}\">Accéder à la fiche</a></p>"]
["<p class=\"positionWeb positionInfo\"><a href=\"{{url}}\" target=\"_blank\">Accéder à la fiche</a></p>"]
],
}
},
Expand All @@ -134,7 +138,7 @@ const gfiRules = {
"bodyBefore": [
],
"bodyAfter": [
["<p class=\"positionWeb positionInfo\"><a href=\"{{url}}\">Accéder à la fiche</a></p>"]
["<p class=\"positionWeb positionInfo\"><a href=\"{{url}}\" target=\"_blank\">Accéder à la fiche</a></p>"]
],
}
},
Expand Down Expand Up @@ -251,13 +255,31 @@ const gfiRules = {
let template = rule[z];
if (template["title"][0] === "@") {
let str = featureProperties[template.title.split("@")[1]].replace("’", "'");
result.title = str[0].toUpperCase() + str.slice(1);
if (str.length) {
result.title = str[0].toUpperCase() + str.slice(1);
} else {
result.title = "";
}
} else {
result.title = template.title;
}
if (template["pretitle"]) {
result.title = template["pretitle"] + result.title;
}
if (template["title2"]) {
let str;
if (template["title2"][0] === "@") {
str = featureProperties[template.title2.split("@")[1]].replace("’", "'");
if (str) {
str = str[0].toUpperCase() + str.slice(1);
}
} else {
str = template["title2"];
}
if (str) {
result.title += `<p class="positionTitle2">${str}</p>`;
}
}
if (template["subtitle"]) {
result.title += `<p class="positionSubTitle">${template["subtitle"]}</p>`;
}
Expand Down

0 comments on commit 4556921

Please sign in to comment.