Fix Agency cadastral WMS coordinate system
This commit is contained in:
1 parent
abc9516a0d
commit
ab43c5ca30
4 files changed
+31
-8
No files matched your search
+27
-5
@@ -26,6 +26,10 @@ const lmeState = {
|
||||
azureAttribution: null
|
||||
};
|
||||
|
||||
// AdE publishes the cadastral WMS in ETRS89. WMS 1.1.1 keeps the longitude,
|
||||
// latitude BBOX order expected by Leaflet while sending the required CRS code.
|
||||
const cadastreCrs = L.extend({}, L.CRS.EPSG4326, { code: "EPSG:4258" });
|
||||
|
||||
window.lmeMap = {
|
||||
init,
|
||||
showSearchResult,
|
||||
@@ -291,7 +295,10 @@ function exportCadastreView() {
|
||||
previewMap.hidden = false;
|
||||
const highlightedCount = lmeState.selectedParcelsLayer.getLayers().length
|
||||
+ lmeState.gpsParcelLayer.getLayers().length;
|
||||
setInfo(`Vista WMS caricata con ${layers.length} layer e ${highlightedCount} particelle evidenziate.`);
|
||||
const zoomHint = layers.includes("codice_plla") && lmeState.map.getZoom() < 17
|
||||
? " Ingrandisci almeno fino a zoom 17 per leggere i numeri delle particelle."
|
||||
: "";
|
||||
setInfo(`Vista WMS caricata con ${layers.length} layer e ${highlightedCount} particelle evidenziate.${zoomHint}`);
|
||||
};
|
||||
image.onerror = () => {
|
||||
previewMap.hidden = true;
|
||||
@@ -782,16 +789,31 @@ function refreshCadastreLayer() {
|
||||
return;
|
||||
}
|
||||
|
||||
lmeState.cadastre = L.tileLayer.wms(cadastreUrl(), {
|
||||
const cadastreLayer = L.tileLayer.wms(cadastreUrl(), {
|
||||
layers: layers.join(","),
|
||||
format: "image/png",
|
||||
transparent: true,
|
||||
version: "1.3.0",
|
||||
crs: L.CRS.EPSG4326,
|
||||
version: "1.1.1",
|
||||
crs: cadastreCrs,
|
||||
maxZoom: 22,
|
||||
opacity: lmeState.cadastreOpacity,
|
||||
attribution: "Agenzia delle Entrate - CC BY 4.0"
|
||||
}).addTo(lmeState.map);
|
||||
});
|
||||
|
||||
let errorShown = false;
|
||||
cadastreLayer.on("tileerror", () => {
|
||||
if (errorShown) {
|
||||
return;
|
||||
}
|
||||
|
||||
errorShown = true;
|
||||
setInfo("Layer catastali non caricati dal servizio AdE. Controlla la connessione e riprova.");
|
||||
});
|
||||
cadastreLayer.on("load", () => {
|
||||
errorShown = false;
|
||||
});
|
||||
|
||||
lmeState.cadastre = cadastreLayer.addTo(lmeState.map);
|
||||
}
|
||||
|
||||
function activeCadastreLayers() {
|
||||
|
||||
Reference in new issue
Block a user