-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
76 lines (52 loc) · 1.82 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
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
<!DOCTYPE html>
<html>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<script src="https://cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/3.13/cartodb.js"> </script>
<link href="https://cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/3.13/themes/css/cartodb.css" rel='stylesheet' />
<style>
body {
margin:0;
padding:0;
}
#mappy {
position:absolute;
top:0;
bottom:0;
width:100%;
height:100%;
}
</style>
</head>
<body>
<div id='mappy'></div>
<script>
// will's public mapbox api token, keep this here for now
// L.mapbox.accessToken = 'pk.eyJ1Ijoic2tvcmFzYXVydXMiLCJhIjoiaEdGTUZWTSJ9.osOC8tWU3bMaNprVNoEu7g';
var map;
// initiate leaflet map, but do not add a map
map = new L.Map('mappy', {
center: [41.501860, -81.635799],
zoom: 13
})
// create cartodb visualization of the zoning polygons
cartodb.createLayer(map, 'http://skorasaurus.cartodb.com/api/v2/viz/71ad7876-da04-11e4-a16b-0e0c41326911/viz.json')
.addTo(map)
.on('done', function(layer) {
layer.setZIndex(8);
})
.on('error', function(err) {
alert("some error occurred: " + err);
});
// add the semi-transparent basemap; with a higher zIndex so its tiles display above/over the cartodb polygons
var basemap = new L.TileLayer('http://{s}.tiles.mapbox.com/v3/skorasaurus.99163c40/{z}/{x}/{y}.png', {maxZoom: 18, zIndex: 15});
basemap.addTo(map);
// var basemap = new L.TileLayer('', {maxZoom: 18});
// // hack to display the cartodb layer above my baselayer
// var overlays = cdb_layers;
// var lyrs = L.control.layers(overlays, {autoZIndex:true}).addTo(map);
// lyrs.bringToFront();
//
</script>
</body>
</html>