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

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