Fix imported sheet layer visibility
This commit is contained in:
1 parent
c093d88677
commit
97e165a587
4 files changed
+16
-26
No files matched your search
@@ -28,8 +28,8 @@
|
|||||||
<ApplicationId>com.companyname.lmemappecatastaliapp</ApplicationId>
|
<ApplicationId>com.companyname.lmemappecatastaliapp</ApplicationId>
|
||||||
|
|
||||||
<!-- Versions -->
|
<!-- Versions -->
|
||||||
<ApplicationDisplayVersion>0.2.14</ApplicationDisplayVersion>
|
<ApplicationDisplayVersion>0.2.15</ApplicationDisplayVersion>
|
||||||
<ApplicationVersion>18</ApplicationVersion>
|
<ApplicationVersion>19</ApplicationVersion>
|
||||||
|
|
||||||
<!-- 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 -->
|
||||||
<WindowsPackageType>None</WindowsPackageType>
|
<WindowsPackageType>None</WindowsPackageType>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ public sealed class AzureMapsService
|
|||||||
|
|
||||||
public AzureMapsService()
|
public AzureMapsService()
|
||||||
{
|
{
|
||||||
_httpClient.DefaultRequestHeaders.UserAgent.ParseAdd("LMEMappeCatastali/0.2.14");
|
_httpClient.DefaultRequestHeaders.UserAgent.ParseAdd("LMEMappeCatastali/0.2.15");
|
||||||
_httpClient.DefaultRequestHeaders.Accept.ParseAdd("application/json");
|
_httpClient.DefaultRequestHeaders.Accept.ParseAdd("application/json");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ public sealed class NetworkLocationService
|
|||||||
|
|
||||||
public NetworkLocationService()
|
public NetworkLocationService()
|
||||||
{
|
{
|
||||||
httpClient.DefaultRequestHeaders.UserAgent.ParseAdd("LMEMappeCatastali/0.2.14");
|
httpClient.DefaultRequestHeaders.UserAgent.ParseAdd("LMEMappeCatastali/0.2.15");
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<NetworkLocationSnapshot?> GetApproximateLocationAsync(
|
public async Task<NetworkLocationSnapshot?> GetApproximateLocationAsync(
|
||||||
|
|||||||
+12
-22
@@ -469,23 +469,9 @@ function bindFileImport() {
|
|||||||
try {
|
try {
|
||||||
const result = await readGisFile(file);
|
const result = await readGisFile(file);
|
||||||
const geojson = result.geojson;
|
const geojson = result.geojson;
|
||||||
const parcelLayer = L.geoJSON(geojson, {
|
const parcelLayer = addImportedFeatures(geojson);
|
||||||
style: { color: "#22c55e", weight: 3, opacity: 0.95, fillOpacity: 0.18 },
|
|
||||||
pointToLayer: (feature, latlng) => L.circleMarker(latlng, { radius: 7, color: "#22c55e", fillColor: "#ffffff", fillOpacity: 0.9 }),
|
|
||||||
onEachFeature: (feature, layer) => {
|
|
||||||
const name = feature?.properties?.name || file.name;
|
|
||||||
layer.bindPopup(`<strong>${escapeHtml(name)}</strong>`);
|
|
||||||
}
|
|
||||||
}).addTo(lmeState.imported);
|
|
||||||
const sheetGeojson = result.sheetGeojson || emptyFeatureCollection();
|
const sheetGeojson = result.sheetGeojson || emptyFeatureCollection();
|
||||||
const sheetLayer = L.geoJSON(sheetGeojson, {
|
const sheetLayer = addImportedSheetFeatures(sheetGeojson);
|
||||||
style: { color: "#15803d", weight: 3, opacity: 0.85, fillOpacity: 0.04, dashArray: "9 7" },
|
|
||||||
pointToLayer: (feature, latlng) => L.circleMarker(latlng, { radius: 6, color: "#15803d", fillOpacity: 0.25 }),
|
|
||||||
onEachFeature: (feature, layer) => {
|
|
||||||
const name = feature?.properties?.name || "Foglio catastale importato";
|
|
||||||
layer.bindPopup(`<strong>${escapeHtml(name)}</strong>`);
|
|
||||||
}
|
|
||||||
}).addTo(lmeState.importedSheets);
|
|
||||||
applyImportedSheetVisibility();
|
applyImportedSheetVisibility();
|
||||||
fitLayer(geojson.features.length ? parcelLayer : sheetLayer);
|
fitLayer(geojson.features.length ? parcelLayer : sheetLayer);
|
||||||
refreshImportedMeasurements();
|
refreshImportedMeasurements();
|
||||||
@@ -904,7 +890,7 @@ function setImportedSheetLayerVisible(enabled) {
|
|||||||
applyImportedSheetVisibility();
|
applyImportedSheetVisibility();
|
||||||
const count = lmeState.importedSheets?.toGeoJSON()?.features?.length || 0;
|
const count = lmeState.importedSheets?.toGeoJSON()?.features?.length || 0;
|
||||||
setInfo(lmeState.importedSheetsVisible
|
setInfo(lmeState.importedSheetsVisible
|
||||||
? (count ? `Layer del foglio importato visibile (${count} elementi).` : "Il layer del foglio sara visibile quando verra importato.")
|
? (count ? `Layer del foglio importato visibile (${count} elementi).` : "Nessun layer del foglio importato: ricarica il KML/KMZ con 'includi anche il layer del foglio' attivo.")
|
||||||
: "Layer del foglio importato nascosto; le particelle restano visibili.");
|
: "Layer del foglio importato nascosto; le particelle restano visibili.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -942,11 +928,12 @@ function addImportedFeatures(geojson) {
|
|||||||
|
|
||||||
function addImportedSheetFeatures(geojson) {
|
function addImportedSheetFeatures(geojson) {
|
||||||
return L.geoJSON(geojson || emptyFeatureCollection(), {
|
return L.geoJSON(geojson || emptyFeatureCollection(), {
|
||||||
style: { color: "#15803d", weight: 3, opacity: 0.85, fillOpacity: 0.04, dashArray: "9 7" },
|
style: { color: "#f59e0b", weight: 4, opacity: 1, fillOpacity: 0.03, dashArray: "10 6" },
|
||||||
pointToLayer: (feature, latlng) => L.circleMarker(latlng, {
|
pointToLayer: (feature, latlng) => L.circleMarker(latlng, {
|
||||||
radius: 6,
|
radius: 7,
|
||||||
color: "#15803d",
|
color: "#f59e0b",
|
||||||
fillOpacity: 0.25
|
fillColor: "#ffffff",
|
||||||
|
fillOpacity: 0.85
|
||||||
}),
|
}),
|
||||||
onEachFeature: bindStoredFeaturePopup
|
onEachFeature: bindStoredFeaturePopup
|
||||||
}).addTo(lmeState.importedSheets);
|
}).addTo(lmeState.importedSheets);
|
||||||
@@ -960,8 +947,11 @@ function applyImportedSheetVisibility() {
|
|||||||
if (!lmeState.map.hasLayer(lmeState.importedSheets)) {
|
if (!lmeState.map.hasLayer(lmeState.importedSheets)) {
|
||||||
lmeState.importedSheets.addTo(lmeState.map);
|
lmeState.importedSheets.addTo(lmeState.map);
|
||||||
}
|
}
|
||||||
lmeState.importedSheets.bringToBack();
|
lmeState.importedSheets.bringToFront();
|
||||||
lmeState.imported.bringToFront();
|
lmeState.imported.bringToFront();
|
||||||
|
lmeState.selectedParcelsLayer.bringToFront();
|
||||||
|
lmeState.gpsParcelLayer.bringToFront();
|
||||||
|
lmeState.drawings.bringToFront();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (lmeState.map.hasLayer(lmeState.importedSheets)) {
|
if (lmeState.map.hasLayer(lmeState.importedSheets)) {
|
||||||
|
|||||||
Reference in new issue
Block a user