Skip to content

Commit

Permalink
fix telephone and DL speed
Browse files Browse the repository at this point in the history
  • Loading branch information
azarz committed Feb 10, 2025
1 parent 8828554 commit f239b4a
Show file tree
Hide file tree
Showing 12 changed files with 182 additions and 119 deletions.
95 changes: 54 additions & 41 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"lodash": "^4.17.21",
"maplibre-gl": "^4.3.2",
"npm": "^10.5.0",
"p-limit": "^6.2.0",
"proj4": "^2.10.0"
},
"devDependencies": {
Expand Down
4 changes: 4 additions & 0 deletions src/js/layer-manager/layer-switcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,10 @@ class LayerSwitcher extends EventTarget {
}
this.map.setSprite(data_1.sprite);
this.map.setGlyphs(data_1.glyphs);
// Fallback for offline glyphs
if (!Globals.online) {
this.map.setGlyphs("data/fallback_glyphs/{fontstack}/{range}.pbf");
}
const data_2 = data_1;
LayersGroup.addGroup(id, data_2.layers, layerIdBefore);
this.layers[id].style = data_2.layers; // sauvegarde !
Expand Down
3 changes: 3 additions & 0 deletions src/js/map-interactivity/interactivity-indicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ class InteractivityIndicator {
if (this.hardDisabled) {
return;
}
if (!Globals.online) {
return;
}
if (this.pii && this.position && Math.floor(e.target.getZoom()) >= this.piiMinZoom) {
this.active();
} else {
Expand Down
26 changes: 16 additions & 10 deletions src/js/my-account/my-account-dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,18 +117,18 @@ let MyAccountDOM = {
<div class="tabs-wrap">
<div class="tabs-menu-btn" tabindex="10" title="Sélectionner un onglet"></div>
<div class="tabs-wrap-tabs">
<input class="tabs-input" name="myaccount-tabs" type="radio" id="myaccount-routes-tab"/>
<input class="tabs-input" name="myaccount-tabs" type="radio" id="myaccount-routes-tab" checked="checked"/>
<label class="tabs-label" for="myaccount-routes-tab">Itinéraires <span id="myaccount-routes-number">0</span></label>
<input class="tabs-input" name="myaccount-tabs" type="radio" id="myaccount-offline-maps-tab" checked="checked"/>
<input class="tabs-input" name="myaccount-tabs" type="radio" id="myaccount-offline-maps-tab"/>
<label class="tabs-label" for="myaccount-offline-maps-tab">Cartes téléchargées <span id="myaccount-offline-maps-number">0</span></label>
<input class="tabs-input" name="myaccount-tabs" type="radio" id="myaccount-landmarks-tab"/>
<label class="tabs-label" for="myaccount-landmarks-tab">Points de repère <span id="myaccount-landmarks-number">0</span></label>
<input class="tabs-input" name="myaccount-tabs" type="radio" id="myaccount-compare-landmarks-tab"/>
<label class="tabs-label" for="myaccount-compare-landmarks-tab">Repères Comparer <span id="myaccount-compare-landmarks-number">0</span></label>
</div>
<input class="tabs-input" name="myaccount-tabs" type="radio" id="myaccount-landmarks-tab"/>
<label class="tabs-label" for="myaccount-landmarks-tab">Points de repère <span id="myaccount-landmarks-number">0</span></label>
<input class="tabs-input" name="myaccount-tabs" type="radio" id="myaccount-compare-landmarks-tab"/>
<label class="tabs-label" for="myaccount-compare-landmarks-tab">Repères Comparer <span id="myaccount-compare-landmarks-number">0</span></label>
</div>
<div class="tabs-wrap-content">
<div class="tabs-content" id="myaccount-offline-maps"><div id="myAccountDownloadMapBtn">Télécharger une carte</div></div>
<div class="tabs-content" id="myaccount-routes"><div id="myAccountImportBtnRoutes">Importer</div></div>
<div class="tabs-content" id="myaccount-routes"><div id="myAccountImportBtnRoutes">Importer</div></div>
<div class="tabs-content" id="myaccount-offline-maps"><div id="myAccountDownloadMapBtn">Télécharger une carte</div></div>
<div class="tabs-content" id="myaccount-landmarks"><div id="myAccountImportBtnLandmarks">Importer</div></div>
<div class="tabs-content" id="myaccount-compare-landmarks"></div>
</div>
Expand Down Expand Up @@ -660,14 +660,20 @@ let MyAccountDOM = {
}
if (value === "delete") {
this.deleteOfflineMap(offlineMapId);
Toast.show({
text: "Suppression en cours...",
duration: "short",
position: "bottom"
});
}
});
});

// Au clic sur la carte : zoomer sur l'emprise

container.querySelector(`#offline-map-basic-tools_ID_${offlineMapId}`).addEventListener("click", () => {
this.hide();
this.map.fitBounds([[offlineMap.boundinBox.minLng, offlineMap.boundinBox.minLat], [offlineMap.boundinBox.maxLng, offlineMap.boundinBox.maxLat]]);
this.map.fitBounds([[offlineMap.boundingBox.minLng, offlineMap.boundingBox.minLat], [offlineMap.boundingBox.maxLng, offlineMap.boundingBox.maxLat]]);
});

if (!container) {
Expand Down
12 changes: 6 additions & 6 deletions src/js/my-account/my-account.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,16 +214,16 @@ class MyAccount {
title: "",
passive: true,
options: [
{
text: "Cartes téléchargées",
value: "offline-maps",
class: "actionSheetTabOptionOfflineMaps",
},
{
text: "Itinéraires",
value: "routes",
class: "actionSheetTabOptionRoutes",
},
{
text: "Cartes téléchargées",
value: "offline-maps",
class: "actionSheetTabOptionOfflineMaps",
},
{
text: "Points de repère",
value: "landmarks",
Expand Down Expand Up @@ -525,7 +525,7 @@ class MyAccount {
*/
downloadMap() {
// Place le plan IGN au dessus de la pile des couches
const planIgnLayerBtn = document.getElementById("PLAN.IGN.INTERACTIF$GEOPORTAIL:GPP:TMS");
const planIgnLayerBtn = document.getElementById("PLAN.IGN.INTERACTIF$TMS");
do {
planIgnLayerBtn.click();
} while (!planIgnLayerBtn.classList.contains("selectedLayer"));
Expand Down
Loading

0 comments on commit f239b4a

Please sign in to comment.