Improve cadastral GPS reliability and mobile overlays
This commit is contained in:
1 parent
29c3848a22
commit
5ea424b46c
7 files changed
+243
-30
No files matched your search
+66
-8
@@ -1245,6 +1245,16 @@ input[type="checkbox"] {
|
||||
transition: top 140ms ease;
|
||||
}
|
||||
|
||||
.gps-overlay.is-collapsed {
|
||||
grid-template-columns: auto;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.gps-overlay.is-collapsed .gps-state,
|
||||
.gps-overlay.is-collapsed .gps-actions {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.gps-overlay.search-open {
|
||||
top: 140px;
|
||||
}
|
||||
@@ -1267,8 +1277,14 @@ input[type="checkbox"] {
|
||||
color: #a33227;
|
||||
}
|
||||
|
||||
.gps-actions {
|
||||
display: grid;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.gps-main,
|
||||
.gps-center {
|
||||
.gps-center,
|
||||
.gps-collapse {
|
||||
min-height: 38px;
|
||||
padding: 0 10px;
|
||||
white-space: nowrap;
|
||||
@@ -1279,6 +1295,15 @@ input[type="checkbox"] {
|
||||
color: var(--ink);
|
||||
}
|
||||
|
||||
.gps-collapse {
|
||||
width: 38px;
|
||||
padding: 0;
|
||||
background: #e7ecef;
|
||||
color: var(--ink);
|
||||
font-size: 22px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.leaflet-top.leaflet-right {
|
||||
top: 68px;
|
||||
right: 2px;
|
||||
@@ -1566,11 +1591,36 @@ label {
|
||||
z-index: 820;
|
||||
max-width: min(620px, calc(100% - 460px));
|
||||
border-radius: 8px;
|
||||
padding: 9px 11px;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 8px;
|
||||
padding: 7px 7px 7px 11px;
|
||||
background: rgba(22, 31, 38, 0.88);
|
||||
color: #fff;
|
||||
font-size: 12px;
|
||||
pointer-events: none;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.map-info[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.map-info-text {
|
||||
min-width: 0;
|
||||
padding: 2px 0;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.map-info-close {
|
||||
flex: 0 0 28px;
|
||||
width: 28px;
|
||||
min-height: 28px;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
color: #fff;
|
||||
font-size: 20px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.wms-preview[hidden] {
|
||||
@@ -1817,12 +1867,12 @@ footer {
|
||||
}
|
||||
|
||||
.leaflet-top.leaflet-right {
|
||||
top: 122px;
|
||||
top: 174px;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.map-stage.search-active .leaflet-top.leaflet-right {
|
||||
top: 190px;
|
||||
top: 242px;
|
||||
}
|
||||
|
||||
.gps-main,
|
||||
@@ -1835,12 +1885,15 @@ footer {
|
||||
right: 8px;
|
||||
bottom: calc(var(--nav-height) + 116px);
|
||||
left: 8px;
|
||||
display: -webkit-box;
|
||||
max-width: none;
|
||||
overflow: hidden;
|
||||
line-height: 1.35;
|
||||
overflow-wrap: anywhere;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.map-info-text {
|
||||
display: -webkit-box;
|
||||
overflow: hidden;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 3;
|
||||
}
|
||||
@@ -1864,8 +1917,13 @@ footer {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.gps-overlay {
|
||||
grid-template-columns: minmax(0, 1fr) auto auto;
|
||||
}
|
||||
|
||||
.gps-main,
|
||||
.gps-center {
|
||||
display: none;
|
||||
min-width: 86px;
|
||||
}
|
||||
|
||||
.bottom-tabs button {
|
||||
|
||||
+48
-4
@@ -50,6 +50,8 @@ const lmeState = {
|
||||
gpsTrailStartedAt: null,
|
||||
gpsWatchId: null,
|
||||
lastPosition: null,
|
||||
infoTimeoutSeconds: 3,
|
||||
infoTimer: null,
|
||||
fileImportBound: false,
|
||||
resizeBound: false,
|
||||
googleMapsLoading: null,
|
||||
@@ -185,7 +187,9 @@ window.lmeMap = {
|
||||
setLocalization,
|
||||
setEntitlements,
|
||||
importExternalGisFile,
|
||||
showInfo: setInfo
|
||||
showInfo: setInfo,
|
||||
hideInfo,
|
||||
setInfoTimeout
|
||||
};
|
||||
|
||||
function setLocalization(options = {}) {
|
||||
@@ -5433,13 +5437,24 @@ function refreshCadastreLayer() {
|
||||
});
|
||||
|
||||
let errorShown = false;
|
||||
cadastreLayer.on("tileerror", () => {
|
||||
cadastreLayer.on("tileerror", event => {
|
||||
const tile = event?.tile;
|
||||
const retryCount = Number(tile?.dataset?.lmeRetry || 0);
|
||||
if (tile && retryCount < 2) {
|
||||
tile.dataset.lmeRetry = String(retryCount + 1);
|
||||
window.setTimeout(() => {
|
||||
const separator = tile.src.includes("?") ? "&" : "?";
|
||||
tile.src = `${tile.src}${separator}_lme_retry=${Date.now()}`;
|
||||
}, 450 * (retryCount + 1));
|
||||
return;
|
||||
}
|
||||
|
||||
if (errorShown) {
|
||||
return;
|
||||
}
|
||||
|
||||
errorShown = true;
|
||||
setInfo("Layer catastali non caricati dal servizio AdE. Controlla la connessione e riprova.");
|
||||
setInfo("Il servizio cartografico AdE non ha risposto. La connessione internet puo essere attiva: attendi qualche secondo e riprova.");
|
||||
});
|
||||
cadastreLayer.on("load", () => {
|
||||
errorShown = false;
|
||||
@@ -5905,7 +5920,36 @@ function cadastreUrl() {
|
||||
}
|
||||
|
||||
function setInfo(text) {
|
||||
setText("mapInfo", text);
|
||||
const container = document.getElementById("mapInfo");
|
||||
if (!container) return;
|
||||
|
||||
setText("mapInfoText", text);
|
||||
container.hidden = false;
|
||||
if (lmeState.infoTimer) {
|
||||
window.clearTimeout(lmeState.infoTimer);
|
||||
lmeState.infoTimer = null;
|
||||
}
|
||||
if (lmeState.infoTimeoutSeconds > 0) {
|
||||
lmeState.infoTimer = window.setTimeout(hideInfo, lmeState.infoTimeoutSeconds * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
function hideInfo() {
|
||||
const container = document.getElementById("mapInfo");
|
||||
if (container) container.hidden = true;
|
||||
if (lmeState.infoTimer) {
|
||||
window.clearTimeout(lmeState.infoTimer);
|
||||
lmeState.infoTimer = null;
|
||||
}
|
||||
}
|
||||
|
||||
function setInfoTimeout(seconds) {
|
||||
const value = Number(seconds);
|
||||
lmeState.infoTimeoutSeconds = Number.isFinite(value) ? Math.min(30, Math.max(0, value)) : 3;
|
||||
const container = document.getElementById("mapInfo");
|
||||
if (container && !container.hidden) {
|
||||
setInfo(document.getElementById("mapInfoText")?.textContent || "");
|
||||
}
|
||||
}
|
||||
|
||||
function setText(id, text) {
|
||||
|
||||
Reference in new issue
Block a user