Add geoButton, getGmina, messages, and translate handler files with initial implementations

This commit is contained in:
2025-06-05 11:33:17 +02:00
parent e3bcf9dd7c
commit 1c97e0610f
5 changed files with 332 additions and 0 deletions

22
js/handlers/getGmina.js Normal file
View File

@@ -0,0 +1,22 @@
function getGmina(width, height, XMIN, YMIN, XMAX, YMAX) {
const URL = `https://integracja.gugik.gov.pl/cgi-bin/KrajowaIntegracjaEwidencjiGruntow?VERSION=1.1.1&SERVICE=WMS&REQUEST=GetFeatureInfo&LAYERS=dzialki,numery_dzialek,budynki&QUERY_LAYERS=dzialki,numery_dzialek,budynki&SRS=EPSG:2180&WIDTH=${width}&HEIGHT=${height}&TRANSPARENT=TRUE&FORMAT=image/png&BBOX=${XMIN},${YMIN},${XMAX},${YMAX}`;
return new Promise(function (resolve, reject) {
fetch(URL, {
method: "GET",
})
.then((response) => response.text())
.then((str) => new window.DOMParser().parseFromString(str, "text/xml"))
.then((data) => {
console.log(data);
for (let attr of data.getElementsByTagName("Attribute")) {
if (attr.getAttribute("Name") == "Gmina") {
console.log(attr.innerHTML);
let dooda = attr.innerHTML;
resolve(dooda);
}
}
resolve(0);
});
});
}