-
Notifications
You must be signed in to change notification settings - Fork 152
/
index.html
43 lines (34 loc) · 1.4 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
43
<!DOCTYPE html>
<html>
<head>
<title>Modest Maps JS</title>
<script type="text/javascript" src="../../modestmaps.js"></script>
<script type="text/javascript" src="follower.js"></script>
<script type="text/javascript">
var MM = com.modestmaps;
var map;
function initMap() {
var input = document.getElementById('url');
if (location.search && location.search.length > 1) {
var index = location.search.indexOf('url');
if (index > 0) {
input.value = decodeURIComponent(location.search.slice(index+4));
}
}
map = new MM.Map('map', new MM.TemplatedLayer(input.value))
var f = new MM.Follower(map, new MM.Location(37.811530, -122.2666097), '° Broadway and Grand');
map.setCenterZoom(new MM.Location(37.811530, -122.2666097), 14);
}
</script>
</head>
<body onload="initMap()">
<h1>Modest Maps JS</h1>
<form method="GET" action="index.html">
<input type="text" name="url" id="url" size="48" value="http://tile.openstreetmap.org/{Z}/{X}/{Y}.png">
<input type="submit" value="Go!">
</form>
<p><a href="javascript:map.zoomIn()">zoom in</a> | <a href="javascript:map.zoomOut()">zoom out</a>
<br><a href="javascript:map.panLeft()">pan left</a> | <a href="javascript:map.panRight()">pan right</a> | <a href="javascript:map.panDown()">pan down</a> | <a href="javascript:map.panUp()">pan up</a></p>
<div id="map" style="width: 100%; height: 500px"></div>
</body>
</html>