-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdisplay_url.html
81 lines (72 loc) · 2.39 KB
/
display_url.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Location Information</title>
<style>
body {
background-image: url('/static/d1.png');
background-size: 100% 100%;
background-position: center;
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
color: rgb(15, 1, 1);
min-height: 100vh;
overflow-x: hidden;
display: flex;
justify-content: center;
align-items: center;
}
.content-container {
background-color: #f6e9e971;
padding: 20px;
border-radius: 10px;
text-align: center;
border: 2px solid #ffffff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}
#attach {
padding: 10px 20px;
background-color: #007bff;
color: #fff;
border: none;
border-radius: 5px;
cursor: pointer;
text-decoration: none;
margin-top: 10px;
}
#address {
margin-top: 20px;
font-weight: bold;
}
</style>
</head>
<body>
<div class="content-container">
<h2>Location Information</h2>
<p>URL: {{ location_url }}</p>
<p>Latitude: {{ latitude }}</p>
<p>Longitude: {{ longitude }}</p>
<button id="attach">Attach</button>
</div>
</body>
<script>
document.getElementById("attach").addEventListener("click", function () {
window.location.href = "/display_address?latitude={{ latitude }}&longitude={{ longitude }}";
});
function getAddress(latitude, longitude) {
fetch(`/display_address?latitude=${latitude}&longitude=${longitude}`)
.then(response => response.text())
.then(data => {
document.getElementById("address").textContent = data;
})
.catch(error => {
console.error('Error fetching address:', error);
});
}
getAddress("{{ latitude }}", "{{ longitude }}","");
</script>
</html>
</html>