Add map provider functions for Gdos, Geoportal, Google, Isok, LPP, and Sopo with updated API calls

This commit is contained in:
2025-06-05 11:33:01 +02:00
parent 1e002d5bd7
commit e3bcf9dd7c
6 changed files with 160 additions and 0 deletions

24
js/map_providers/gdos.js Normal file
View File

@@ -0,0 +1,24 @@
function gdosButtonClick() {
gdosButton.style.background = "gray";
let XMIN = MapData.X_MIN;
let YMIN = MapData.Y_MIN;
let XMAX = MapData.X_MAX;
let YMAX = MapData.Y_MAX;
// let URL = `https://epsg.io/trans?data=${XMIN},${YMIN};${XMAX},${YMAX}&s_srs=2177&t_srs=2180`; stary endpoint
let URL = `https://api.maptiler.com/coordinates/transform/${XMIN},${YMIN};${XMAX},${YMAX}.json?s_srs=2177&t_srs=2180&key=OZa2pWHGvC94xakI0fVk`;
fetch(URL, {
method: "GET",
})
.then((response) => response.json())
.then((data) => {
let NXMIN = data.results[0].x;
let NYMIN = data.results[0].y;
let NXMAX = data.results[1].x;
let NYMAX = data.results[1].y;
let newURL = `https://geoserwis.gdos.gov.pl/mapy/?extent=${NXMIN},${NYMIN},${NXMAX},${NYMAX}`;
window.open(newURL, "_blank");
gdosButton.style.background = "none";
});
}

View File

@@ -0,0 +1,24 @@
function geoportalButtonClick() {
geoButton.style.background = "gray";
let XMIN = MapData.X_MIN;
let YMIN = MapData.Y_MIN;
let XMAX = MapData.X_MAX;
let YMAX = MapData.Y_MAX;
// let URL = `https://epsg.io/trans?data=${XMIN},${YMIN};${XMAX},${YMAX}&s_srs=2177&t_srs=2180`; stary endpoint
let URL = `https://api.maptiler.com/coordinates/transform/${XMIN},${YMIN};${XMAX},${YMAX}.json?s_srs=2177&t_srs=2180&key=OZa2pWHGvC94xakI0fVk`;
fetch(URL, {
method: "GET",
})
.then((response) => response.json())
.then((data) => {
let NXMIN = data.results[0].x;
let NYMIN = data.results[0].y;
let NXMAX = data.results[1].x;
let NYMAX = data.results[1].y;
let newURL = `https://mapy.geoportal.gov.pl/imap/Imgp_2.html?gpmap=gp0&bbox=${NXMIN},${NYMIN},${NXMAX},${NYMAX}&variant=KATASTER`;
window.open(newURL, "_blank");
geoButton.style.background = "none";
});
}

View File

@@ -0,0 +1,30 @@
function googleButtonClick() {
googleButton.style.background = "gray";
let XMIN = Number(MapData.X_MIN);
let YMIN = Number(MapData.Y_MIN);
let XMAX = Number(MapData.X_MAX);
let YMAX = Number(MapData.Y_MAX);
let X = Math.abs((XMAX - XMIN) / 2);
let Y = Math.abs((YMAX - YMIN) / 2);
// let URL = `https://epsg.io/trans?data=${XMIN + X},${
// YMIN + Y
// }&s_srs=2177&t_srs=4326`; stary endpoint
let URL = `https://api.maptiler.com/coordinates/transform/${XMIN + X},${
YMIN + Y
}.json?s_srs=2177&t_srs=4326&key=OZa2pWHGvC94xakI0fVk`;
fetch(URL, {
method: "GET",
})
.then((response) => response.json())
.then((data) => {
console.log(data);
let NX = data.results[0].x;
let NY = data.results[0].y;
let newURL = `https://www.google.pl/maps/@${NY},${NX},18z/data=!3m1!1e3`;
window.open(newURL, "_blank");
googleButton.style.background = "none";
});
}

28
js/map_providers/isok.js Normal file
View File

@@ -0,0 +1,28 @@
function isokButtonClick() {
isokButton.style.background = "gray";
let XMIN = MapData.X_MIN;
let YMIN = MapData.Y_MIN;
let XMAX = MapData.X_MAX;
let YMAX = MapData.Y_MAX;
// let URL = `https://epsg.io/trans?data=${XMIN},${YMIN};${XMAX},${YMAX}&s_srs=2177&t_srs=2180`;stary endpoint
let URL = `https://api.maptiler.com/coordinates/transform/${XMIN},${YMIN};${XMAX},${YMAX}.json?s_srs=2177&t_srs=2180&key=OZa2pWHGvC94xakI0fVk`;
fetch(URL, {
method: "GET",
})
.then((response) => response.json())
.then((data) => {
let NXMIN = data.results[0].x;
let NYMIN = data.results[0].y;
let NXMAX = data.results[1].x;
let NYMAX = data.results[1].y;
let newURL = `https://wody.isok.gov.pl/imap_kzgw/?gpmap=gpSIGW&bbox=${NXMIN},${NYMIN},${NXMAX},${NYMAX}`;
window.open(newURL, "_blank");
isokButton.style.background = "none";
});
}

30
js/map_providers/lpp.js Normal file
View File

@@ -0,0 +1,30 @@
function drogiButtonClick() {
drogiButton.style.background = "gray";
let XMIN = Number(MapData.X_MIN);
let YMIN = Number(MapData.Y_MIN);
let XMAX = Number(MapData.X_MAX);
let YMAX = Number(MapData.Y_MAX);
let X = Math.abs((XMAX - XMIN) / 2);
let Y = Math.abs((YMAX - YMIN) / 2);
// let URL = `https://epsg.io/trans?data=${XMIN + X},${
// YMIN + Y
// }&s_srs=2177&t_srs=4326`; stary endpoint
let URL = `https://api.maptiler.com/coordinates/transform/${XMIN + X},${
YMIN + Y
}.json?s_srs=2177&t_srs=4326&key=OZa2pWHGvC94xakI0fVk`;
fetch(URL, {
method: "GET",
})
.then((response) => response.json())
.then((data) => {
console.log(data);
let NX = data.results[0].x;
let NY = data.results[0].y;
let newURL = `https://powiatnowysacz.lp-portal.pl/#mapView=lon:${NX},lat:${NY},zoom:18`;
window.open(newURL, "_blank");
drogiButton.style.background = "none";
});
}

24
js/map_providers/sopo.js Normal file
View File

@@ -0,0 +1,24 @@
function sopoButtonClick() {
sopoButton.style.background = "gray";
let XMIN = MapData.X_MIN;
let YMIN = MapData.Y_MIN;
let XMAX = MapData.X_MAX;
let YMAX = MapData.Y_MAX;
// let URL = `https://epsg.io/trans?data=${XMIN},${YMIN};${XMAX},${YMAX}&s_srs=2177&t_srs=2180`; stary endpoint
let URL = `https://api.maptiler.com/coordinates/transform/${XMIN},${YMIN};${XMAX},${YMAX}.json?s_srs=2177&t_srs=2180&key=OZa2pWHGvC94xakI0fVk`;
fetch(URL, {
method: "GET",
})
.then((response) => response.json())
.then((data) => {
let NXMIN = data.results[0].x;
let NYMIN = data.results[0].y;
let NXMAX = data.results[1].x;
let NYMAX = data.results[1].y;
let newURL = `https://geologia.pgi.gov.pl/geozagrozenia/?extent=${NXMIN}%2C${NYMIN}%2C${NXMAX}%2C${NYMAX}%2C2180&showLayers=mapy_seryjne_pig_5929_0%3Bmogilniki_6425%3Bmogilniki_6425_0%3Bantropopresja_8897%3Bantropopresja_8897_0%3Bantropopresja_8897_1%3Bantropopresja_8897_2%3Bantropopresja_8897_3%3Bantropopresja_8897_4%3Bantropopresja_8897_5%3Bantropopresja_8897_6%3Bantropopresja_8897_7%3Bantropopresja_8897_8%3Bantropopresja_8897_9%3Bantropopresja_8897_10%3Bantropopresja_8897_11%3Bantropopresja_8897_12%3Bantropopresja_8897_13%3Bantropopresja_8897_14%3Bantropopresja_8897_15%3Bantropopresja_8897_16%3Bantropopresja_8897_17%3Bantropopresja_8897_18%3Bantropopresja_8897_19%3Bwms_7574_1%3Bwms_1981_1%3Bwms_6578_1%3Bwms_3593_3%3Bwms_3593_2%3Bwms_3593_1%3Bwms_3593_0%3Bpodtopienia_5097%3Bpodtopienia_5097_0%3Bsopo_obszary_8417%3Bsopo_obszary_8417_0%3Bsopo_obszary_8417_1%3Bsopo_obszary_8417_2%3Bsopo_obszary_8417_3%3Bsopo_stan_8612_0%3Bkonflikty_srodowisko_2834_0%3Bkonflikty_srodowisko_2834_1%3Bkonflikty_srodowisko_2834_2%3Bkonflikty_srodowisko_2834_3%3Bwms_1142_numery_dzialek%3Bwms_1142_geoportal%3Bwms_1142_dzialki%3Bprg_9244%3Bprg_9244_2%3Bprg_9244_3%3BWMTS_9451%3BWMTS_2524`
window.open(newURL, "_blank");
sopoButton.style.background = "none";
});
}