-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.html
62 lines (54 loc) · 1.62 KB
/
main.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
<!DOCTYPE html><html><head><meta charset="utf-8"/>
<style>
body {
background-image: url("img/deno_hr_circle_gray_part.png");
background-repeat: no-repeat;
background-position: right bottom;
background-size: 50%;
box-sizing: border-box;
height: 100vh;
margin-left: 2em;
font-family: sans-serif;
}
textarea {
background-color: transparent;
}
a {
color: gray !important;
}
</style>
</head><body>
<div>
<h1>住所のジオコーディング、逆ジオコーディング(丁目レベル)</h1>
<div>
<h2>住所のジオコーディング(住所から緯度経度)</h2>
<input type=text id=input1 value="福井県,鯖江市,新横江2"><br>
↓<br>
<textarea id="result1" style="width:90vw;height:6em;"></textarea>
</div>
<div>
<h2>住所の逆ジオコーディング(緯度経度から住所)</h2>
<input type=text id=input2 value="35.941043,136.199640"><br>
↓<br>
<textarea id="result2" style="width:90vw;height:12em;"></textarea>
</div>
<hr>
<a href=https://github.com/code4sabae/geocde>src on GitHub</a>, <a href=https://deno.land/manual>character logo by Deno</a>
<script type="module">
import { getLatLng, fromLatLng } from "https://code4sabae.github.io/geocode/geocode.mjs"
window.onload = async () => {
const setInput = (input, func, result) => {
const f = async function () {
const params = input.value.split(",");
const json = await func(params[0], params[1], params[2]);
result.value = JSON.stringify(json, null, 2);
};
input.onkeyup = input.onchange = f;
f();
};
setInput(input1, getLatLng, result1);
setInput(input2, fromLatLng, result2);
};
</script>
</body>
</html>