-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathos_opendata_tiles.html
executable file
·46 lines (43 loc) · 1.7 KB
/
os_opendata_tiles.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
<!DOCTYPE html>
<html>
<head>
<title>Ordnance Survey Styled Vector Tiles</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Nautoguide OS Opendata Style Development</title>
<link rel="stylesheet" type="text/css" href="http://localhost:8080/mapbox-gl.css" />
<link rel="stylesheet" type="text/css" href="http://localhost:8080/mapbox-gl-inspect.css" />
<script src="http://localhost:8080/mapbox-gl.js"></script>
<script src="os_opendata_style.js"></script>
<script src="os_roads_style.js"></script>
<script src="os_buildings_style.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<link rel="stylesheet" href="../css/styles.css">
</head>
<body>
<header>
<img src="../css/logo.svg" class="logo">
<h2>OS Vector Tiles</h2>
</header>
<div id="map" class="map"></div>
<div id="layerList" class="layerList">
<button id="os_style" class="buttony">OS Style</button>
<button id="os_roads_style" class="buttony wacky"><em>Wacky</em> Style</button>
<button id="os_buildings_style" class="buttony"><em>Buildings</em> Style</button>
</div>
<pre id="propertyList"></pre>
<script>
var map = new mapboxgl.Map({
container: 'map',
hash: true,
center : [-1.780258,54.554368],
zoom : 5,
style: os_style
});
map.addControl(new mapboxgl.NavigationControl());
$('#os_style').on('click', function(){ map.setZoom(9); map.setStyle(os_style)});
$('#os_roads_style').on('click', function(){ map.setZoom(8); map.setStyle(os_road_style)});
$('#os_buildings_style').on('click', function(){ map.setZoom(10); map.setStyle(os_buildings_style)});
</script>
</body>
</html>