-
Notifications
You must be signed in to change notification settings - Fork 0
/
topo-test.html
57 lines (43 loc) · 1.78 KB
/
topo-test.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
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Display a map with a custom style</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://cdn.rawgit.com/jstratman/jstratman.github.io/master/test/mapbox-gl.js'></script>
<link href='https://cdn.rawgit.com/jstratman/jstratman.github.io/master/test/mapbox-gl.css' rel='stylesheet' />
<script src='https://npmcdn.com/@turf/turf/turf.min.js'></script>
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
<body>
<div id='map'></div>
<script>
mapboxgl.accessToken = 'pk.eyJ1IjoianN0cmF0bSIsImEiOiJPT1hJQmNnIn0.G6gvgXGeQXbQ5cnIj8i7AA';
var map = new mapboxgl.Map({
container: 'map', // container id
style: 'https://raw.githubusercontent.com/jstratman/jstratman.github.io/master/topo150.json', //hosted style id
center: [-108.41409,37.3098], // starting position
zoom: 13, // starting zoom
hash: true,
fadeDuration: 120,
maxZoom: 16.5
//showTileBoundaries: true
});
//map.showTileBoundaries = true;
//map.showCollisionBoxes = true;
map.on('load', function() {
// map.setLayoutProperty('tree-canopy-orig', 'visibility', 'visible');
// map.setLayoutProperty('line-labels-center','symbol-placement','line-center');
// map.setLayoutProperty('line-labels-center', 'text-ignore-placement', false);
// map.setLayoutProperty('line-labels-center', 'text-allow-overlap', false);
// map.setLayoutProperty('trails-labels-12-line-copy', 'visibility', 'visible');
// map.setLayoutProperty('poi-labels', 'visibility', 'none');
// map.setLayoutProperty('contours-major', 'visibility', 'none');
//line-labels-copy-copy
});
</script>
</body>
</html>