Add geoButton, getGmina, messages, and translate handler files with initial implementations
This commit is contained in:
22
js/handlers/getGmina.js
Normal file
22
js/handlers/getGmina.js
Normal 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);
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user