<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.21.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.21.0/mapbox-gl.css' rel='stylesheet' />
<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.eyJ1IjoibHVjYXN3b2oiLCJhIjoiNWtUX3JhdyJ9.WtCTtw6n20XV2DwwJHkGqQ';
var map = new mapboxgl.Map({
container: 'map', // container id
style: {
"version": 8,
"name": "Bright",
"metadata": {
"mapbox:autocomposite": true,
"mapbox:groups": {
"1444849345966.4436": {
"name": "Roads",
"collapsed": true
},
"1444849334699.1902": {
"name": "Bridges",
"collapsed": true
}
}
},
"sources": {
"mapbox": {
"url": "mapbox://mapbox.mapbox-streets-v7",
"type": "vector"
}
},
"sprite": "mapbox://sprites/mapbox/bright-v8",
"glyphs": "mapbox://fonts/mapbox/{fontstack}/{range}.pbf",
"layers": [
{
"interactive": true,
"layout": {
"line-cap": "round",
"line-join": "round",
"visibility": "visible"
},
"metadata": {
"mapbox:group": "1444849345966.4436"
},
"filter": [
"all",
[
"in",
"class",
"secondary",
"tertiary"
],
[
"!in",
"structure",
"bridge",
"tunnel"
]
],
"type": "line",
"source": "mapbox",
"id": "road_secondary_tertiary_casing",
"paint": {
"line-color": "#e9ac77",
"line-width": {
"base": 1.2,
"stops": [
[
8,
1.5
],
[
20,
17
]
]
},
"line-opacity": 1
},
"source-layer": "road"
},
{
"interactive": true,
"metadata": {
"mapbox:group": "1444849345966.4436"
},
"id": "road_secondary_tertiary",
"paint": {
"line-color": "#fea",
"line-width": {
"base": 1.2,
"stops": [
[
6.5,
0
],
[
8,
0.5
],
[
20,
13
]
]
}
},
"ref": "road_secondary_tertiary_casing"
},
{
"interactive": true,
"layout": {
"line-join": "round"
},
"metadata": {
"mapbox:group": "1444849334699.1902"
},
"filter": [
"all",
[
"==",
"structure",
"bridge"
],
[
"in",
"class",
"secondary",
"tertiary"
]
],
"type": "line",
"source": "mapbox",
"id": "bridge_secondary_tertiary_casing",
"layout": {
"line-cap": "round"
},
"paint": {
"line-color": "#e9ac77",
"line-width": {
"base": 1.2,
"stops": [
[
8,
1.5
],
[
20,
17
]
]
},
"line-opacity": 1
},
"source-layer": "road"
},
{
"interactive": true,
"metadata": {
"mapbox:group": "1444849334699.1902"
},
"id": "bridge_secondary_tertiary",
"paint": {
"line-color": "#0f0",
"line-width": {
"base": 1.2,
"stops": [
[
6.5,
0
],
[
7,
0.5
],
[
20,
10
]
]
}
},
"ref": "bridge_secondary_tertiary_casing"
}
]
},
center: { lat: 38.29861860978207, lng: -122.28341345917275},
zoom: 17 // starting zoom
});
</script>
</body>
</html>
Output
300px
You can jump to the latest bin by adding /latest
to your URL
Keyboard Shortcuts
Shortcut | Action |
---|---|
ctrl + [num] | Toggle nth panel |
ctrl + 0 | Close focused panel |
ctrl + enter | Re-render output. If console visible: run JS in console |
Ctrl + l | Clear the console |
ctrl + / | Toggle comment on selected lines |
ctrl + ] | Indents selected lines |
ctrl + [ | Unindents selected lines |
tab | Code complete & Emmet expand |
ctrl + shift + L | Beautify code in active panel |
ctrl + s | Save & lock current Bin from further changes |
ctrl + shift + s | Open the share options |
ctrl + y | Archive Bin |
Complete list of JS Bin shortcuts |
JS Bin URLs
URL | Action |
---|---|
/ | Show the full rendered output. This content will update in real time as it's updated from the /edit url. |
/edit | Edit the current bin |
/watch | Follow a Code Casting session |
/embed | Create an embeddable version of the bin |
/latest | Load the very latest bin (/latest goes in place of the revision) |
/[username]/last | View the last edited bin for this user |
/[username]/last/edit | Edit the last edited bin for this user |
/[username]/last/watch | Follow the Code Casting session for the latest bin for this user |
/quiet | Remove analytics and edit button from rendered output |
.js | Load only the JavaScript for a bin |
.css | Load only the CSS for a bin |
Except for username prefixed urls, the url may start with http://jsbin.com/abc and the url fragments can be added to the url to view it differently. |