Compare commits

..
12 Commits
14 changed files with 1999 additions and 258 deletions

No files matched your search

+115
View File
@@ -0,0 +1,115 @@
<details class="menu-help">
<summary>
<span aria-hidden="true">?</span>
<strong>Guida rapida</strong>
</summary>
<div class="menu-help-content">
<p>@Introduction</p>
<ol>
@foreach (var instruction in Instructions)
{
<li>@instruction</li>
}
</ol>
</div>
</details>
@code {
[Parameter, EditorRequired]
public string Topic { get; set; } = string.Empty;
private string Introduction => Topic switch
{
"layers" => "Qui controlli visibilita, ordine, selezione e organizzazione di tutti gli oggetti presenti sulla mappa.",
"cadastre" => "Trova una particella nel catalogo catastale e mostrane il confine ufficiale sulla mappa.",
"data" => "Importa file GIS, crea disegni e misure oppure aggiungi punti di interesse.",
"save" => "Esporta gli elementi della mappa in un file compatibile con altre applicazioni GIS e GPS.",
"projects" => "Salva il lavoro completo, riaprilo, organizzalo e recupera revisioni o copie di sicurezza.",
"tools" => "Consulta e gestisci gli oggetti in modo avanzato, controlla le coordinate e prepara mappe offline.",
"settings" => "Personalizza mappa, salvataggi, GPS, sincronizzazione e servizi esterni.",
_ => "Consulta le indicazioni essenziali per usare questo pannello."
};
private IReadOnlyList<string> Instructions => Topic switch
{
"layers" =>
[
"Visibilita: usa la casella di una categoria o di un gruppo per mostrare o nascondere tutti i suoi contenuti; la casella del singolo oggetto agisce solo su quello.",
"Gerarchia: premi la freccia accanto alla maniglia per aprire un gruppo. Il rientro, il carattere e la tonalita indicano se una riga e figlia, nipote o di livello successivo.",
"Selezione multipla: attiva il flag sulle righe desiderate. Esempio: seleziona tre poligoni per esportare solo quelli oppure per bloccarli con una sola operazione.",
"Rinomina e attributi: Rinomina modifica il nome mostrato e salvato nei progetti e nei file esportati; Attributi apre un editor multilinea per consultare o correggere i dati associati.",
"Colori: espandi un padre o un figlio e usa gli editor di linea e riempimento. Puoi scegliere il colore, prelevarlo con il contagocce se supportato, oppure inserire e copiare i valori HEX, RGB e HSL; sul padre viene applicato a tutto il gruppo.",
"Blocco: il lucchetto impedisce modifiche e spostamenti involontari. Sblocca l'oggetto prima di usare la matita o gli strumenti geometrici.",
"Sposta nel gruppo cambia l'appartenenza. Esempio: trasferisci un poligono da Disegni e POI a Progetti e dati importati, oppure in un nuovo sottogruppo chiamato Rilievo nord.",
"Sposta geometria cambia invece le coordinate dell'oggetto, per esempio 100 metri verso nord; non modifica il gruppo di appartenenza.",
"Rimuovi dal progetto nasconde l'elemento e lo esclude dai salvataggi successivi; Elimina lo sposta nel cestino. Usa gli strumenti avanzati per ripristinare l'ultima rimozione o svuotare definitivamente il cestino.",
"Ordine: trascina la maniglia di una riga verso l'alto o il basso per cambiare la sovrapposizione sulla mappa."
],
"cadastre" =>
[
"Compila i campi nell'ordine Regione, Comune, Foglio e Particella: ogni scelta carica l'elenco necessario al campo successivo.",
"Esempio: scegli Campania, il Comune, il foglio 12 e la particella 345, poi premi Mostra particella sulla mappa.",
"Il confine ufficiale viene evidenziato sulla mappa. Se Centra e zooma quando seleziono un oggetto e attivo nelle Impostazioni, la mappa lo inquadra automaticamente.",
"Se la particella e gia presente tra disegni, progetti o file GeoJSON, KML e KMZ, l'app riconosce il riferimento catastale o la geometria e riutilizza l'oggetto esistente senza duplicarlo.",
"Se un oggetto gia presente era nascosto, viene reso nuovamente visibile. La visibilita generale dei contorni evidenziati e dei dati importati resta controllabile dal pannello Layer.",
"Quando il servizio ufficiale non restituisce subito il confine, attendi il completamento indicato nel pannello e riprova mantenendo gli stessi dati selezionati."
],
"data" =>
[
"Importazione: premi Carica KML, KMZ o GeoJSON e scegli il file dal dispositivo. I nomi e gli attributi riconosciuti vengono mantenuti.",
"Per KML e KMZ, Includi anche il layer del foglio conserva le cornici presenti nel file. Mostra cornice/layer del foglio recupera inoltre dal servizio ufficiale una cornice distinta per ciascun foglio delle particelle, senza creare un unico riquadro tra fogli lontani.",
"Usa Mostra dati importati e Mostra cornice per controllare separatamente la visibilita. Inquadra dati porta la mappa sull'estensione completa del file.",
"Disegno: premi Mostra strumenti sulla mappa, torna alla mappa e scegli linea, poligono, rettangolo, cerchio o POI nella barra Leaflet.",
"Modifica ed eliminazione possono agire sull'oggetto selezionato o su tutti i disegni. Prima seleziona sulla mappa la linea o il poligono interessato, poi scegli l'ambito dal piccolo comando accanto alla matita o al cestino.",
"Annulla e Ripristina coprono disegni, spostamenti, rinomine ed eliminazioni recenti. Recupera ultimo autosalvataggio ricarica invece l'ultima copia locale creata automaticamente.",
"Esempio POI: porta il centro della mappa sull'ingresso di un terreno, scrivi Cancello nord e premi Aggiungi POI al centro mappa.",
"Per rinominare, bloccare o trasferire un oggetto in un altro gruppo, apri Layer e usa i comandi della relativa riga."
],
"save" =>
[
"Inserisci un nome riconoscibile, per esempio Rilievo particelle 12-345, poi scegli il formato in base all'uso previsto.",
"GeoJSON e adatto ai software GIS e conserva geometrie, nomi e attributi; KML e KMZ sono adatti a Google Earth, con KMZ piu compatto per invio e archiviazione.",
"GPX e pensato per dispositivi e applicazioni GPS; PDF crea un rapporto consultabile e stampabile invece di un file vettoriale modificabile.",
"Attiva solo le categorie da includere. Esempio: per consegnare disegni e particelle importate senza la traccia GPS, lascia attive quelle due voci e disattiva Traccia GPS.",
"Solo oggetti selezionati esporta esclusivamente le righe contrassegnate nel pannello Layer. Se non devi filtrare manualmente, lascia questa opzione disattivata.",
"Premi Esporta e salva file e scegli la cartella o l'app di destinazione proposta dal dispositivo.",
"Nomi rinominati e attributi vengono salvati in GeoJSON, KML e KMZ. Gli sfondi satellitari, stradali e WMS non vengono incorporati nei file vettoriali."
],
"projects" =>
[
"Nuovo progetto: inserisci un nome, scegli se includere i contorni catastali evidenziati e premi Salva progetto. Vengono conservati oggetti, gruppi, nomi, attributi e opzioni di visualizzazione.",
"Aggiornamento: dopo aver aperto un progetto, usa di nuovo Salva progetto con lo stesso nome per aggiornarlo. Se nelle Impostazioni attivi Aggiorna automaticamente il progetto aperto, le modifiche vengono registrate dopo 3 secondi di inattivita.",
"Cartelle: seleziona un progetto, scrivi per esempio Cantieri 2026 e premi Sposta per organizzarlo nell'archivio; questa operazione non sposta le geometrie sulla mappa.",
"Rinomina cambia il nome del progetto selezionato senza alterarne contenuti e revisioni. Duplica crea invece una copia modificabile, utile prima di una variante importante o quando ricevi un progetto in sola lettura.",
"Archivia nasconde logicamente i lavori conclusi senza eliminarli; Ripristina li riporta tra quelli attivi. Elimina rimuove invece il progetto dall'archivio.",
"Condividi modificabile consente al destinatario di continuare il lavoro; Condividi in sola lettura protegge l'originale e richiede una duplicazione per modificarlo.",
"Revisioni: la prima viene creata quando salvi per la seconda volta un progetto gia esistente. L'elenco si aggiorna anche dopo i salvataggi automatici; seleziona una data e usa Apri revisione oppure Confronta.",
"Backup: Crea backup raccoglie tutti i progetti in un file trasferibile. Ripristina backup ricarica un archivio completo; Importa progetto aggiunge invece un singolo progetto condiviso."
],
"tools" =>
[
"Tabella oggetti: apre una vista ordinata di particelle, file importati e disegni. Usa i flag per selezionare piu righe, il lucchetto per proteggerle e la matita per modificare i metadati.",
"Copia metadati: nella maschera Metadati oggetto scegli Copia da e l'oggetto sorgente. Attiva Importa anche i valori per copiare nomi e contenuti; disattivalo per creare soltanto gli stessi campi, lasciandoli vuoti o mantenendo i valori gia presenti.",
"Coordinate WGS84 e UTM: scegli un punto sulla mappa per leggere latitudine e longitudine oppure le coordinate metriche UTM, utili per rilievi e confronti tecnici.",
"Registro operazioni: mostra in ordine cronologico disegni, modifiche, rinomine, spostamenti ed eliminazioni, cosi puoi capire cosa e cambiato durante la sessione.",
"Cestino: Ripristina ultima rimozione recupera l'elemento eliminato piu recente. Svuota cestino elimina definitivamente tutti gli elementi rimossi e non consente ulteriori recuperi.",
"Mappe offline: prima inquadra sulla mappa la zona che ti servira sul campo, quindi scegli quanti livelli di zoom aggiuntivi scaricare. Valori maggiori offrono piu dettaglio ma richiedono piu spazio e tempo.",
"Esempio offline: inquadra il cantiere e le strade di accesso, imposta 2 livelli aggiuntivi e premi Scarica area visibile mentre hai connessione.",
"Usa mappe offline seleziona lo sfondo salvato localmente; Svuota archivio libera lo spazio occupato dalle tessere scaricate."
],
"settings" =>
[
"Mappa e sfondo: scegli la cartografia di base e regola Trasparenza catasto per leggere meglio confini e immagini sottostanti. Esempio: riducila quando le linee coprono dettagli del terreno.",
"Autosalvataggio locale dopo ogni modifica: se attivo, ogni disegno, modifica, rinomina o eliminazione aggiorna immediatamente una copia di recupero nel dispositivo. Per usarla apri Dati e disegni e premi Recupera ultimo autosalvataggio.",
"Aggiorna automaticamente il progetto aperto: funziona solo dopo aver aperto o salvato un progetto modificabile. Dopo una modifica attende 3 secondi senza altre operazioni e aggiorna quel progetto; un progetto in sola lettura non viene mai sovrascritto.",
"Backup automatico: scegli Giornaliero o Settimanale. Alla successiva pressione di Salva progetto, se e trascorso l'intervallo, viene creata una copia interna di tutti i progetti; l'app conserva le 10 copie automatiche piu recenti. Disattivato non crea nuove copie programmate.",
"Esempio consigliato: lascia attivo l'autosalvataggio locale, attiva l'aggiornamento del progetto aperto durante i rilievi e imposta un backup giornaliero. Prima di modifiche importanti crea anche un backup manuale dal menu Progetti.",
"Aggancio ai vertici: avvicinando un nuovo vertice a uno esistente, l'app lo allinea entro la distanza in pixel scelta. Aumenta la distanza su schermi piccoli; riducila quando ci sono molti vertici ravvicinati.",
"Centra e zooma quando seleziono un oggetto: attivalo per inquadrare automaticamente ogni elemento scelto; disattivalo se vuoi mantenere ferma la vista mentre lavori dall'elenco Layer.",
"WebDAV: inserisci indirizzo, utente e password applicazione, salva la configurazione, poi usa Invia al cloud per caricare il backup o Scarica dal cloud per ripristinare quello remoto.",
"GPS e percorso: Mostra punto visualizza posizione e precisione; Registra traccia memorizza il cammino; distanza e avvisi aiutano a controllare l'avvicinamento e l'attraversamento del confine selezionato.",
"Google Maps e Azure Maps richiedono le rispettive chiavi solo quando scegli quegli sfondi. Controlla nuova versione confronta la versione installata con l'ultima pubblicata e mostra le relative modifiche."
],
_ => []
};
}
+197 -26
View File
@@ -10,6 +10,7 @@
@inject MapExportService MapExportService @inject MapExportService MapExportService
@inject CloudSyncService CloudSyncService @inject CloudSyncService CloudSyncService
@inject AppUpdateService AppUpdateService @inject AppUpdateService AppUpdateService
@inject IncomingFileService IncomingFiles
@implements IAsyncDisposable @implements IAsyncDisposable
<PageTitle>LME Mappe Catastali</PageTitle> <PageTitle>LME Mappe Catastali</PageTitle>
@@ -81,7 +82,7 @@
<input type="checkbox" @bind="ShowSelectedParcels" @bind:after="ApplySelectedParcelsVisibility" /> <input type="checkbox" @bind="ShowSelectedParcels" @bind:after="ApplySelectedParcelsVisibility" />
<span> <span>
<strong>Particelle catastali evidenziate</strong> <strong>Particelle catastali evidenziate</strong>
<small>Contorni rossi ottenuti da ricerca o GPS</small> <small>Contorni ottenuti da ricerca o GPS</small>
</span> </span>
</label> </label>
<label class="map-layer-option"> <label class="map-layer-option">
@@ -102,6 +103,7 @@
<button class="danger-command" @onclick="ClearSelectedParcels">Elimina definitivamente le particelle selezionate</button> <button class="danger-command" @onclick="ClearSelectedParcels">Elimina definitivamente le particelle selezionate</button>
<button class="danger-command" @onclick="ClearMapElements">Pulisci elementi mappa</button> <button class="danger-command" @onclick="ClearMapElements">Pulisci elementi mappa</button>
</div> </div>
<MenuHelp Topic="layers" />
</section> </section>
} }
@@ -189,6 +191,7 @@
<strong>Mappa pubblica ufficiale</strong> <strong>Mappa pubblica ufficiale</strong>
<p>I confini visualizzati arrivano dai servizi WMS/WFS open data dell'Agenzia delle Entrate e non richiedono CAPTCHA.</p> <p>I confini visualizzati arrivano dai servizi WMS/WFS open data dell'Agenzia delle Entrate e non richiedono CAPTCHA.</p>
</div> </div>
<MenuHelp Topic="cadastre" />
</section> </section>
} }
else if (ActiveTab == "data") else if (ActiveTab == "data")
@@ -217,7 +220,7 @@
<input type="checkbox" @bind="ShowImportedSheetLayer" @bind:after="ApplyImportedSheetLayerVisibility" /> <input type="checkbox" @bind="ShowImportedSheetLayer" @bind:after="ApplyImportedSheetLayerVisibility" />
<span>Mostra cornice/layer del foglio importato</span> <span>Mostra cornice/layer del foglio importato</span>
</label> </label>
<small class="field-help">La cornice grande resta separata dalle particelle e puo essere nascosta anche nei progetti salvati.</small> <small class="field-help">Carica dal servizio ufficiale una cornice distinta per ogni foglio delle particelle; le cornici restano separate, trasferibili e salvabili nel progetto.</small>
<label class="toggle-line project-save-option"> <label class="toggle-line project-save-option">
<input type="checkbox" @bind="ShowImportedMeasurements" @bind:after="ApplyImportedMeasurementsVisibility" /> <input type="checkbox" @bind="ShowImportedMeasurements" @bind:after="ApplyImportedMeasurementsVisibility" />
<span>Mostra misure dei file caricati</span> <span>Mostra misure dei file caricati</span>
@@ -253,6 +256,7 @@
</label> </label>
<button class="primary-command" @onclick="AddProjectMarker">Aggiungi POI al centro mappa</button> <button class="primary-command" @onclick="AddProjectMarker">Aggiungi POI al centro mappa</button>
</section> </section>
<MenuHelp Topic="data" />
</section> </section>
} }
else if (ActiveTab == "save") else if (ActiveTab == "save")
@@ -289,7 +293,7 @@
</label> </label>
<label class="toggle-line project-save-option"> <label class="toggle-line project-save-option">
<input type="checkbox" @bind="ExportCadastral" @bind:after="SaveFlagPreferences" /> <input type="checkbox" @bind="ExportCadastral" @bind:after="SaveFlagPreferences" />
<span>Particelle catastali rosse e GPS</span> <span>Particelle catastali evidenziate e GPS</span>
</label> </label>
<label class="toggle-line project-save-option"> <label class="toggle-line project-save-option">
<input type="checkbox" @bind="ExportDrawings" @bind:after="SaveFlagPreferences" /> <input type="checkbox" @bind="ExportDrawings" @bind:after="SaveFlagPreferences" />
@@ -310,6 +314,7 @@
<small class="field-help">KML e KMZ sono compatibili con Google Earth. Gli sfondi satellitari e il WMS non vengono incorporati nel file vettoriale.</small> <small class="field-help">KML e KMZ sono compatibili con Google Earth. Gli sfondi satellitari e il WMS non vengono incorporati nel file vettoriale.</small>
</section> </section>
<MenuHelp Topic="save" />
</section> </section>
} }
else if (ActiveTab == "projects") else if (ActiveTab == "projects")
@@ -323,7 +328,7 @@
</label> </label>
<label class="toggle-line project-save-option"> <label class="toggle-line project-save-option">
<input type="checkbox" @bind="IncludeCadastralParcels" @bind:after="SaveFlagPreferences" /> <input type="checkbox" @bind="IncludeCadastralParcels" @bind:after="SaveFlagPreferences" />
<span>Includi le particelle catastali rosse</span> <span>Includi le particelle catastali evidenziate</span>
</label> </label>
<button class="primary-command" @onclick="SaveProject" disabled="@(ProjectBusy || string.IsNullOrWhiteSpace(NewProjectName))">Salva progetto</button> <button class="primary-command" @onclick="SaveProject" disabled="@(ProjectBusy || string.IsNullOrWhiteSpace(NewProjectName))">Salva progetto</button>
</section> </section>
@@ -340,27 +345,26 @@
} }
</select> </select>
</label> </label>
<div class="button-row"> <div class="project-command-stack">
<button @onclick="LoadProject" disabled="@(ProjectBusy || string.IsNullOrWhiteSpace(SelectedProjectId))">Apri</button> <button @onclick="LoadProject" disabled="@(ProjectBusy || string.IsNullOrWhiteSpace(SelectedProjectId))">Apri</button>
<button class="danger-command" @onclick="DeleteProject" disabled="@(ProjectBusy || string.IsNullOrWhiteSpace(SelectedProjectId))">Elimina</button> <button class="danger-command" @onclick="DeleteProject" disabled="@(ProjectBusy || string.IsNullOrWhiteSpace(SelectedProjectId))">Elimina</button>
</div>
<label> <label>
Cartella Cartella
<input @bind="ProjectFolder" placeholder="Es. Cantieri 2026" maxlength="60" /> <input @bind="ProjectFolder" placeholder="Es. Cantieri 2026" maxlength="60" />
</label> </label>
<div class="button-row"> <div class="project-command-stack">
<button class="secondary-command" @onclick="UpdateProjectFolder" disabled="@(ProjectBusy || string.IsNullOrWhiteSpace(SelectedProjectId))">Sposta</button> <button class="secondary-command" @onclick="UpdateProjectFolder" disabled="@(ProjectBusy || string.IsNullOrWhiteSpace(SelectedProjectId))">Sposta</button>
<button class="secondary-command" @onclick="RenameProject" disabled="@(ProjectBusy || string.IsNullOrWhiteSpace(SelectedProjectId) || SelectedProject?.IsReadOnly == true)">Rinomina</button>
<button class="secondary-command" @onclick="DuplicateProject" disabled="@(ProjectBusy || string.IsNullOrWhiteSpace(SelectedProjectId))">Duplica</button> <button class="secondary-command" @onclick="DuplicateProject" disabled="@(ProjectBusy || string.IsNullOrWhiteSpace(SelectedProjectId))">Duplica</button>
</div>
<div class="button-row">
<button class="secondary-command" @onclick="ToggleProjectArchive" disabled="@(ProjectBusy || string.IsNullOrWhiteSpace(SelectedProjectId))">@(SelectedProject?.IsArchived == true ? "Ripristina" : "Archivia")</button> <button class="secondary-command" @onclick="ToggleProjectArchive" disabled="@(ProjectBusy || string.IsNullOrWhiteSpace(SelectedProjectId))">@(SelectedProject?.IsArchived == true ? "Ripristina" : "Archivia")</button>
<button class="secondary-command" @onclick='() => ShareProject(false)' disabled="@(ProjectBusy || string.IsNullOrWhiteSpace(SelectedProjectId))">Condividi modificabile</button> <button class="secondary-command" @onclick='() => ShareProject(false)' disabled="@(ProjectBusy || string.IsNullOrWhiteSpace(SelectedProjectId))">Condividi modificabile</button>
<button class="secondary-command" @onclick='() => ShareProject(true)' disabled="@(ProjectBusy || string.IsNullOrWhiteSpace(SelectedProjectId))">Condividi in sola lettura</button>
</div> </div>
<button class="secondary-command" @onclick='() => ShareProject(true)' disabled="@(ProjectBusy || string.IsNullOrWhiteSpace(SelectedProjectId))">Condividi in sola lettura</button>
@if (SelectedProject?.IsReadOnly == true) @if (SelectedProject?.IsReadOnly == true)
{ {
<small class="field-help">Questo progetto è protetto. Usa Duplica per crearne una copia modificabile.</small> <small class="field-help">Questo progetto è protetto. Usa Duplica per crearne una copia modificabile.</small>
} }
</div>
<label> <label>
Revisione precedente Revisione precedente
<select @bind="SelectedVersionId" disabled="@(ProjectVersions.Count == 0)"> <select @bind="SelectedVersionId" disabled="@(ProjectVersions.Count == 0)">
@@ -371,6 +375,14 @@
} }
</select> </select>
</label> </label>
@if (!string.IsNullOrWhiteSpace(SelectedProjectId) && ProjectVersions.Count == 0)
{
<small class="field-help">Non ci sono ancora revisioni: la prima viene creata quando salvi nuovamente un progetto già esistente.</small>
}
else if (ProjectVersions.Count > 0)
{
<small class="field-help">@ProjectVersions.Count revisioni disponibili, ordinate dalla più recente.</small>
}
<div class="button-row"> <div class="button-row">
<button class="secondary-command" @onclick="LoadProjectVersion" disabled="@(string.IsNullOrWhiteSpace(SelectedVersionId))">Apri revisione</button> <button class="secondary-command" @onclick="LoadProjectVersion" disabled="@(string.IsNullOrWhiteSpace(SelectedVersionId))">Apri revisione</button>
<button class="secondary-command" @onclick="CompareProjectVersion" disabled="@(string.IsNullOrWhiteSpace(SelectedVersionId))">Confronta</button> <button class="secondary-command" @onclick="CompareProjectVersion" disabled="@(string.IsNullOrWhiteSpace(SelectedVersionId))">Confronta</button>
@@ -407,6 +419,7 @@
<span>Mostra misure dei disegni</span> <span>Mostra misure dei disegni</span>
</label> </label>
</section> </section>
<MenuHelp Topic="projects" />
</section> </section>
} }
else if (ActiveTab == "tools") else if (ActiveTab == "tools")
@@ -418,15 +431,6 @@
<button class="secondary-command" @onclick="ShowCoordinateInspector">Coordinate WGS84 e UTM</button> <button class="secondary-command" @onclick="ShowCoordinateInspector">Coordinate WGS84 e UTM</button>
<button class="secondary-command" @onclick="ShowAuditLog">Registro operazioni</button> <button class="secondary-command" @onclick="ShowAuditLog">Registro operazioni</button>
</section> </section>
<section class="panel-section">
<h2>Controllo geometrie</h2>
<small class="field-help">Seleziona gli oggetti dalla mappa o dal pannello Layer.</small>
<div class="button-row">
<button class="secondary-command" @onclick="ValidateSelectedGeometries">Controlla e ripara</button>
<button class="secondary-command" @onclick="CreateSelectedHole">Crea foro</button>
</div>
<button class="secondary-command" @onclick="CompareSelectedGeometries">Confronta due confini</button>
</section>
<section class="panel-section"> <section class="panel-section">
<h2>Cestino</h2> <h2>Cestino</h2>
<div class="button-row"> <div class="button-row">
@@ -447,6 +451,7 @@
</div> </div>
<small class="field-help">@OfflineStatus</small> <small class="field-help">@OfflineStatus</small>
</section> </section>
<MenuHelp Topic="tools" />
</section> </section>
} }
else if (ActiveTab == "settings") else if (ActiveTab == "settings")
@@ -516,6 +521,10 @@
<input type="checkbox" @bind="SnapEnabled" @bind:after="ApplyAdvancedOptions" /> <input type="checkbox" @bind="SnapEnabled" @bind:after="ApplyAdvancedOptions" />
<span>Aggancia i vertici agli oggetti vicini</span> <span>Aggancia i vertici agli oggetti vicini</span>
</label> </label>
<label class="toggle-line project-save-option">
<input type="checkbox" @bind="AutoFitSelectedObject" @bind:after="ApplyAdvancedOptions" />
<span>Centra e zooma quando seleziono un oggetto</span>
</label>
<label> <label>
Distanza aggancio in pixel Distanza aggancio in pixel
<input type="range" min="4" max="40" step="1" @bind="SnapDistancePixels" @bind:after="ApplyAdvancedOptions" /> <input type="range" min="4" max="40" step="1" @bind="SnapDistancePixels" @bind:after="ApplyAdvancedOptions" />
@@ -594,6 +603,7 @@
<button class="secondary-command" @onclick="ExportCadastralImage">Mostra vista WMS corrente</button> <button class="secondary-command" @onclick="ExportCadastralImage">Mostra vista WMS corrente</button>
<footer>Dati catastali: Agenzia delle Entrate, licenza CC BY 4.0. App indipendente.</footer> <footer>Dati catastali: Agenzia delle Entrate, licenza CC BY 4.0. App indipendente.</footer>
</section> </section>
<MenuHelp Topic="settings" />
</section> </section>
} }
</aside> </aside>
@@ -675,6 +685,7 @@
private bool AutoSaveOpenProject { get; set; } private bool AutoSaveOpenProject { get; set; }
private string AutomaticBackupFrequency { get; set; } = "daily"; private string AutomaticBackupFrequency { get; set; } = "daily";
private bool SnapEnabled { get; set; } = true; private bool SnapEnabled { get; set; } = true;
private bool AutoFitSelectedObject { get; set; }
private int SnapDistancePixels { get; set; } = 14; private int SnapDistancePixels { get; set; } = 14;
private bool GpsProximityEnabled { get; set; } = true; private bool GpsProximityEnabled { get; set; } = true;
private bool GpsBoundaryAlertEnabled { get; set; } private bool GpsBoundaryAlertEnabled { get; set; }
@@ -687,6 +698,7 @@
private bool SyncBusy { get; set; } private bool SyncBusy { get; set; }
private string SyncStatus { get; set; } = "Sincronizzazione non configurata."; private string SyncStatus { get; set; } = "Sincronizzazione non configurata.";
private bool UpdateBusy { get; set; } private bool UpdateBusy { get; set; }
private bool MapReady { get; set; }
private string UpdateStatus { get; set; } = $"Versione installata: {AppUpdateService.CurrentVersion}"; private string UpdateStatus { get; set; } = $"Versione installata: {AppUpdateService.CurrentVersion}";
private string UpdateDownloadUrl { get; set; } = string.Empty; private string UpdateDownloadUrl { get; set; } = string.Empty;
private string UpdateReleaseNotes { get; set; } = string.Empty; private string UpdateReleaseNotes { get; set; } = string.Empty;
@@ -744,6 +756,7 @@
protected override async Task OnInitializedAsync() protected override async Task OnInitializedAsync()
{ {
IncomingFiles.FileAvailable += OnIncomingFileAvailable;
LoadFlagPreferences(); LoadFlagPreferences();
try try
@@ -787,12 +800,14 @@
{ {
MapCallbackReference = DotNetObjectReference.Create(this); MapCallbackReference = DotNetObjectReference.Create(this);
await JS.InvokeVoidAsync("lmeMap.init", MapCallbackReference); await JS.InvokeVoidAsync("lmeMap.init", MapCallbackReference);
MapReady = true;
await ApplyFlagPreferencesToMapAsync(); await ApplyFlagPreferencesToMapAsync();
await ApplyAdvancedOptions(); await ApplyAdvancedOptions();
await CenterOnInitialLocationAsync(); await CenterOnInitialLocationAsync();
await MigrateLegacyProjectAsync(); await MigrateLegacyProjectAsync();
var offlineCount = await JS.InvokeAsync<int>("lmeMap.getOfflineTileStats"); var offlineCount = await JS.InvokeAsync<int>("lmeMap.getOfflineTileStats");
OfflineStatus = offlineCount == 0 ? "Nessuna tessera salvata." : $"{offlineCount} tessere disponibili offline."; OfflineStatus = offlineCount == 0 ? "Nessuna tessera salvata." : $"{offlineCount} tessere disponibili offline.";
await ProcessIncomingFilesAsync();
await InvokeAsync(StateHasChanged); await InvokeAsync(StateHasChanged);
} }
} }
@@ -903,6 +918,7 @@
await JS.InvokeVoidAsync("lmeMap.clearLegacyProjectSnapshot"); await JS.InvokeVoidAsync("lmeMap.clearLegacyProjectSnapshot");
await RefreshProjectsAsync(); await RefreshProjectsAsync();
SelectedProjectId = migrated.Id; SelectedProjectId = migrated.Id;
await RefreshProjectVersionsAsync(true);
await InvokeAsync(StateHasChanged); await InvokeAsync(StateHasChanged);
} }
catch catch
@@ -1099,8 +1115,16 @@
var label = $"{municipality.Name} - foglio {DisplaySheet(SelectedSheet)}, particella {parcel.Number}"; var label = $"{municipality.Name} - foglio {DisplaySheet(SelectedSheet)}, particella {parcel.Number}";
CatalogBusy = true; CatalogBusy = true;
CatalogMessage = "Scarico il confine dal servizio ufficiale AdE..."; CatalogMessage = "Scarico il confine dal servizio ufficiale AdE...";
var xml = await OfficialCadastreService.GetParcelsNearAsync(parcel.Latitude, parcel.Longitude, 8); ShowSelectedParcels = true;
await JS.InvokeVoidAsync("lmeMap.displayOfficialParcel", xml, parcel.Latitude, parcel.Longitude, parcel.Number, label, true); SaveFlagPreferences();
await JS.InvokeVoidAsync("lmeMap.setSelectedParcelsVisible", true);
var xml = await OfficialCadastreService.GetParcelsNearAsync(parcel.Latitude, parcel.Longitude, 30);
var displayResult = await JS.InvokeAsync<string>("lmeMap.displayOfficialParcel", xml, parcel.Latitude, parcel.Longitude, parcel.Number, label, true);
if (displayResult == "imported")
{
ShowImportedData = true;
SaveFlagPreferences();
}
ActiveTab = "map"; ActiveTab = "map";
await Task.Delay(30); await Task.Delay(30);
await JS.InvokeVoidAsync("lmeMap.resize"); await JS.InvokeVoidAsync("lmeMap.resize");
@@ -1289,6 +1313,10 @@
return InvokeAsync(StateHasChanged); return InvokeAsync(StateHasChanged);
} }
[JSInvokable]
public Task<string> GetOfficialCadastralSheetsNear(double latitude, double longitude) =>
OfficialCadastreService.GetSheetsNearAsync(latitude, longitude);
[JSInvokable] [JSInvokable]
public Task OnMapChanged(string action) public Task OnMapChanged(string action)
{ {
@@ -1352,6 +1380,7 @@
{ {
SelectedProjectId = string.Empty; SelectedProjectId = string.Empty;
} }
await RefreshProjectVersionsAsync();
ProjectArchiveMessage = Projects.Count == 0 ProjectArchiveMessage = Projects.Count == 0
? "Nessun progetto salvato." ? "Nessun progetto salvato."
: $"{Projects.Count} {(Projects.Count == 1 ? "progetto salvato" : "progetti salvati")} nell'archivio interno."; : $"{Projects.Count} {(Projects.Count == 1 ? "progetto salvato" : "progetti salvati")} nell'archivio interno.";
@@ -1366,10 +1395,18 @@
{ {
SelectedProjectId = args.Value?.ToString() ?? string.Empty; SelectedProjectId = args.Value?.ToString() ?? string.Empty;
ProjectFolder = SelectedProject?.Folder ?? string.Empty; ProjectFolder = SelectedProject?.Folder ?? string.Empty;
SelectedVersionId = string.Empty; await RefreshProjectVersionsAsync(true);
}
private async Task RefreshProjectVersionsAsync(bool resetSelection = false)
{
ProjectVersions = string.IsNullOrWhiteSpace(SelectedProjectId) ProjectVersions = string.IsNullOrWhiteSpace(SelectedProjectId)
? [] ? []
: await ProjectStorageService.GetVersionsAsync(SelectedProjectId); : await ProjectStorageService.GetVersionsAsync(SelectedProjectId);
if (resetSelection || ProjectVersions.All(version => version.Id != SelectedVersionId))
{
SelectedVersionId = string.Empty;
}
} }
private Task UndoMapChange() => JS.InvokeVoidAsync("lmeMap.undoMapChange").AsTask(); private Task UndoMapChange() => JS.InvokeVoidAsync("lmeMap.undoMapChange").AsTask();
@@ -1391,9 +1428,44 @@
await RefreshProjectsAsync(); await RefreshProjectsAsync();
SelectedProjectId = copy.Id; SelectedProjectId = copy.Id;
ProjectFolder = copy.Folder; ProjectFolder = copy.Folder;
await RefreshProjectVersionsAsync(true);
await JS.InvokeVoidAsync("lmeMap.showInfo", $"Progetto duplicato: {copy.Name}."); await JS.InvokeVoidAsync("lmeMap.showInfo", $"Progetto duplicato: {copy.Name}.");
} }
private async Task RenameProject()
{
if (SelectedProject is not { } project) return;
var requestedName = await JS.InvokeAsync<string?>("lmeMap.promptProjectName", project.Name);
if (string.IsNullOrWhiteSpace(requestedName)
|| string.Equals(requestedName.Trim(), project.Name, StringComparison.CurrentCulture))
{
return;
}
ProjectBusy = true;
try
{
var renamed = await ProjectStorageService.RenameAsync(project.Id, requestedName);
await RefreshProjectsAsync();
SelectedProjectId = renamed.Id;
await RefreshProjectVersionsAsync();
NewProjectName = renamed.Name;
if (!HasUnsavedChanges)
{
ExportFileName = renamed.Name;
}
await JS.InvokeVoidAsync("lmeMap.showInfo", $"Progetto rinominato: {renamed.Name}.");
}
catch (Exception error)
{
await JS.InvokeVoidAsync("lmeMap.showInfo", $"Progetto non rinominato: {error.GetBaseException().Message}");
}
finally
{
ProjectBusy = false;
}
}
private async Task UpdateProjectFolder() private async Task UpdateProjectFolder()
{ {
if (SelectedProject is null) return; if (SelectedProject is null) return;
@@ -1425,7 +1497,11 @@
private async Task RestoreBackup() private async Task RestoreBackup()
{ {
var file = await FilePicker.Default.PickAsync(new PickOptions { PickerTitle = "Scegli backup LME" }); var file = await FilePicker.Default.PickAsync(new PickOptions
{
PickerTitle = "Scegli backup LME (.lmebackup.zip)",
FileTypes = BackupPickerFileTypes
});
if (file is null) return; if (file is null) return;
var path = await CopyPickedFileToCacheAsync(file); var path = await CopyPickedFileToCacheAsync(file);
var count = await ProjectStorageService.RestoreBackupAsync(path); var count = await ProjectStorageService.RestoreBackupAsync(path);
@@ -1435,12 +1511,17 @@
private async Task ImportProject() private async Task ImportProject()
{ {
var file = await FilePicker.Default.PickAsync(new PickOptions { PickerTitle = "Scegli progetto LME" }); var file = await FilePicker.Default.PickAsync(new PickOptions
{
PickerTitle = "Scegli progetto LME (.lmeproject.json)",
FileTypes = ProjectPickerFileTypes
});
if (file is null) return; if (file is null) return;
var path = await CopyPickedFileToCacheAsync(file); var path = await CopyPickedFileToCacheAsync(file);
var imported = await ProjectStorageService.ImportProjectAsync(path); var imported = await ProjectStorageService.ImportProjectAsync(path);
await RefreshProjectsAsync(); await RefreshProjectsAsync();
SelectedProjectId = imported.Id; SelectedProjectId = imported.Id;
await RefreshProjectVersionsAsync(true);
await JS.InvokeVoidAsync("lmeMap.showInfo", $"Progetto importato: {imported.Name}."); await JS.InvokeVoidAsync("lmeMap.showInfo", $"Progetto importato: {imported.Name}.");
} }
@@ -1453,6 +1534,91 @@
return path; return path;
} }
private void OnIncomingFileAvailable()
{
if (MapReady) _ = InvokeAsync(ProcessIncomingFilesAsync);
}
private async Task ProcessIncomingFilesAsync()
{
while (IncomingFiles.TryDequeue(out var incoming) && incoming is not null)
{
try
{
var lowerName = incoming.FileName.ToLowerInvariant();
if (lowerName.EndsWith(".kml", StringComparison.Ordinal)
|| lowerName.EndsWith(".kmz", StringComparison.Ordinal)
|| lowerName.EndsWith(".geojson", StringComparison.Ordinal)
|| await IsGeoJsonAsync(incoming.Path))
{
var content = Convert.ToBase64String(await File.ReadAllBytesAsync(incoming.Path));
await JS.InvokeAsync<string>("lmeMap.importExternalGisFile", incoming.FileName, content, incoming.ContentType);
continue;
}
if (lowerName.EndsWith(".zip", StringComparison.Ordinal))
{
var count = await ProjectStorageService.RestoreBackupAsync(incoming.Path);
await RefreshProjectsAsync();
await JS.InvokeVoidAsync("lmeMap.showInfo", $"Backup aperto: {count} progetti ripristinati.");
continue;
}
if (lowerName.EndsWith(".json", StringComparison.Ordinal))
{
var imported = await ProjectStorageService.ImportProjectAsync(incoming.Path);
await RefreshProjectsAsync();
SelectedProjectId = imported.Id;
await RefreshProjectVersionsAsync(true);
await JS.InvokeVoidAsync("lmeMap.showInfo", $"Progetto aperto: {imported.Name}.");
continue;
}
await JS.InvokeVoidAsync("lmeMap.showInfo", $"Formato non riconosciuto: {incoming.FileName}.");
}
catch (Exception error)
{
await JS.InvokeVoidAsync("lmeMap.showInfo", $"Impossibile aprire {incoming.FileName}: {error.GetBaseException().Message}");
}
finally
{
try { File.Delete(incoming.Path); } catch { }
}
}
}
private static async Task<bool> IsGeoJsonAsync(string path)
{
if (!Path.GetExtension(path).Equals(".json", StringComparison.OrdinalIgnoreCase)) return false;
try
{
await using var stream = File.OpenRead(path);
using var document = await System.Text.Json.JsonDocument.ParseAsync(stream);
if (!document.RootElement.TryGetProperty("type", out var typeProperty)) return false;
var type = typeProperty.GetString();
return type is "Feature" or "FeatureCollection" or "Point" or "MultiPoint"
or "LineString" or "MultiLineString" or "Polygon" or "MultiPolygon"
or "GeometryCollection";
}
catch { return false; }
}
private static readonly FilePickerFileType ProjectPickerFileTypes = new(new Dictionary<DevicePlatform, IEnumerable<string>>
{
[DevicePlatform.Android] = ["application/json", "text/json", "text/plain", "application/octet-stream"],
[DevicePlatform.WinUI] = [".json"],
[DevicePlatform.iOS] = ["public.json", "public.data"],
[DevicePlatform.macOS] = ["public.json", "public.data"]
});
private static readonly FilePickerFileType BackupPickerFileTypes = new(new Dictionary<DevicePlatform, IEnumerable<string>>
{
[DevicePlatform.Android] = ["application/zip", "application/x-zip-compressed", "application/octet-stream"],
[DevicePlatform.WinUI] = [".zip"],
[DevicePlatform.iOS] = ["public.zip-archive", "public.data"],
[DevicePlatform.macOS] = ["public.zip-archive", "public.data"]
});
private async Task LoadProjectVersion() private async Task LoadProjectVersion()
{ {
if (SelectedProject is null || string.IsNullOrWhiteSpace(SelectedVersionId)) return; if (SelectedProject is null || string.IsNullOrWhiteSpace(SelectedVersionId)) return;
@@ -1541,6 +1707,7 @@
existing?.Id); existing?.Id);
await RefreshProjectsAsync(); await RefreshProjectsAsync();
SelectedProjectId = saved.Id; SelectedProjectId = saved.Id;
await RefreshProjectVersionsAsync();
NewProjectName = saved.Name; NewProjectName = saved.Name;
await JS.InvokeVoidAsync("lmeMap.setProjectReadOnly", false); await JS.InvokeVoidAsync("lmeMap.setProjectReadOnly", false);
await JS.InvokeVoidAsync("lmeMap.markProjectSaved"); await JS.InvokeVoidAsync("lmeMap.markProjectSaved");
@@ -1549,8 +1716,8 @@
await JS.InvokeVoidAsync( await JS.InvokeVoidAsync(
"lmeMap.showInfo", "lmeMap.showInfo",
IncludeCadastralParcels IncludeCadastralParcels
? $"Progetto salvato: {saved.Name}, incluse le particelle rosse." ? $"Progetto salvato: {saved.Name}, incluse le particelle catastali evidenziate."
: $"Progetto salvato: {saved.Name}, senza particelle rosse."); : $"Progetto salvato: {saved.Name}, senza particelle catastali evidenziate.");
} }
catch (Exception error) catch (Exception error)
{ {
@@ -1894,6 +2061,7 @@
AutoSaveOpenProject = GetFlagPreference("auto_save_project", false); AutoSaveOpenProject = GetFlagPreference("auto_save_project", false);
AutomaticBackupFrequency = Preferences.Default.Get($"{FlagPreferencePrefix}backup_frequency", "daily"); AutomaticBackupFrequency = Preferences.Default.Get($"{FlagPreferencePrefix}backup_frequency", "daily");
SnapEnabled = GetFlagPreference("snap_enabled", true); SnapEnabled = GetFlagPreference("snap_enabled", true);
AutoFitSelectedObject = GetFlagPreference("auto_fit_selected_object", false);
SnapDistancePixels = Preferences.Default.Get($"{FlagPreferencePrefix}snap_distance", 14); SnapDistancePixels = Preferences.Default.Get($"{FlagPreferencePrefix}snap_distance", 14);
OfflineExtraZoomLevels = Preferences.Default.Get($"{FlagPreferencePrefix}offline_zoom_levels", 2); OfflineExtraZoomLevels = Preferences.Default.Get($"{FlagPreferencePrefix}offline_zoom_levels", 2);
GpsProximityEnabled = GetFlagPreference("gps_proximity", true); GpsProximityEnabled = GetFlagPreference("gps_proximity", true);
@@ -1928,6 +2096,7 @@
SetFlagPreference("auto_save_project", AutoSaveOpenProject); SetFlagPreference("auto_save_project", AutoSaveOpenProject);
Preferences.Default.Set($"{FlagPreferencePrefix}backup_frequency", AutomaticBackupFrequency); Preferences.Default.Set($"{FlagPreferencePrefix}backup_frequency", AutomaticBackupFrequency);
SetFlagPreference("snap_enabled", SnapEnabled); SetFlagPreference("snap_enabled", SnapEnabled);
SetFlagPreference("auto_fit_selected_object", AutoFitSelectedObject);
Preferences.Default.Set($"{FlagPreferencePrefix}snap_distance", SnapDistancePixels); Preferences.Default.Set($"{FlagPreferencePrefix}snap_distance", SnapDistancePixels);
Preferences.Default.Set($"{FlagPreferencePrefix}offline_zoom_levels", OfflineExtraZoomLevels); Preferences.Default.Set($"{FlagPreferencePrefix}offline_zoom_levels", OfflineExtraZoomLevels);
SetFlagPreference("gps_proximity", GpsProximityEnabled); SetFlagPreference("gps_proximity", GpsProximityEnabled);
@@ -1964,6 +2133,7 @@
{ {
autoSaveEnabled = AutoSaveEnabled, autoSaveEnabled = AutoSaveEnabled,
snapEnabled = SnapEnabled, snapEnabled = SnapEnabled,
autoFitSelectedObject = AutoFitSelectedObject,
snapDistancePixels = SnapDistancePixels, snapDistancePixels = SnapDistancePixels,
gpsProximityEnabled = GpsProximityEnabled, gpsProximityEnabled = GpsProximityEnabled,
gpsBoundaryAlertEnabled = GpsBoundaryAlertEnabled gpsBoundaryAlertEnabled = GpsBoundaryAlertEnabled
@@ -2049,6 +2219,7 @@
public ValueTask DisposeAsync() public ValueTask DisposeAsync()
{ {
IncomingFiles.FileAvailable -= OnIncomingFileAvailable;
CancelCatalogWork(); CancelCatalogWork();
LocationService.StopTracking(); LocationService.StopTracking();
GpsLookupCancellation?.Cancel(); GpsLookupCancellation?.Cancel();
+13 -5
View File
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Razor"> <Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks> <TargetFrameworks>net10.0-android;net10.0-ios;net10.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks> <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net10.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET --> <!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net9.0-tizen</TargetFrameworks> --> <!-- <TargetFrameworks>$(TargetFrameworks);net9.0-tizen</TargetFrameworks> -->
@@ -28,8 +28,8 @@
<ApplicationId>com.companyname.lmemappecatastaliapp</ApplicationId> <ApplicationId>com.companyname.lmemappecatastaliapp</ApplicationId>
<!-- Versions --> <!-- Versions -->
<ApplicationDisplayVersion>0.4.0</ApplicationDisplayVersion> <ApplicationDisplayVersion>0.4.10</ApplicationDisplayVersion>
<ApplicationVersion>35</ApplicationVersion> <ApplicationVersion>45</ApplicationVersion>
<Version>$(ApplicationDisplayVersion)</Version> <Version>$(ApplicationDisplayVersion)</Version>
<!-- To develop, package, and publish an app to the Microsoft Store, see: https://aka.ms/MauiTemplateUnpackaged --> <!-- To develop, package, and publish an app to the Microsoft Store, see: https://aka.ms/MauiTemplateUnpackaged -->
@@ -43,6 +43,14 @@
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion> <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release' and $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
<AndroidTargetSdkVersion>36</AndroidTargetSdkVersion>
<AndroidPackageFormat>aab</AndroidPackageFormat>
<AndroidUseAapt2>true</AndroidUseAapt2>
<AndroidCreatePackagePerAbi>false</AndroidCreatePackagePerAbi>
<RunAOTCompilation>true</RunAOTCompilation>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<!-- App Icon --> <!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#075E54" /> <MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#075E54" />
@@ -64,7 +72,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" /> <PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="$(MauiVersion)" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.9" /> <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="10.0.12" />
<PackageReference Include="Parquet.Net" Version="6.1.0" /> <PackageReference Include="Parquet.Net" Version="6.1.0" />
</ItemGroup> </ItemGroup>
+1
View File
@@ -26,6 +26,7 @@ public static class MauiProgram
builder.Services.AddSingleton<MapExportService>(); builder.Services.AddSingleton<MapExportService>();
builder.Services.AddSingleton<CloudSyncService>(); builder.Services.AddSingleton<CloudSyncService>();
builder.Services.AddSingleton<AppUpdateService>(); builder.Services.AddSingleton<AppUpdateService>();
builder.Services.AddSingleton(IncomingFileService.Shared);
#if DEBUG #if DEBUG
builder.Services.AddBlazorWebViewDeveloperTools(); builder.Services.AddBlazorWebViewDeveloperTools();
+93 -2
View File
@@ -1,10 +1,101 @@
using Android.App; using Android.App;
using Android.Content;
using Android.Content.PM; using Android.Content.PM;
using Android.Database;
using Android.OS; using Android.OS;
using Android.Provider;
using Android.Views;
using AndroidX.Core.View;
using LMEMappeCatastaliApp.Services;
namespace LMEMappeCatastaliApp; namespace LMEMappeCatastaliApp;
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
[IntentFilter([Intent.ActionView], Categories = [Intent.CategoryDefault, Intent.CategoryBrowsable], DataMimeType = "application/json")]
[IntentFilter([Intent.ActionView], Categories = [Intent.CategoryDefault, Intent.CategoryBrowsable], DataMimeType = "application/geo+json")]
[IntentFilter([Intent.ActionView], Categories = [Intent.CategoryDefault, Intent.CategoryBrowsable], DataMimeType = "application/geojson")]
[IntentFilter([Intent.ActionView], Categories = [Intent.CategoryDefault, Intent.CategoryBrowsable], DataMimeType = "application/vnd.google-earth.kml+xml")]
[IntentFilter([Intent.ActionView], Categories = [Intent.CategoryDefault, Intent.CategoryBrowsable], DataMimeType = "application/vnd.google-earth.kmz")]
[IntentFilter([Intent.ActionView], Categories = [Intent.CategoryDefault, Intent.CategoryBrowsable], DataMimeType = "application/xml")]
[IntentFilter([Intent.ActionView], Categories = [Intent.CategoryDefault, Intent.CategoryBrowsable], DataMimeType = "text/xml")]
[IntentFilter([Intent.ActionView], Categories = [Intent.CategoryDefault, Intent.CategoryBrowsable], DataMimeType = "application/zip")]
[IntentFilter([Intent.ActionView], Categories = [Intent.CategoryDefault, Intent.CategoryBrowsable], DataMimeType = "application/x-zip-compressed")]
[IntentFilter([Intent.ActionView], Categories = [Intent.CategoryDefault, Intent.CategoryBrowsable], DataMimeType = "application/octet-stream")]
public class MainActivity : MauiAppCompatActivity public class MainActivity : MauiAppCompatActivity
{ {
protected override void OnCreate(Bundle? savedInstanceState)
{
base.OnCreate(savedInstanceState);
ApplySystemBarInsets();
QueueViewedFile(Intent);
}
private void ApplySystemBarInsets()
{
var content = FindViewById<Android.Views.View>(Android.Resource.Id.Content);
if (content is null) return;
ViewCompat.SetOnApplyWindowInsetsListener(content, new SystemBarInsetsListener(content));
ViewCompat.RequestApplyInsets(content);
}
protected override void OnNewIntent(Intent? intent)
{
base.OnNewIntent(intent);
Intent = intent;
QueueViewedFile(intent);
}
private void QueueViewedFile(Intent? intent)
{
if (intent?.Action == Android.Content.Intent.ActionView && intent.Data is not null)
{
_ = CopyViewedFileAsync(intent);
}
}
private async Task CopyViewedFileAsync(Intent intent)
{
try
{
var uri = intent.Data!;
var fileName = ReadDisplayName(uri) ?? $"file-{Guid.NewGuid():N}";
fileName = string.Concat(fileName.Select(character => Path.GetInvalidFileNameChars().Contains(character) ? '_' : character));
var directory = Path.Combine(FileSystem.CacheDirectory, "Incoming");
Directory.CreateDirectory(directory);
var path = Path.Combine(directory, $"{Guid.NewGuid():N}-{fileName}");
await using var input = ContentResolver!.OpenInputStream(uri)
?? throw new IOException("Impossibile leggere il file selezionato.");
await using var output = File.Create(path);
await input.CopyToAsync(output);
IncomingFileService.Shared.Enqueue(new IncomingFile(path, fileName, intent.Type));
}
catch (Exception error)
{
System.Diagnostics.Debug.WriteLine($"Apertura file LME non riuscita: {error}");
}
}
private string? ReadDisplayName(Android.Net.Uri uri)
{
if (uri.Scheme == ContentResolver.SchemeFile) return Path.GetFileName(uri.Path);
using ICursor? cursor = ContentResolver?.Query(uri, [IOpenableColumns.DisplayName], null, null, null);
if (cursor is null || !cursor.MoveToFirst()) return null;
var index = cursor.GetColumnIndex(IOpenableColumns.DisplayName);
return index >= 0 ? cursor.GetString(index) : null;
}
private sealed class SystemBarInsetsListener(Android.Views.View content) : Java.Lang.Object, IOnApplyWindowInsetsListener
{
private readonly int _left = content.PaddingLeft;
private readonly int _top = content.PaddingTop;
private readonly int _right = content.PaddingRight;
public WindowInsetsCompat? OnApplyWindowInsets(Android.Views.View? view, WindowInsetsCompat? insets)
{
if (view is null || insets is null) return insets;
var systemBars = insets.GetInsets(WindowInsetsCompat.Type.SystemBars());
view.SetPadding(_left, _top, _right, systemBars?.Bottom ?? 0);
return insets;
}
}
} }
+75
View File
@@ -2,6 +2,81 @@
App .NET MAUI Blazor Hybrid per Android, iOS, Mac Catalyst e Windows, pensata per consultare mappe catastali e lavorare sul campo con GPS. App .NET MAUI Blazor Hybrid per Android, iOS, Mac Catalyst e Windows, pensata per consultare mappe catastali e lavorare sul campo con GPS.
## Versione 0.4.10
- I pannelli mobili rispettano la barra di navigazione Android e mantengono il pulsante Help completamente raggiungibile tramite scorrimento.
## Versione 0.4.9
- Linee e punti KML/KMZ vengono sempre importati, anche quando il documento viene riconosciuto come catastale; il filtro particelle separa soltanto i poligoni di foglio o cornice.
## Versione 0.4.8
- Aggiornamento a .NET 10 e target Android API 36.
- KML e KMZ generici conservano punti, linee e poligoni; il filtro particelle viene applicato soltanto ai file riconosciuti come catastali.
- Android propone LME tra le app disponibili per aprire KML, KMZ, GeoJSON, progetti JSON e backup ZIP.
- I selettori file Android mostrano correttamente progetti condivisi e backup con estensione composta.
## Versione 0.4.7
- La ricerca nel pannello Layer conserva correttamente posizione e selezione del cursore durante il filtraggio; digitando `pio` il testo non viene piu invertito in `oip`.
- L'elenco revisioni viene aggiornato dopo salvataggi manuali e automatici, rinomina, importazione e selezione del progetto.
- Il pannello Progetti mostra quante revisioni sono disponibili e spiega quando un progetto appena creato non possiede ancora versioni precedenti.
## Versione 0.4.6
- `Mostra cornice/layer del foglio` carica dal WFS ufficiale AdE il vero confine `CP:CadastralZoning` di ciascun foglio delle particelle.
- Le particelle appartenenti a fogli diversi producono cornici distinte, senza piu creare un unico rettangolo cumulativo tra aree lontane.
- Le cornici gia presenti nel progetto o trasferite in un altro gruppo vengono riconosciute e non vengono scaricate o duplicate.
- Ogni foglio e salvato come oggetto autonomo e puo essere rinominato, bloccato, rimosso o spostato in un altro gruppo dal pannello Layer.
- I vecchi riquadri cumulativi generati automaticamente vengono rimossi durante il caricamento e sostituiti dai fogli ufficiali.
## Versione 0.4.5
- Corretto il layout del pannello Layer sui telefoni e sui foldable: checkbox, lucchetto, ordinamento e freccia di espansione non si sovrappongono e restano allineati.
- La tabella oggetti include un comando dedicato per modificare i metadati di ciascun elemento.
- L'editor metadati permette di copiare i campi da un altro oggetto, scegliendo se importare anche i valori oppure soltanto i nomi.
- Il pannello Progetti consente di rinominare un progetto duplicato o esistente senza perdere contenuti, identita e revisioni.
- La barra Leaflet include una guida completa con istruzioni ed esempi concreti per disegno, modifica, eliminazione, riparazione, fori e confronto confini.
## Versione 0.4.4
- I comandi `Rinomina`, `Sposta nel gruppo` e `Rimuovi` occupano una riga completa e restano visibili anche nei pannelli Layer molto stretti.
- `Sposta nel gruppo` e disponibile per padri e figli di disegni, dati importati, cornici, fogli importati e particelle evidenziate dalla ricerca catastale.
- Editor distinti per linea e riempimento su gruppi e singoli oggetti, con contagocce dove supportato e valori modificabili HEX, RGB e HSL.
- Copia HEX per riutilizzare esattamente un colore su altri oggetti; stili conservati nei progetti e negli export.
- Rimossi dai menu i riferimenti al colore rosso fisso delle particelle catastali.
- Nei progetti in sola lettura anche il trasferimento tra gruppi viene correttamente disabilitato.
## Versione 0.4.3
- `Mostra particella sulla mappa` riattiva sempre il layer dei confini rossi e lo porta in primo piano.
- Una particella gia evidenziata o temporaneamente nascosta viene recuperata senza creare duplicati.
- Deduplicazione estesa alle particelle presenti in progetti e file GeoJSON, KML e KMZ, tramite riferimenti catastali o confronto geometrico.
- Ricerca WFS ampliata per rendere piu affidabile il recupero dei confini di particelle estese o irregolari.
- Guida rapida collassabile in fondo a Layer e a ogni pannello operativo, con istruzioni specifiche per le relative funzioni.
## Versione 0.4.2
- Nuovo comando `Sposta nel gruppo` visibile accanto a Rinomina e Rimuovi per padri, sottogruppi e singoli oggetti.
- Scelta della categoria e del sottogruppo di destinazione, con possibilita di creare un nuovo gruppo.
- I disegni possono essere organizzati in sottogruppi come i dati importati.
- `Sposta geometria` resta separato e continua a traslare gli oggetti in metri verso nord, sud, est o ovest.
## Versione 0.4.1
- Pannelli operativi allineati a destra, con ricerca lasciata nella posizione precedente.
- Espansione della gerarchia Layer esclusivamente tramite freccia accanto alla maniglia di trascinamento.
- Colori coerenti tra gruppo padre e figli, intensita progressiva per livello e conteggio figli in grassetto.
- Spostamento dei gruppi tra `Disegni e POI` e `Progetti e dati importati`.
- Rinomine persistenti nei progetti e negli export GeoJSON, KML e KMZ.
- Gli oggetti e i gruppi rimossi dal progetto non vengono piu inclusi nei salvataggi e negli export.
- Editor interni per rinomina, attributi multilinea, coordinate, spostamento e buffer.
- Selezione multipla e blocco disponibili anche nella tabella oggetti e particelle.
- Evidenziazione nel Layer dell'oggetto selezionato sulla mappa e centratura automatica opzionale, disattivata per impostazione predefinita.
- Strumenti controllo/riparazione, foro e confronto nella barra Leaflet, con risultati visibili in una finestra dedicata.
- Comandi del pannello Progetti disposti verticalmente senza scorrimento orizzontale.
## Versione 0.4.0 ## Versione 0.4.0
La mappa ora occupa tutta la schermata: il pannello `Layer` resta subito accessibile, mentre ricerca, catasto, dati, progetti, esportazione, strumenti avanzati e impostazioni sono raccolti nel menu in alto. La mappa ora occupa tutta la schermata: il pannello `Layer` resta subito accessibile, mentre ricerca, catasto, dati, progetti, esportazione, strumenti avanzati e impostazioni sono raccolti nel menu in alto.
+20
View File
@@ -0,0 +1,20 @@
using System.Collections.Concurrent;
namespace LMEMappeCatastaliApp.Services;
public sealed class IncomingFileService
{
private readonly ConcurrentQueue<IncomingFile> _files = new();
public static IncomingFileService Shared { get; } = new();
public event Action? FileAvailable;
public void Enqueue(IncomingFile file)
{
_files.Enqueue(file);
MainThread.BeginInvokeOnMainThread(() => FileAvailable?.Invoke());
}
public bool TryDequeue(out IncomingFile? file) => _files.TryDequeue(out file);
}
public sealed record IncomingFile(string Path, string FileName, string? ContentType);
+3 -2
View File
@@ -85,7 +85,7 @@ public sealed class MapExportService
{ {
var root = new XElement("gpx", var root = new XElement("gpx",
new XAttribute("version", "1.1"), new XAttribute("version", "1.1"),
new XAttribute("creator", "LME Mappe Catastali 0.3.0"), new XAttribute("creator", "LME Mappe Catastali 0.4.7"),
new XAttribute(XNamespace.Xmlns + "xsi", "http://www.w3.org/2001/XMLSchema-instance"), new XAttribute(XNamespace.Xmlns + "xsi", "http://www.w3.org/2001/XMLSchema-instance"),
new XElement("metadata", new XElement("name", name))); new XElement("metadata", new XElement("name", name)));
foreach (var feature in features.EnumerateArray()) foreach (var feature in features.EnumerateArray())
@@ -428,7 +428,8 @@ public sealed class MapExportService
} }
private static string FeatureName(JsonElement properties, string category) => private static string FeatureName(JsonElement properties, string category) =>
GetString(properties, "name") GetString(properties, "_lmeDisplayName")
?? GetString(properties, "name")
?? GetString(properties, "Name") ?? GetString(properties, "Name")
?? GetString(properties, "LABEL") ?? GetString(properties, "LABEL")
?? GetString(properties, "NATIONALCADASTRALREFERENCE") ?? GetString(properties, "NATIONALCADASTRALREFERENCE")
+30 -2
View File
@@ -22,6 +22,34 @@ public sealed class OfficialCadastreService
double longitude, double longitude,
double radiusMeters, double radiusMeters,
CancellationToken cancellationToken = default) CancellationToken cancellationToken = default)
=> await GetFeaturesNearAsync(
latitude,
longitude,
radiusMeters,
"CP:CadastralParcel",
100,
cancellationToken);
public async Task<string> GetSheetsNearAsync(
double latitude,
double longitude,
double radiusMeters = 10,
CancellationToken cancellationToken = default)
=> await GetFeaturesNearAsync(
latitude,
longitude,
radiusMeters,
"CP:CadastralZoning",
20,
cancellationToken);
private async Task<string> GetFeaturesNearAsync(
double latitude,
double longitude,
double radiusMeters,
string typeName,
int count,
CancellationToken cancellationToken)
{ {
var meters = Math.Clamp(radiusMeters, 2, 30); var meters = Math.Clamp(radiusMeters, 2, 30);
var deltaLatitude = meters / 111_320d; var deltaLatitude = meters / 111_320d;
@@ -40,11 +68,11 @@ public sealed class OfficialCadastreService
["language"] = "ita", ["language"] = "ita",
["SERVICE"] = "WFS", ["SERVICE"] = "WFS",
["VERSION"] = "2.0.0", ["VERSION"] = "2.0.0",
["TYPENAMES"] = "CP:CadastralParcel", ["TYPENAMES"] = typeName,
["SRSNAME"] = "urn:ogc:def:crs:EPSG::6706", ["SRSNAME"] = "urn:ogc:def:crs:EPSG::6706",
["BBOX"] = bbox, ["BBOX"] = bbox,
["REQUEST"] = "GetFeature", ["REQUEST"] = "GetFeature",
["COUNT"] = "20" ["COUNT"] = count.ToString(CultureInfo.InvariantCulture)
}; };
var url = WfsEndpoint + "?" + string.Join("&", query.Select(item => var url = WfsEndpoint + "?" + string.Join("&", query.Select(item =>
+30
View File
@@ -147,6 +147,36 @@ public sealed class ProjectStorageService
finally { _gate.Release(); } finally { _gate.Release(); }
} }
public async Task<MapProjectSummary> RenameAsync(string projectId, string name)
{
var normalizedName = NormalizeName(name);
await _gate.WaitAsync();
try
{
var files = await ReadProjectFilesAsync();
var project = files.FirstOrDefault(item => item.Document.Id == projectId)
?? throw new FileNotFoundException("Il progetto selezionato non esiste piu'.");
if (project.Document.AccessMode == "readonly")
{
throw new InvalidOperationException("Il progetto e' in sola lettura. Duplicalo per modificarlo.");
}
if (files.Any(item => item.Document.Id != projectId
&& string.Equals(item.Document.Name, normalizedName, StringComparison.CurrentCultureIgnoreCase)))
{
throw new InvalidOperationException($"Esiste gia' un progetto chiamato '{normalizedName}'.");
}
project.Document.Name = normalizedName;
project.Document.UpdatedAt = DateTimeOffset.UtcNow;
await File.WriteAllTextAsync(
project.Path,
JsonSerializer.Serialize(project.Document, _jsonOptions),
new UTF8Encoding(false));
return project.Document.ToSummary();
}
finally { _gate.Release(); }
}
public async Task UpdateOrganizationAsync(string projectId, string? folder = null, bool? isArchived = null) public async Task UpdateOrganizationAsync(string projectId, string? folder = null, bool? isArchived = null)
{ {
await _gate.WaitAsync(); await _gate.WaitAsync();
+6
View File
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "10.0.401",
"rollForward": "latestPatch"
}
}
+52
View File
@@ -0,0 +1,52 @@
param([string]$Configuration = "Release")
$ErrorActionPreference = "Stop"
$projectRoot = Split-Path -Parent $PSScriptRoot
$dotnet = Join-Path $env:USERPROFILE ".dotnet10\dotnet.exe"
$androidSdk = Join-Path $env:LOCALAPPDATA "Android\Sdk"
$keyStore = Join-Path $env:LOCALAPPDATA "Xamarin\Mono for Android\debug.keystore"
$outputDirectory = Join-Path $projectRoot "artifacts\android-test"
$projectPath = Join-Path $projectRoot "LMEMappeCatastaliApp.csproj"
[xml]$projectXml = Get-Content -Raw -LiteralPath $projectPath
$appVersion = ($projectXml.Project.PropertyGroup | Where-Object ApplicationDisplayVersion | Select-Object -First 1).ApplicationDisplayVersion
foreach ($requiredPath in @($dotnet, $androidSdk, $keyStore)) {
if (-not (Test-Path -LiteralPath $requiredPath)) { throw "Componente richiesto non trovato: $requiredPath" }
}
New-Item -ItemType Directory -Force -Path $outputDirectory | Out-Null
$packages = [System.Collections.Generic.List[System.IO.FileInfo]]::new()
foreach ($format in @("apk", "aab")) {
$publishArguments = @(
"publish", $projectPath,
"-f", "net10.0-android",
"-c", $Configuration,
"-p:AndroidSdkDirectory=$androidSdk",
"-p:AndroidPackageFormat=$format",
"-p:RunAOTCompilation=false",
"-p:AndroidKeyStore=true",
"-p:AndroidSigningKeyStore=$keyStore",
"-p:AndroidSigningKeyAlias=androiddebugkey",
"-p:AndroidSigningStorePass=android",
"-p:AndroidSigningKeyPass=android"
)
& $dotnet @publishArguments
if ($LASTEXITCODE -ne 0) { throw "Pubblicazione Android $format non riuscita." }
$publishDirectory = Join-Path $projectRoot "bin\$Configuration\net10.0-android\publish"
$package = Get-ChildItem -LiteralPath $publishDirectory -Filter "*-Signed.$format" -File |
Sort-Object LastWriteTime -Descending |
Select-Object -First 1
if ($null -eq $package) { throw "Nessun pacchetto $format firmato prodotto." }
$destination = Join-Path $outputDirectory "LME-Mappe-Catastali-$appVersion.$format"
Copy-Item -LiteralPath $package.FullName -Destination $destination -Force
$packages.Add((Get-Item -LiteralPath $destination))
}
$packages | ForEach-Object {
$hash = Get-FileHash -Algorithm SHA256 -LiteralPath $_.FullName
"$($hash.Hash.ToLowerInvariant()) $($_.Name)"
} | Set-Content -LiteralPath (Join-Path $outputDirectory "SHA256SUMS.txt") -Encoding ascii
$packages | Select-Object Name, Length, LastWriteTime
+406 -16
View File
@@ -165,6 +165,7 @@ input[type="checkbox"] {
position: absolute; position: absolute;
top: 70px; top: 70px;
right: 12px; right: 12px;
left: auto;
z-index: 1150; z-index: 1150;
display: grid; display: grid;
width: min(300px, calc(100vw - 24px)); width: min(300px, calc(100vw - 24px));
@@ -240,6 +241,7 @@ input[type="checkbox"] {
position: absolute; position: absolute;
top: 72px; top: 72px;
right: 12px; right: 12px;
left: auto;
bottom: calc(var(--nav-height) + 8px); bottom: calc(var(--nav-height) + 8px);
z-index: 1080; z-index: 1080;
display: grid; display: grid;
@@ -304,6 +306,73 @@ input[type="checkbox"] {
padding-top: 9px; padding-top: 9px;
} }
.menu-help {
margin-top: 4px;
border: 1px solid #c8d3d8;
border-radius: 6px;
background: #f7fafb;
color: var(--ink);
}
.menu-help summary {
display: flex;
align-items: center;
gap: 8px;
min-height: 40px;
padding: 7px 10px;
cursor: pointer;
list-style: none;
font-size: 12px;
}
.menu-help summary::-webkit-details-marker {
display: none;
}
.menu-help summary > span {
display: grid;
place-items: center;
width: 22px;
height: 22px;
border: 1px solid #82949d;
border-radius: 50%;
color: #42535c;
font-weight: 900;
}
.menu-help summary::after {
margin-left: auto;
content: "\25BE";
color: #52636b;
font-size: 14px;
transition: transform 140ms ease;
}
.menu-help[open] summary::after {
transform: rotate(180deg);
}
.menu-help-content {
padding: 10px 12px 12px;
border-top: 1px solid #d8e0e4;
font-size: 11px;
line-height: 1.45;
}
.menu-help-content p {
margin: 0 0 8px;
font-weight: 700;
}
.menu-help-content ol {
margin: 0;
padding-left: 18px;
}
.menu-help-content li + li {
margin-top: 6px;
}
.layer-tree-section { .layer-tree-section {
display: grid; display: grid;
gap: 6px; gap: 6px;
@@ -415,6 +484,54 @@ input[type="checkbox"] {
padding: 1px; padding: 1px;
} }
.layer-color-editor {
grid-column: 1 / -1;
display: grid;
gap: 5px;
padding: 6px;
border: 1px solid #cbd5da;
border-radius: 4px;
background: rgba(255, 255, 255, 0.82);
}
.layer-color-editor > header {
display: grid;
grid-template-columns: minmax(0, 1fr) 46px auto;
align-items: center;
gap: 5px;
font-size: 10px;
}
.layer-color-editor > header input[type="color"] {
width: 46px;
min-height: 30px;
}
.layer-color-editor button {
min-height: 28px;
min-width: 0;
padding: 3px 6px;
font-size: 9px;
}
.layer-color-formats {
display: grid;
gap: 4px;
}
.layer-color-formats label {
grid-template-columns: 30px minmax(0, 1fr);
align-items: center;
}
.layer-color-formats input {
font-family: Consolas, "Courier New", monospace;
}
.layer-color-copy {
justify-self: stretch;
}
.layer-photo-picker { .layer-photo-picker {
position: relative; position: relative;
min-height: 32px; min-height: 32px;
@@ -480,24 +597,32 @@ input[type="checkbox"] {
background: var(--layer-group-surface, #fff); background: var(--layer-group-surface, #fff);
} }
.layer-manager-group > summary, .layer-manager-group > summary {
.layer-manager-block > summary {
background: var(--layer-group-parent, #f6f8f9); background: var(--layer-group-parent, #f6f8f9);
} }
.layer-manager-block > summary {
background: color-mix(in srgb, var(--layer-group-parent, #f6f8f9) 72%, white);
}
.layer-manager-object > summary { .layer-manager-object > summary {
background: var(--layer-group-surface, #fff); background: color-mix(in srgb, var(--layer-group-parent, #f6f8f9) 42%, white);
}
.layer-manager-details,
.layer-group-tools {
background: color-mix(in srgb, var(--layer-group-parent, #f6f8f9) 22%, white);
} }
.layer-manager-group > summary, .layer-manager-group > summary,
.layer-manager-block > summary, .layer-manager-block > summary,
.layer-manager-object > summary { .layer-manager-object > summary {
display: grid; display: grid;
grid-template-columns: 28px minmax(0, 1fr) 50px; grid-template-columns: 28px 28px minmax(0, 1fr) minmax(28px, auto);
grid-template-areas: grid-template-areas:
"handle title count" "handle expand title count"
". visibility moves" "visibility lock moves moves"
". actions moves"; "actions actions actions actions";
align-items: start; align-items: start;
gap: 6px; gap: 6px;
min-height: 38px; min-height: 38px;
@@ -506,6 +631,23 @@ input[type="checkbox"] {
list-style: none; list-style: none;
} }
.layer-expand-button {
grid-area: expand;
align-self: center;
justify-self: center;
width: 28px;
min-width: 28px;
height: 28px;
min-height: 28px;
padding: 0;
border: 1px solid #cbd5da;
border-radius: 4px;
background: #fff;
color: var(--ink);
font-size: 18px;
line-height: 1;
}
.layer-manager-group > summary::-webkit-details-marker, .layer-manager-group > summary::-webkit-details-marker,
.layer-manager-block > summary::-webkit-details-marker, .layer-manager-block > summary::-webkit-details-marker,
.layer-manager-object > summary::-webkit-details-marker { .layer-manager-object > summary::-webkit-details-marker {
@@ -530,8 +672,9 @@ input[type="checkbox"] {
grid-area: actions; grid-area: actions;
display: grid; display: grid;
grid-template-columns: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr);
width: min(130px, 100%); width: 100%;
gap: 4px; gap: 4px;
margin-top: 2px;
} }
.layer-manager-group > summary > input, .layer-manager-group > summary > input,
@@ -545,6 +688,7 @@ input[type="checkbox"] {
} }
.layer-rename-button, .layer-rename-button,
.layer-membership-button,
.layer-remove-button { .layer-remove-button {
width: 100%; width: 100%;
min-height: 28px; min-height: 28px;
@@ -564,6 +708,16 @@ input[type="checkbox"] {
background: #d9eee7; background: #d9eee7;
} }
.layer-membership-button {
border-color: #bfdbfe;
background: #eff6ff;
color: #1d4ed8;
}
.layer-membership-button:active {
background: #dbeafe;
}
.layer-remove-button { .layer-remove-button {
border-color: #fecaca; border-color: #fecaca;
background: #fff1f2; background: #fff1f2;
@@ -578,6 +732,7 @@ input[type="checkbox"] {
grid-area: moves; grid-area: moves;
display: inline-grid; display: inline-grid;
grid-template-columns: 24px 24px; grid-template-columns: 24px 24px;
justify-self: end;
gap: 2px; gap: 2px;
} }
@@ -623,12 +778,12 @@ input[type="checkbox"] {
} }
.layer-inline-lock { .layer-inline-lock {
grid-area: visibility; grid-area: lock;
justify-self: center; justify-self: center;
width: 28px; width: 28px;
min-width: 28px; min-width: 28px;
min-height: 24px; min-height: 24px;
margin-left: 26px; margin: 0;
padding: 0; padding: 0;
background: transparent; background: transparent;
color: var(--ink); color: var(--ink);
@@ -641,6 +796,7 @@ input[type="checkbox"] {
.project-readonly .leaflet-draw, .project-readonly .leaflet-draw,
.project-readonly .layer-rename-button, .project-readonly .layer-rename-button,
.project-readonly .layer-membership-button,
.project-readonly .layer-remove-button, .project-readonly .layer-remove-button,
.project-readonly .layer-inline-lock, .project-readonly .layer-inline-lock,
.project-readonly .layer-object-tools, .project-readonly .layer-object-tools,
@@ -750,6 +906,7 @@ input[type="checkbox"] {
justify-self: end; justify-self: end;
color: var(--muted); color: var(--muted);
font-size: 10px; font-size: 10px;
font-weight: 900;
} }
.layer-manager-children { .layer-manager-children {
@@ -769,11 +926,19 @@ input[type="checkbox"] {
} }
.layer-manager-object > summary { .layer-manager-object > summary {
grid-template-columns: 24px minmax(0, 1fr) 46px; grid-template-columns: 24px 24px minmax(0, 1fr) 46px;
gap: 4px; gap: 4px;
padding: 3px 4px; padding: 3px 4px;
} }
.layer-manager-object > summary > .layer-expand-button {
width: 24px;
min-width: 24px;
height: 24px;
min-height: 24px;
font-size: 15px;
}
.layer-manager-object > summary > .layer-drag-handle { .layer-manager-object > summary > .layer-drag-handle {
width: 24px; width: 24px;
height: 24px; height: 24px;
@@ -790,6 +955,7 @@ input[type="checkbox"] {
} }
.layer-manager-object > summary .layer-rename-button, .layer-manager-object > summary .layer-rename-button,
.layer-manager-object > summary .layer-membership-button,
.layer-manager-object > summary .layer-remove-button { .layer-manager-object > summary .layer-remove-button {
min-height: 24px; min-height: 24px;
font-size: 9px; font-size: 9px;
@@ -840,6 +1006,195 @@ input[type="checkbox"] {
box-shadow: inset 3px 0 #ff00d4; box-shadow: inset 3px 0 #ff00d4;
} }
.layer-manager-selection-path > summary {
box-shadow: inset 3px 0 #ff00d4;
}
.project-command-stack {
display: grid;
gap: 8px;
min-width: 0;
}
.project-command-stack > * {
width: 100%;
min-width: 0;
}
.lme-edit-form,
.attribute-editor,
.attribute-editor-rows {
display: grid;
gap: 12px;
}
.lme-edit-form textarea,
.attribute-editor textarea {
min-height: 82px;
resize: vertical;
white-space: pre-wrap;
}
.dialog-command-row {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8px;
}
.attribute-editor > p {
margin: 0;
color: var(--muted);
font-size: 12px;
}
.attribute-copy-panel {
display: grid;
grid-template-columns: minmax(170px, 1fr) auto;
grid-template-areas:
"heading heading"
"source source"
"toggle action"
"hint hint";
align-items: end;
gap: 8px 12px;
padding: 10px;
border: 1px solid var(--line);
border-radius: 6px;
background: #f5f8f9;
}
.attribute-copy-panel > strong {
grid-area: heading;
}
.attribute-copy-panel > label:first-child {
grid-area: source;
min-width: 0;
}
.attribute-copy-panel > .toggle-line {
grid-area: toggle;
}
.attribute-copy-panel > button {
grid-area: action;
}
.attribute-copy-panel > label:first-child select {
width: 100%;
}
.attribute-copy-panel > small {
grid-area: hint;
color: var(--muted);
line-height: 1.4;
}
.attribute-editor-row {
display: grid;
grid-template-columns: minmax(130px, 0.8fr) minmax(180px, 2fr) 36px;
align-items: end;
gap: 8px;
padding-bottom: 10px;
border-bottom: 1px solid var(--line);
}
.attribute-editor-row > button {
width: 36px;
min-width: 36px;
min-height: 36px;
padding: 0;
background: #fff1f2;
color: #b42318;
font-size: 20px;
}
.object-table-legend {
display: flex;
flex-wrap: wrap;
gap: 6px 14px;
margin-bottom: 8px;
color: var(--muted);
font-size: 11px;
}
.object-table-wrap input[type="checkbox"] {
width: 18px;
height: 18px;
}
.geometry-result {
display: grid;
grid-template-columns: 46px minmax(0, 1fr);
align-items: center;
gap: 12px;
}
.geometry-result > span {
display: grid;
place-items: center;
width: 42px;
height: 42px;
border-radius: 50%;
background: #dcfce7;
color: #166534;
font-size: 25px;
font-weight: 900;
}
.geometry-result-warning > span { background: #fef3c7; color: #92400e; }
.geometry-result-error > span { background: #ffe4e6; color: #b42318; }
.geometry-result > p { margin: 0; line-height: 1.45; }
.lme-geometry-toolbar a {
display: grid !important;
place-items: center;
font-size: 20px !important;
font-weight: 900;
text-decoration: none;
}
.leaflet-help {
display: grid;
gap: 14px;
}
.leaflet-help > p {
margin: 0;
color: var(--muted);
line-height: 1.45;
}
.leaflet-help-list {
display: grid;
gap: 0;
margin: 0;
}
.leaflet-help-list > div {
display: grid;
grid-template-columns: 42px minmax(0, 1fr);
gap: 10px;
padding: 10px 0;
border-bottom: 1px solid var(--line);
}
.leaflet-help-list dt {
font-size: 20px;
font-weight: 900;
text-align: center;
}
.leaflet-help-list dd {
margin: 0;
line-height: 1.45;
}
.leaflet-help-list dd strong {
display: block;
margin-bottom: 2px;
}
.gps-overlay { .gps-overlay {
position: absolute; position: absolute;
top: 72px; top: 72px;
@@ -916,14 +1271,17 @@ input[type="checkbox"] {
position: absolute; position: absolute;
top: 0; top: 0;
bottom: var(--nav-height); bottom: var(--nav-height);
left: 0; right: 0;
left: auto;
z-index: 1100; z-index: 1100;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
min-height: 0;
overflow: hidden;
width: min(430px, calc(100% - 48px)); width: min(430px, calc(100% - 48px));
border-right: 1px solid var(--line); border-left: 1px solid var(--line);
background: var(--panel); background: var(--panel);
box-shadow: 7px 0 24px rgba(0, 0, 0, 0.24); box-shadow: -7px 0 24px rgba(0, 0, 0, 0.24);
} }
.sheet-header { .sheet-header {
@@ -972,10 +1330,15 @@ h2 {
} }
.panel-content { .panel-content {
flex: 1 1 auto;
min-height: 0;
display: grid; display: grid;
align-content: start;
gap: 12px; gap: 12px;
overflow-y: auto; overflow-y: auto;
padding: 15px 16px 24px; overscroll-behavior: contain;
padding: 15px 16px max(32px, calc(24px + env(safe-area-inset-bottom)));
scroll-padding-bottom: max(32px, calc(24px + env(safe-area-inset-bottom)));
} }
.panel-section { .panel-section {
@@ -1354,6 +1717,7 @@ footer {
.map-layer-panel { .map-layer-panel {
top: 68px; top: 68px;
right: 8px; right: 8px;
left: auto;
bottom: calc(var(--nav-height) + 8px); bottom: calc(var(--nav-height) + 8px);
width: 50vw; width: 50vw;
} }
@@ -1361,6 +1725,7 @@ footer {
.map-navigation-menu { .map-navigation-menu {
top: 66px; top: 66px;
right: 8px; right: 8px;
left: auto;
} }
.tool-sheet { .tool-sheet {
@@ -1368,11 +1733,36 @@ footer {
bottom: var(--nav-height); bottom: var(--nav-height);
width: 100%; width: 100%;
border-top: 1px solid var(--line); border-top: 1px solid var(--line);
border-right: 0; border-left: 0;
border-radius: 8px 8px 0 0; border-radius: 8px 8px 0 0;
box-shadow: 0 -7px 24px rgba(0, 0, 0, 0.24); box-shadow: 0 -7px 24px rgba(0, 0, 0, 0.24);
} }
.attribute-editor-row {
grid-template-columns: minmax(0, 1fr) 36px;
}
.attribute-editor-row > label {
grid-column: 1;
}
.attribute-editor-row > button {
grid-column: 2;
grid-row: 1 / span 2;
align-self: center;
}
.attribute-copy-panel {
grid-template-columns: minmax(0, 1fr);
grid-template-areas:
"heading"
"source"
"toggle"
"action"
"hint";
align-items: stretch;
}
.gps-overlay { .gps-overlay {
top: 68px; top: 68px;
right: 8px; right: 8px;
+958 -205
View File
File diff suppressed because it is too large. Load diff