Add map provider functions for Gdos, Geoportal, Google, Isok, LPP, and Sopo with updated API calls
This commit is contained in:
24
js/map_providers/gdos.js
Normal file
24
js/map_providers/gdos.js
Normal 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";
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user