-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
42 lines (40 loc) · 1.6 KB
/
index.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
<!DOCTYPE html>
<html lang="en_US">
<head>
<meta charset="UTF-8">
<title>OSM Business Card</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
</head>
<body>
<h1>Interactive OpenStreetMap Embed</h1>
<p>Generates an embeddable map that displays business info from an OSM object id.<br/>Copy the below code to use on your website!</p>
<p>Contribute on <a href="https://github.com/rivermont/osm-card">GitHub</a>.</p>
OpenStreetMap object id: <input type="text" id="id" placeholder="OSM id" value="30011188" /><br>
Object type: <select id="type">
<option value="n">Node</option>
<option value="w" selected>Way</option>
<option value="r">Relation</option>
</select><br>
Embed width: <input type="text" id="w" placeholder="width (px)" value="800" /> and height: <input type="text" id="h" placeholder="height (px)" value="400" />
<br><br>
<textarea id="output" cols="70" rows="5" readonly></textarea>
<br><br>
<div id="frame"></div>
<script>
a = '<iframe src=';
d = '></iframe>';
function run() {
b1 = '"//' + window.location.hostname + window.location.pathname;
b2 = '"./';
c = 'card.html?type=' + $('#type').val() + '&id=' + $('#id').val() + '" width="' + $('#w').val() + 'px" height="' + $('#h').val() + 'px"';
$('#frame').html(a + b2 + c + d);
$('#output').val(a + b1 + c + d);
}
run();
$('#id').change(run);
$('#type').change(run);
$('#w').change(run);
$('#h').change(run);
</script>
</body>
</html>