-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Anand Thakker
committed
Aug 24, 2016
1 parent
7063b1a
commit f2a3c9d
Showing
2 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Mapbox GL JS debug page</title> | ||
<meta charset='utf-8'> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> | ||
|
||
<link rel='stylesheet' href='/dist/mapbox-gl.css' /> | ||
<style> | ||
body { margin: 0; padding: 0; } | ||
html, body, #map { height: 100%; } | ||
#checkboxes { | ||
position: absolute; | ||
background: #fff; | ||
top:0; | ||
left:0; | ||
padding:10px; | ||
} | ||
#buffer { | ||
position: absolute; | ||
top:100px; | ||
left:0; | ||
pointer-events: none; | ||
} | ||
#buffer div { | ||
background-color: #fff; | ||
padding: 5px 0; | ||
text-indent: 10px; | ||
white-space: nowrap; | ||
text-shadow: | ||
-1px -1px 0 #fff, | ||
1px -1px 0 #fff, | ||
-1px 1px 0 #fff, | ||
1px 1px 0 #fff; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div id='map'></div> | ||
<div id='checkboxes'> | ||
<input id='show-tile-boundaries-checkbox' name='show-tile-boundaries' type='checkbox'> <label for='show-tile-boundaries'>tile debug</label><br /> | ||
<input id='show-symbol-collision-boxes-checkbox' name='show-symbol-collision-boxes' type='checkbox'> <label for='show-symbol-collision-boxes'>collision debug</label><br /> | ||
<input id='show-overdraw-checkbox' name='show-overdraw' type='checkbox'> <label for='show-overdraw'>overdraw debug</label><br /> | ||
<input id='buffer-checkbox' name='buffer' type='checkbox'> <label for='buffer'>buffer stats</label> | ||
</div> | ||
|
||
<div id='buffer' style="display:none"> | ||
<em>Waiting for data...</em> | ||
</div> | ||
|
||
<script src='/dist/mapbox-gl-dev.js'></script> | ||
<script src='http://devseed.com/mapbox-gl-topojson/dist/mapbox-gl-topojson.js'></script> | ||
<script src='/debug/access-token-generated.js'></script> | ||
|
||
<script> | ||
mapboxgl.workerCount = 1 | ||
mapboxgl.addSourceType('topojson', mapboxgl.TopoJSONSource, function (err) { | ||
var map = window.map = new mapboxgl.Map({ | ||
container: 'map', | ||
zoom: 5.2, | ||
center: [-119.393, 36.883], | ||
style: 'mapbox://styles/mapbox/streets-v8' | ||
}) | ||
|
||
map.on('load', function () { | ||
map.addSource('counties', { | ||
type: 'topojson', | ||
data: 'http://devseed.com/mapbox-gl-topojson/ca.json', | ||
workerOptions: { | ||
layer: 'counties' | ||
} | ||
}) | ||
|
||
map.addLayer({ | ||
'id': 'county-boundaries', | ||
'type': 'line', | ||
'source': 'counties', | ||
'paint': { | ||
'line-color': '#EC8D8D', | ||
'line-width': { | ||
'base': 1.5, | ||
'stops': [ | ||
[ | ||
5, | ||
0.75 | ||
], | ||
[ | ||
18, | ||
32 | ||
] | ||
] | ||
} | ||
} | ||
}, 'country-label-lg') | ||
}) | ||
}) | ||
</script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters