UPlanet :: 10 to 1 to 0.1 to 0.01°
This commit is contained in:
parent
aae29fcda0
commit
19e40cbdc6
11
README.md
11
README.md
|
@ -1,6 +1,11 @@
|
||||||
# OSM2IPFS
|
# OSM2IPFS
|
||||||
|
|
||||||
Starts from the world divided in 36 x 36 sections.
|
1. Planet earth with equador ring
|
||||||
Each division being from 0, 10, 20, to 360°
|
2. World divided in 36 x 18 LONxLAT 10° grid .
|
||||||
|
3. Clic on a grid cell to zoom to 1°, 0.1°, 0.01° sub grids
|
||||||
|
4. From selected 0.01° land appears "Apply for Visa" button
|
||||||
|
5. Enter your email to create G1Visa and G1Card (Astroport.ONE ambassy compatible)
|
||||||
|
|
||||||
https://ipfs.asycn.io/ipfs/QmPcwC8tQRCNq1VvqsV7zLD6mMui5TgSmbu5suqiFR4Zfh/welcome.html
|
|
||||||
|
|
||||||
|
https://ipfs.asycn.io/ipfs/QmWahUMy1umsebt3WjJNExSNBh1mvDb9G9RDBNLNqeSvPb/
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1>G1Visa Application</h1>
|
<h1>G1Visa Application</h1>
|
||||||
<form action="https://qo-op.com/" method="get">
|
<form onsubmit="constructURL(); return false;">
|
||||||
<label for="email">Email:</label>
|
<label for="email">Email:</label>
|
||||||
<input type="email" id="email" name="uplanet" required pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$">
|
<input type="email" id="email" name="uplanet" required pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$">
|
||||||
<input type="hidden" id="lat" name="lat" value="">
|
<input type="hidden" id="lat" name="lat" value="">
|
||||||
|
@ -55,16 +55,93 @@
|
||||||
<input type="submit" value="Submit">
|
<input type="submit" value="Submit">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
<center><div id="countdown"></div></center>
|
||||||
<script>
|
<script>
|
||||||
// Extract latitude and longitude from URL parameters
|
// Extract latitude and longitude from URL parameters
|
||||||
const urlParams = new URLSearchParams(window.location.search);
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
const lat = urlParams.get('lat');
|
const lat = urlParams.get('lat').toFixed(2);
|
||||||
const lon = urlParams.get('lon');
|
const lon = urlParams.get('lon').toFixed(2);
|
||||||
|
|
||||||
// Set latitude and longitude values to hidden inputs
|
// Set latitude and longitude values to hidden inputs
|
||||||
document.getElementById('lat').value = lat;
|
document.getElementById('lat').value = lat;
|
||||||
document.getElementById('lon').value = lon;
|
document.getElementById('lon').value = lon;
|
||||||
|
|
||||||
|
async function homeAstroportStation(myURL, option = '', duration = 3000) {
|
||||||
|
try {
|
||||||
|
|
||||||
|
let one = await fetch(myURL); // Gets a promise
|
||||||
|
var doc = await one.text();
|
||||||
|
var regex = /url='([^']+)/i; // Get response PORT
|
||||||
|
const match = doc.match(regex);
|
||||||
|
if (match) {
|
||||||
|
const redirectURL = match[1];
|
||||||
|
} else {
|
||||||
|
const redirectURL = myURL;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(option + " ... Teleportation ... in " + duration + " ms ... " + redirectURL)
|
||||||
|
|
||||||
|
// start countdown
|
||||||
|
var timeLeft = Math.floor(duration / 1000);
|
||||||
|
var elem = document.getElementById("countdown");
|
||||||
|
var timerId = setInterval(countdown, 1000);
|
||||||
|
|
||||||
|
function countdown() {
|
||||||
|
if (timeLeft == -1) {
|
||||||
|
|
||||||
|
clearTimeout(timerId);
|
||||||
|
switch(option) {
|
||||||
|
case "tab":
|
||||||
|
window.open( redirectURL, "AstroTab");
|
||||||
|
break;
|
||||||
|
case "page":
|
||||||
|
window.location.replace(redirectURL);
|
||||||
|
break;
|
||||||
|
case "parent":
|
||||||
|
window.parent.location.href = redirectURL;
|
||||||
|
break;
|
||||||
|
case "aframe":
|
||||||
|
document.getElementById("aframe").src = redirectURL;
|
||||||
|
break;
|
||||||
|
case "ainfo":
|
||||||
|
ainfo(redirectURL);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
window.location.href = redirectURL;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.getElementById("countdown").innerHTML !== '') {
|
||||||
|
document.getElementById("countdown").innerHTML = "<a href='"+redirectURL+"' target='aframe'>OK</a>";
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
elem.innerHTML = timeLeft + " s";
|
||||||
|
timeLeft--;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (err) {
|
||||||
|
console.log('Fetch error:' + err + myURL ); // Error handling
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//// Create G1Visa wit Astroport.ONE API
|
||||||
|
function constructURL() {
|
||||||
|
// Get email, latitude, and longitude values
|
||||||
|
const email = document.getElementById('email').value;
|
||||||
|
const lat = document.getElementById('lat').value;
|
||||||
|
const lon = document.getElementById('lon').value;
|
||||||
|
|
||||||
|
// Construct the URL with parameters
|
||||||
|
const myURL = `https://astroport.copylaradio.com/?uplanet=${email}&${lat}=${lon}`;
|
||||||
|
|
||||||
|
// Call homeAstroportStation function with the constructed URL
|
||||||
|
homeAstroportStation(myURL, 'tab', 3000);
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -28,65 +28,9 @@
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<center><div id="countdown"></div></center>
|
|
||||||
<script src="leaflet.js"></script>
|
<script src="leaflet.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
async function homeAstroportStation(myURL, option = '', duration = 3000) {
|
|
||||||
try {
|
|
||||||
|
|
||||||
let one = await fetch(myURL); // Gets a promise
|
|
||||||
var doc = await one.text();
|
|
||||||
var regex = /url='([^']+)/i; // Get response PORT
|
|
||||||
var redirectURL = doc.match(regex)[1]
|
|
||||||
|
|
||||||
console.log(option + " ... Teleportation ... in " + duration + " ms ... " + redirectURL)
|
|
||||||
|
|
||||||
// start countdown
|
|
||||||
var timeLeft = Math.floor(duration / 1000);
|
|
||||||
var elem = document.getElementById("countdown");
|
|
||||||
var timerId = setInterval(countdown, 1000);
|
|
||||||
|
|
||||||
function countdown() {
|
|
||||||
if (timeLeft == -1) {
|
|
||||||
|
|
||||||
clearTimeout(timerId);
|
|
||||||
switch(option) {
|
|
||||||
case "tab":
|
|
||||||
window.open( redirectURL, "AstroTab");
|
|
||||||
break;
|
|
||||||
case "page":
|
|
||||||
window.location.replace(redirectURL);
|
|
||||||
break;
|
|
||||||
case "parent":
|
|
||||||
window.parent.location.href = redirectURL;
|
|
||||||
break;
|
|
||||||
case "aframe":
|
|
||||||
document.getElementById("aframe").src = redirectURL;
|
|
||||||
break;
|
|
||||||
case "ainfo":
|
|
||||||
ainfo(redirectURL);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
window.location.href = redirectURL;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (document.getElementById("countdown").innerHTML !== '') {
|
|
||||||
document.getElementById("countdown").innerHTML = "<a href='"+redirectURL+"' target='aframe'>OK</a>";
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
elem.innerHTML = timeLeft + " s";
|
|
||||||
timeLeft--;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (err) {
|
|
||||||
console.log('Fetch error:' + err + myURL ); // Error handling
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// const desiredImageWidthInKm = 11; // Now Is calculated from northEastLon - southWestLon
|
// const desiredImageWidthInKm = 11; // Now Is calculated from northEastLon - southWestLon
|
||||||
const tileSizeInPixels = 256;
|
const tileSizeInPixels = 256;
|
||||||
|
|
Loading…
Reference in New Issue