Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Territories): Optimisation des ressources du widget #278

Merged
merged 4 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions DRAFT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ __DATE__
* 🔥 [Removed]

* 🐛 [Fixed]

* Territories : optimisation des ressources du widget (#278)

* 🔒 [Security]

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "geopf-extensions-openlayers",
"description": "French Geoportal Extensions for OpenLayers libraries",
"version": "1.0.0-beta.0-277",
"version": "1.0.0-beta.0-278",
"date": "25/11/2024",
"module": "src/index.js",
"directories": {},
Expand Down
12 changes: 9 additions & 3 deletions samples-src/pages/tests/Default/pages-ol-bundle-default.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ <h2>Ajout de tous les widgets</h2>
map.addControl(search);

var feature = new ol.control.GetFeatureInfo({
options :{
position : "top-right"
}
position : "top-right"
});
map.addControl(feature);

Expand Down Expand Up @@ -138,6 +136,14 @@ <h2>Ajout de tous les widgets</h2>
collapsed: false
});
map.addControl(overview);

var territories = new ol.control.Territories({
position: "bottom-left",
direction: "vertical",
panel: true,
auto: true
});
map.addControl(territories);
};

Gp.Services.getConfig({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ <h2>Ajout de tous les widgets</h2>
map.addControl(search);

var feature = new ol.control.GetFeatureInfo({
options :{
position : "top-right"
}
position : "top-right"
});
map.addControl(feature);

Expand Down Expand Up @@ -148,13 +146,13 @@ <h2>Ajout de tous les widgets</h2>
});
map.addControl(legends);

var global = new ol.control.Global({
var territories = new ol.control.Territories({
position: "bottom-left",
direction: "vertical",
panel: true,
auto: true
});
map.addControl(global);
map.addControl(territories);
};

Gp.Services.getConfig({
Expand Down
27 changes: 0 additions & 27 deletions src/packages/CSS/Controls/Territories/DSFRterritoriesStyle.css
Original file line number Diff line number Diff line change
Expand Up @@ -111,33 +111,6 @@ div.fr-tile div.fr-tile__header div.fr-tile__thumbnail {
height: 50px;
width: 50px;
}
.fr-tile__icon--fxx {
background-image: url("img/dsfr/picto/fxx.svg");
}
.fr-tile__icon--glp {
background-image: url("img/dsfr/picto/glp.svg");
}
.fr-tile__icon--guf {
background-image: url("img/dsfr/picto/guf.svg");
}
.fr-tile__icon--idf {
background-image: url("img/dsfr/picto/idf.svg");
}
.fr-tile__icon--mtq {
background-image: url("img/dsfr/picto/mtq.svg");
}
.fr-tile__icon--myt {
background-image: url("img/dsfr/picto/myt.svg");
}
.fr-tile__icon--ncl {
background-image: url("img/dsfr/picto/ncl.svg");
}
.fr-tile__icon--reu {
background-image: url("img/dsfr/picto/reu.svg");
}
.fr-tile__icon--spm {
background-image: url("img/dsfr/picto/spm.svg");
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

@lowzonenose lowzonenose Nov 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fallback
à implémenter au fil de l'eau


.tiles-thumbnail div.fr-tile div.fr-tile__header div.fr-tile__icon {
display: none;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 18 additions & 9 deletions src/packages/Controls/Territories/Territories.json

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions src/packages/Controls/Territories/TerritoriesDOM.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ var TerritoriesDOM = {
};
if (o) {
// test si la vignette est renseignée
var thumbnail = o.thumbnail || "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDIwMDEwOTA0Ly9FTiIKICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQvRFREL3N2ZzEwLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiB3aWR0aD0iNTgxLjAwMDAwMHB0IiBoZWlnaHQ9IjM1Ni4wMDAwMDBwdCIgdmlld0JveD0iMCAwIDU4MS4wMDAwMDAgMzU2LjAwMDAwMCIKIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIG1lZXQiPgoKPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMC4wMDAwMDAsMzU2LjAwMDAwMCkgc2NhbGUoMC4xMDAwMDAsLTAuMTAwMDAwKSIKZmlsbD0iI2I0YjNiMyIgc3Ryb2tlPSJub25lIj4KPHBhdGggZD0iTTAgMTc4MCBsMCAtMTc4MCAyOTA1IDAgMjkwNSAwIDAgMTc4MCAwIDE3ODAgLTI5MDUgMCAtMjkwNSAwIDAKLTE3ODB6Ii8+CjwvZz4KPC9zdmc+Cg==";
var defaultImage = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDIwMDEwOTA0Ly9FTiIKICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQvRFREL3N2ZzEwLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiB3aWR0aD0iNTgxLjAwMDAwMHB0IiBoZWlnaHQ9IjM1Ni4wMDAwMDBwdCIgdmlld0JveD0iMCAwIDU4MS4wMDAwMDAgMzU2LjAwMDAwMCIKIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIG1lZXQiPgoKPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMC4wMDAwMDAsMzU2LjAwMDAwMCkgc2NhbGUoMC4xMDAwMDAsLTAuMTAwMDAwKSIKZmlsbD0iI2I0YjNiMyIgc3Ryb2tlPSJub25lIj4KPHBhdGggZD0iTTAgMTc4MCBsMCAtMTc4MCAyOTA1IDAgMjkwNSAwIDAgMTc4MCAwIDE3ODAgLTI5MDUgMCAtMjkwNSAwIDAKLTE3ODB6Ii8+CjwvZz4KPC9zdmc+Cg==";
var thumbnail = o.thumbnail || defaultImage;
var icon = o.icon || defaultImage;
var id = o.id.toLowerCase();
// tile dsfr
var entry = stringToHTML(`
Expand All @@ -192,9 +194,13 @@ var TerritoriesDOM = {
</div>
<div class="gpf-tile__header fr-tile__header">
<div class="fr-tile__pictogram fr-tile__thumbnail">
<img id="${o.id}" src="${thumbnail}" width="100%" height="100%" title="${o.description}"/>
<img id="thumbnail-${o.id}" src="${thumbnail}" width="100%" height="100%" title="${o.description}"/>
</div>
<div class="fr-tile__pictogram fr-tile__icon fr-tile__icon--${id}">
<svg>
<image id="icon-${o.id}" xlink:href="${icon}"/>
</svg>
</div>
<div class="fr-tile__pictogram fr-tile__icon fr-tile__icon--${id}"></div>
</div>
</div>
`);
Expand Down