Skip to content

Instantly share code, notes, and snippets.

Created May 12, 2017 21:51
Show Gist options
  • Save anonymous/e899d70b355d68c0c90dd51bf6c5bf73 to your computer and use it in GitHub Desktop.
Save anonymous/e899d70b355d68c0c90dd51bf6c5bf73 to your computer and use it in GitHub Desktop.
SBB Internal
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>SBB Internal Preview</title>
<link rel="stylesheet" type="text/css" href="https://api.mapbox.com/mapbox-gl-js/v0.28.0/mapbox-gl.css" />
<script src="https://api.mapbox.com/mapbox-gl-js/v0.28.0/mapbox-gl.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>
var map = new mapboxgl.Map({
container: 'map',
style: 'style.json',
attributionControl: true,
hash: true
});
map.addControl(new mapboxgl.NavigationControl());
</script>
</body>
</html>
{
"version": 8,
"name": "SBB Internal",
"metadata": {
"mapbox:autocomposite": false,
"mapbox:type": "template",
"maputnik:renderer": "mbgljs",
"openmaptiles:version": "3.x",
"openmaptiles:mapbox:owner": "openmaptiles",
"openmaptiles:mapbox:source:url": "mapbox://openmaptiles.4qljc88t"
},
"center": [
8.54806714892635,
47.37180823552663
],
"zoom": 12.241790506353492,
"bearing": 0,
"pitch": 0,
"sources": {
"openmaptiles": {
"type": "vector",
"url": "https://free.tilehosting.com/data/v3.json?key=NZLDFYl5VaViagsQRgLE"
}
},
"glyphs": "https://free.tilehosting.com/fonts/{fontstack}/{range}.pbf?key=NZLDFYl5VaViagsQRgLE",
"layers": [
{
"id": "background",
"type": "background",
"paint": {
"background-color": "#fff"
}
},
{
"id": "landcover_grass",
"type": "fill",
"source": "openmaptiles",
"source-layer": "landcover",
"filter": [
"==",
"class",
"grass"
],
"paint": {
"fill-color": "#eaf6e4",
"fill-opacity": 0.45
}
},
{
"id": "park",
"type": "fill",
"source": "openmaptiles",
"source-layer": "park",
"layout": {
"visibility": "none"
},
"paint": {
"fill-color": "rgba(192, 216, 151, 0.53)",
"fill-opacity": 1
}
},
{
"id": "landcover_wood",
"type": "fill",
"source": "openmaptiles",
"source-layer": "landcover",
"minzoom": 12,
"filter": [
"==",
"class",
"wood"
],
"paint": {
"fill-color": "#eaf6e4",
"fill-opacity": {
"base": 1,
"stops": [
[
12,
0.2
],
[
22,
1
]
]
}
}
},
{
"id": "water",
"type": "fill",
"source": "openmaptiles",
"source-layer": "water",
"filter": [
"==",
"$type",
"Polygon"
],
"paint": {
"fill-color": "#9ac8e0"
}
},
{
"id": "landuse",
"type": "fill",
"source": "openmaptiles",
"source-layer": "landuse",
"filter": [
"==",
"class",
"agriculture"
],
"layout": {
"visibility": "visible"
},
"paint": {
"fill-color": "#eae0d0"
}
},
{
"id": "landuse_overlay_national_park",
"type": "fill",
"source": "openmaptiles",
"source-layer": "landcover",
"filter": [
"==",
"class",
"national_park"
],
"paint": {
"fill-color": "#E1EBB0",
"fill-opacity": {
"base": 1,
"stops": [
[
5,
0
],
[
9,
0.75
]
]
}
}
},
{
"id": "park_outline",
"type": "line",
"source": "openmaptiles",
"source-layer": "park",
"layout": {
"visibility": "none"
},
"paint": {
"line-color": "rgba(159, 183, 118, 0.69)",
"line-dasharray": [
0.5,
1
]
}
},
{
"id": "waterway",
"type": "line",
"source": "openmaptiles",
"source-layer": "waterway",
"filter": [
"==",
"$type",
"LineString"
],
"paint": {
"line-color": "hsl(205, 56%, 73%)",
"line-width": {
"base": 1.4,
"stops": [
[
8,
1
],
[
20,
8
]
]
},
"line-opacity": 1
}
},
{
"id": "building",
"type": "fill",
"source": "openmaptiles",
"source-layer": "building",
"paint": {
"fill-color": "#ebebeb",
"fill-opacity": {
"base": 1,
"stops": [
[
15,
0
],
[
16,
1
]
]
}
}
},
{
"id": "housenumber",
"type": "symbol",
"source": "openmaptiles",
"source-layer": "housenumber",
"minzoom": 17,
"maxzoom": 22,
"filter": [
"==",
"$type",
"Point"
],
"layout": {
"text-field": "{housenumber}",
"text-size": 10,
"text-font": [
"Klokantech Noto Sans Regular",
"Klokantech Noto Sans CJK Regular"
],
"visibility": "none"
},
"paint": {
"text-color": "hsla(0, 14%, 57%, 0.51)",
"text-halo-color": "hsl(39, 41%, 86%)",
"text-halo-width": 0.5
}
},
{
"id": "road_path",
"type": "line",
"source": "openmaptiles",
"source-layer": "transportation",
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"in",
"class",
"path",
"track"
]
],
"layout": {
"line-cap": "square",
"line-join": "bevel"
},
"paint": {
"line-color": "#eae6e1",
"line-dasharray": [
1,
1
],
"line-width": {
"base": 1.55,
"stops": [
[
4,
0.25
],
[
20,
10
]
]
}
}
},
{
"id": "road_minor",
"type": "line",
"source": "openmaptiles",
"source-layer": "transportation",
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"in",
"class",
"minor",
"service"
]
],
"layout": {
"line-cap": "round",
"line-join": "round"
},
"paint": {
"line-color": "#eae6e1",
"line-width": {
"base": 1.55,
"stops": [
[
4,
0.25
],
[
20,
30
]
]
}
}
},
{
"id": "tunnel_minor",
"type": "line",
"source": "openmaptiles",
"source-layer": "transportation",
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"==",
"brunnel",
"tunnel"
],
[
"==",
"class",
"minor_road"
]
],
"layout": {
"line-cap": "butt",
"line-join": "miter"
},
"paint": {
"line-color": "#efefef",
"line-width": {
"base": 1.55,
"stops": [
[
4,
0.25
],
[
20,
30
]
]
},
"line-dasharray": [
0.36,
0.18
]
}
},
{
"id": "tunnel_major",
"type": "line",
"source": "openmaptiles",
"source-layer": "transportation",
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"==",
"brunnel",
"tunnel"
],
[
"in",
"class",
"primary",
"secondary",
"tertiary",
"trunk"
]
],
"layout": {
"line-cap": "butt",
"line-join": "miter"
},
"paint": {
"line-color": "#fff",
"line-width": {
"base": 1.4,
"stops": [
[
6,
0.5
],
[
20,
30
]
]
},
"line-dasharray": [
0.28,
0.14
]
}
},
{
"id": "aeroway-area",
"type": "fill",
"metadata": {
"mapbox:group": "1444849345966.4436"
},
"source": "openmaptiles",
"source-layer": "aeroway",
"minzoom": 4,
"filter": [
"all",
[
"==",
"$type",
"Polygon"
],
[
"in",
"class",
"runway",
"taxiway"
]
],
"layout": {
"visibility": "visible"
},
"paint": {
"fill-opacity": {
"base": 1,
"stops": [
[
13,
0
],
[
14,
1
]
]
},
"fill-color": "rgba(255, 255, 255, 1)"
}
},
{
"id": "aeroway-taxiway",
"type": "line",
"metadata": {
"mapbox:group": "1444849345966.4436"
},
"source": "openmaptiles",
"source-layer": "aeroway",
"minzoom": 12,
"filter": [
"all",
[
"in",
"class",
"taxiway"
],
[
"==",
"$type",
"LineString"
]
],
"layout": {
"line-cap": "round",
"line-join": "round",
"visibility": "visible"
},
"paint": {
"line-color": "rgba(255, 255, 255, 1)",
"line-width": {
"base": 1.5,
"stops": [
[
12,
1
],
[
17,
10
]
]
},
"line-opacity": 1
}
},
{
"id": "aeroway-runway",
"type": "line",
"metadata": {
"mapbox:group": "1444849345966.4436"
},
"source": "openmaptiles",
"source-layer": "aeroway",
"minzoom": 4,
"filter": [
"all",
[
"in",
"class",
"runway"
],
[
"==",
"$type",
"LineString"
]
],
"layout": {
"line-cap": "round",
"line-join": "round",
"visibility": "visible"
},
"paint": {
"line-color": "rgba(255, 255, 255, 1)",
"line-width": {
"base": 1.5,
"stops": [
[
11,
4
],
[
17,
50
]
]
},
"line-opacity": 1
}
},
{
"id": "road_trunk_primary",
"type": "line",
"source": "openmaptiles",
"source-layer": "transportation",
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"in",
"class",
"trunk",
"primary"
]
],
"layout": {
"line-cap": "round",
"line-join": "round"
},
"paint": {
"line-color": "#eae6e1",
"line-width": {
"base": 1.4,
"stops": [
[
6,
0.5
],
[
20,
30
]
]
}
}
},
{
"id": "road_secondary_tertiary",
"type": "line",
"source": "openmaptiles",
"source-layer": "transportation",
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"in",
"class",
"secondary",
"tertiary"
]
],
"layout": {
"line-cap": "round",
"line-join": "round"
},
"paint": {
"line-color": "#eae6e1",
"line-width": {
"base": 1.4,
"stops": [
[
6,
0.5
],
[
20,
20
]
]
}
}
},
{
"id": "road_major_motorway",
"type": "line",
"source": "openmaptiles",
"source-layer": "transportation",
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"==",
"class",
"motorway"
]
],
"layout": {
"line-cap": "round",
"line-join": "round"
},
"paint": {
"line-color": "#eae6e1",
"line-width": {
"base": 1.4,
"stops": [
[
8,
2
],
[
16,
12
]
]
},
"line-offset": 0
}
},
{
"id": "railway",
"type": "line",
"source": "openmaptiles",
"source-layer": "transportation",
"filter": [
"==",
"class",
"rail"
],
"layout": {
"visibility": "visible"
},
"paint": {
"line-color": "#808080",
"line-opacity": {
"base": 1,
"stops": [
[
11,
0.5
],
[
16,
1
]
]
},
"line-width": 4
}
},
{
"id": "bridge_minor case",
"type": "line",
"source": "openmaptiles",
"source-layer": "transportation",
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"==",
"brunnel",
"bridge"
],
[
"==",
"class",
"minor_road"
]
],
"layout": {
"line-cap": "butt",
"line-join": "miter"
},
"paint": {
"line-color": "#dedede",
"line-width": {
"base": 1.6,
"stops": [
[
12,
0.5
],
[
20,
10
]
]
},
"line-gap-width": {
"base": 1.55,
"stops": [
[
4,
0.25
],
[
20,
30
]
]
}
}
},
{
"id": "bridge_major case",
"type": "line",
"source": "openmaptiles",
"source-layer": "transportation",
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"==",
"brunnel",
"bridge"
],
[
"in",
"class",
"primary",
"secondary",
"tertiary",
"trunk"
]
],
"layout": {
"line-cap": "butt",
"line-join": "miter"
},
"paint": {
"line-color": "#dedede",
"line-width": {
"base": 1.6,
"stops": [
[
12,
0.5
],
[
20,
10
]
]
},
"line-gap-width": {
"base": 1.55,
"stops": [
[
4,
0.25
],
[
20,
30
]
]
}
}
},
{
"id": "bridge_minor",
"type": "line",
"source": "openmaptiles",
"source-layer": "transportation",
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"==",
"brunnel",
"bridge"
],
[
"==",
"class",
"minor_road"
]
],
"layout": {
"line-cap": "round",
"line-join": "round"
},
"paint": {
"line-color": "#efefef",
"line-width": {
"base": 1.55,
"stops": [
[
4,
0.25
],
[
20,
30
]
]
}
}
},
{
"id": "bridge_major",
"type": "line",
"source": "openmaptiles",
"source-layer": "transportation",
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"==",
"brunnel",
"bridge"
],
[
"in",
"class",
"primary",
"secondary",
"tertiary",
"trunk"
]
],
"layout": {
"line-cap": "round",
"line-join": "round"
},
"paint": {
"line-color": "#fff",
"line-width": {
"base": 1.4,
"stops": [
[
6,
0.5
],
[
20,
30
]
]
}
}
},
{
"id": "admin_sub",
"type": "line",
"source": "openmaptiles",
"source-layer": "boundary",
"filter": [
"in",
"admin_level",
4,
6,
8
],
"layout": {
"visibility": "visible"
},
"paint": {
"line-color": "hsl(0, 0%, 76%)",
"line-dasharray": [
2,
1
]
}
},
{
"id": "admin_country",
"type": "line",
"source": "openmaptiles",
"source-layer": "boundary",
"filter": [
"all",
[
"<=",
"admin_level",
2
],
[
"==",
"$type",
"LineString"
]
],
"layout": {
"line-cap": "round",
"line-join": "round"
},
"paint": {
"line-color": "hsla(0, 8%, 22%, 0.51)",
"line-width": {
"base": 1.3,
"stops": [
[
3,
0.5
],
[
22,
15
]
]
}
}
},
{
"id": "poi_label",
"type": "symbol",
"source": "openmaptiles",
"source-layer": "poi",
"minzoom": 5,
"filter": [
"all",
[
"==",
"$type",
"Point"
],
[
"==",
"rank",
1
]
],
"layout": {
"text-size": 11,
"text-font": [
"Klokantech Noto Sans Regular",
"Klokantech Noto Sans CJK Regular"
],
"visibility": "visible",
"text-offset": [
0,
0.5
],
"icon-size": 1,
"text-anchor": "top",
"text-field": "{name}",
"text-max-width": 8
},
"paint": {
"text-color": "#666",
"text-halo-width": 1,
"text-halo-color": "rgba(255,255,255,0.75)",
"text-halo-blur": 1
}
},
{
"id": "road_major_label",
"type": "symbol",
"source": "openmaptiles",
"source-layer": "transportation_name",
"filter": [
"==",
"$type",
"LineString"
],
"layout": {
"symbol-placement": "line",
"text-field": "{name}",
"text-font": [
"Klokantech Noto Sans Regular",
"Klokantech Noto Sans CJK Regular"
],
"text-transform": "none",
"text-letter-spacing": 0.1,
"text-size": {
"base": 1.4,
"stops": [
[
10,
8
],
[
20,
14
]
]
},
"text-rotation-alignment": "map"
},
"paint": {
"text-color": "#9b9997",
"text-halo-color": "hsl(0, 0%, 100%)",
"text-halo-width": 2
}
},
{
"id": "place_label_other",
"type": "symbol",
"source": "openmaptiles",
"source-layer": "place",
"minzoom": 8,
"maxzoom": 22,
"filter": [
"all",
[
"==",
"$type",
"Point"
],
[
"!=",
"class",
"city"
],
[
"!=",
"class",
"suburb"
],
[
"!=",
"class",
"town"
]
],
"layout": {
"text-field": "{name}",
"text-font": [
"Klokantech Noto Sans Regular",
"Klokantech Noto Sans CJK Regular"
],
"text-max-width": 6,
"text-size": {
"stops": [
[
6,
10
],
[
12,
14
]
]
},
"visibility": "visible",
"text-anchor": "center",
"text-transform": "none",
"text-letter-spacing": 0
},
"paint": {
"text-color": "#777",
"text-halo-color": "hsl(0, 0%, 100%)",
"text-halo-blur": 0,
"text-halo-width": 2
}
},
{
"id": "place_label_suburb",
"type": "symbol",
"source": "openmaptiles",
"source-layer": "place",
"minzoom": 12,
"maxzoom": 22,
"filter": [
"all",
[
"==",
"$type",
"Point"
],
[
"!=",
"class",
"city"
]
],
"layout": {
"text-field": "{name}",
"text-font": [
"Klokantech Noto Sans Regular",
"Klokantech Noto Sans CJK Regular"
],
"text-max-width": 6,
"text-size": {
"stops": [
[
6,
10
],
[
12,
14
]
]
},
"visibility": "visible",
"text-anchor": "center",
"text-transform": "uppercase",
"text-letter-spacing": 0.2
},
"paint": {
"text-color": "#aaaaaa",
"text-halo-color": "hsl(0, 0%, 100%)",
"text-halo-blur": 0,
"text-halo-width": 2
}
},
{
"id": "place_label_town",
"type": "symbol",
"source": "openmaptiles",
"source-layer": "place",
"maxzoom": 16,
"filter": [
"all",
[
"==",
"$type",
"Point"
],
[
"==",
"class",
"town"
]
],
"layout": {
"text-field": "{name}",
"text-font": [
"Klokantech Noto Sans Bold",
"Klokantech Noto Sans CJK Regular"
],
"text-max-width": 10,
"text-size": {
"stops": [
[
3,
10
],
[
8,
14
]
]
}
},
"paint": {
"text-color": "#000",
"text-halo-color": "hsla(0, 0%, 100%, 0.75)",
"text-halo-blur": 0,
"text-halo-width": 2
}
},
{
"id": "place_label_city",
"type": "symbol",
"source": "openmaptiles",
"source-layer": "place",
"maxzoom": 16,
"filter": [
"all",
[
"==",
"$type",
"Point"
],
[
"==",
"class",
"city"
]
],
"layout": {
"text-field": "{name}",
"text-font": [
"Klokantech Noto Sans Bold",
"Klokantech Noto Sans CJK Regular"
],
"text-max-width": 10,
"text-size": {
"stops": [
[
3,
14
],
[
8,
18
]
]
}
},
"paint": {
"text-color": "#000",
"text-halo-color": "hsla(0, 0%, 100%, 0.75)",
"text-halo-blur": 0,
"text-halo-width": 2
}
},
{
"id": "country_label",
"type": "symbol",
"source": "openmaptiles",
"source-layer": "place",
"maxzoom": 12,
"filter": [
"all",
[
"==",
"$type",
"Point"
],
[
"==",
"class",
"country"
]
],
"layout": {
"text-field": "{name}",
"text-font": [
"Klokantech Noto Sans Bold",
"Klokantech Noto Sans CJK Bold"
],
"text-max-width": 10,
"text-size": {
"stops": [
[
3,
12
],
[
8,
22
]
]
}
},
"paint": {
"text-color": "hsl(0, 0%, 13%)",
"text-halo-color": "rgba(255,255,255,0.75)",
"text-halo-width": 2,
"text-halo-blur": 0
}
}
],
"id": "ciwf4zbsv007y2pmt2rspc1dc",
"owner": ""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment