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

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";
});
}