Skip to content

Instantly share code, notes, and snippets.

@jatorre
Last active June 8, 2017 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jatorre/6212354d5e023076797db7ea18540c33 to your computer and use it in GitHub Desktop.
Save jatorre/6212354d5e023076797db7ea18540c33 to your computer and use it in GitHub Desktop.
Testing CARTO Vector Tiles
{
"tiles": ["https://cartobase-a.global.ssl.fastly.net/omtvector/{z}/{x}/{y}.vt?api_key=de0f3965167a84e25fb5573409f071e7406619ef",
"https://cartobase-b.global.ssl.fastly.net/omtvector/{z}/{x}/{y}.vt?api_key=de0f3965167a84e25fb5573409f071e7406619ef",
"https://cartobase-c.global.ssl.fastly.net/omtvector/{z}/{x}/{y}.vt?api_key=de0f3965167a84e25fb5573409f071e7406619ef",
"https://cartobase-d.global.ssl.fastly.net/omtvector/{z}/{x}/{y}.vt?api_key=de0f3965167a84e25fb5573409f071e7406619ef"],
"name": "CARTO Map Tiles",
"format": "pbf",
"basename": "v3.5.mbtiles",
"id": "openmaptiles",
"attribution": "<a href=\"http://www.carto.com/\" target=\"_blank\">&copy; CARTO</a> <a href=\"http://www.openstreetmap.org/about/\" target=\"_blank\">&copy; OpenStreetMap contributors</a>",
"center": [-12.2168, 28.6135, 4],
"description": "A tileset showcasing all layers in OpenStreetMap. http://carto.com",
"maxzoom": 14,
"minzoom": 0,
"vector_layers": [{
"maxzoom": 14,
"fields": {
"class": "String"
},
"minzoom": 0,
"id": "water",
"description": ""
}, {
"maxzoom": 14,
"fields": {
"name_en": "String",
"name": "String",
"name_de": "String",
"class": "String"
},
"minzoom": 0,
"id": "waterway",
"description": ""
}, {
"maxzoom": 14,
"fields": {
"class": "String",
"subclass": "String"
},
"minzoom": 0,
"id": "landcover",
"description": ""
}, {
"maxzoom": 14,
"fields": {
"class": "String"
},
"minzoom": 0,
"id": "landuse",
"description": ""
}, {
"maxzoom": 14,
"fields": {
"name": "String",
"osm_id": "Number",
"rank": "Number",
"ele": "Number",
"name_de": "String",
"ele_ft": "Number",
"name_en": "String"
},
"minzoom": 0,
"id": "mountain_peak",
"description": ""
}, {
"maxzoom": 14,
"fields": {
"class": "String"
},
"minzoom": 0,
"id": "park",
"description": ""
}, {
"maxzoom": 14,
"fields": {
"admin_level": "Number",
"disputed": "Number",
"maritime": "Number"
},
"minzoom": 0,
"id": "boundary",
"description": ""
}, {
"maxzoom": 14,
"fields": {
"class": "String"
},
"minzoom": 0,
"id": "aeroway",
"description": ""
}, {
"maxzoom": 14,
"fields": {
"brunnel": "String",
"ramp": "Number",
"class": "String",
"service": "String",
"oneway": "Number"
},
"minzoom": 0,
"id": "transportation",
"description": ""
}, {
"maxzoom": 14,
"fields": {
"render_min_height": "Number",
"render_height": "Number"
},
"minzoom": 0,
"id": "building",
"description": ""
}, {
"maxzoom": 14,
"fields": {
"name_en": "String",
"name": "String",
"name_de": "String",
"class": "String"
},
"minzoom": 0,
"id": "water_name",
"description": ""
}, {
"maxzoom": 14,
"fields": {
"name": "String",
"ref_length": "Number",
"name_de": "String",
"name_en": "String",
"ref": "String",
"class": "String",
"network": "String"
},
"minzoom": 0,
"id": "transportation_name",
"description": ""
}, {
"maxzoom": 14,
"fields": {
"name": "String",
"rank": "Number",
"name_de": "String",
"capital": "Number",
"name_en": "String",
"class": "String"
},
"minzoom": 0,
"id": "place",
"description": ""
}, {
"maxzoom": 14,
"fields": {
"housenumber": "String"
},
"minzoom": 0,
"id": "housenumber",
"description": ""
}, {
"maxzoom": 14,
"fields": {
"name": "String",
"rank": "Number",
"name_de": "String",
"subclass": "String",
"name_en": "String",
"class": "String"
},
"minzoom": 0,
"id": "poi",
"description": ""
}],
"version": "3.5",
"bounds": [-180, -85.0511, 180, 85.0511],
"maskLevel": "8",
"planettime": "1496620800000",
"tilejson": "2.0.0"
}
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Example using CARTO basemap server and CARTO vectors</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.mapbox.com/mapbox-gl-js/v0.37.0/mapbox-gl.js'></script>
<link href='https://api.mapbox.com/mapbox-gl-js/v0.37.0/mapbox-gl.css' rel='stylesheet' />
<script src="https://cdnjs.cloudflare.com/ajax/libs/nanoajax/0.4.3/nanoajax.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>
var map = new mapboxgl.Map({
container: 'map',
style: 'positron_carto.json',
center: [-75.1204443,42.219849],
zoom: 7
});
map.on('style.load', function () {
// Calling CARTO Maps API to get two vector layers
//The order under what the layers are defined determines
//the name of the source-layer on the vector tiles.
//First layer is named layer0, then layer1, etc..
var username = "jatorre";
var mapConfig =
{"version":"1.3.0",
"stat_tag":"API",
"layers":[
{"type":"cartodb",
"options":{
"sql":"select cartodb_id,the_geom_webmercator from ny_final",
"cartocss":"#l{}",
"cartocss_version":"2.1.0"
}
}
,{"type":"cartodb",
"options":{
"sql":"select cartodb_id,the_geom_webmercator from table_400k",
"cartocss":"#l{}",
"cartocss_version":"2.1.0"
}
}
]
};
var encodedConfig = encodeURIComponent(JSON.stringify(mapConfig))
nanoajax.ajax({
url:'https://'+username+'.carto.com/api/v1/map?config='+encodedConfig},
function (code, resp){
cartoLayer = JSON.parse(resp);
//Create a MapboxGL CARTO source
var baseCartoURL = "https://cartocdn-ashbu_{s}.global.ssl.fastly.net/";
var cartoSource = {
type: 'vector',
tiles: [baseCartoURL.replace("{s}","a")+username+'/api/v1/map/'+cartoLayer.layergroupid+'/{z}/{x}/{y}.mvt',baseCartoURL.replace("{s}","b")+username+'/api/v1/map/'+cartoLayer.layergroupid+'/{z}/{x}/{y}.mvt',baseCartoURL.replace("{s}","c")+username+'/api/v1/map/'+cartoLayer.layergroupid+'/{z}/{x}/{y}.mvt',baseCartoURL.replace("{s}","d")+username+'/api/v1/map/'+cartoLayer.layergroupid+'/{z}/{x}/{y}.mvt'],
minzoom: 0,
maxzoom: 18
};
map.addSource('cartoSource', cartoSource);
//Add the first layer to the map POLYGONS
map.addLayer({
'id': 'cartoPolygonLayer',
'type': 'fill',
'source': 'cartoSource',
'source-layer': 'layer0',
'layout': {
'visibility': 'visible'
},
"paint": {
"fill-opacity": 0.5,
"fill-color": "rgba(177, 29, 168, 1)",
"fill-outline-color": "rgba(41, 39, 39, 1)"
}
});
//Add the second layer to the map POINTS
map.addLayer({
'id': 'cartoPointLayer',
'type': 'circle',
'source': 'cartoSource',
'source-layer': 'layer1',
'layout': {
'visibility': 'visible'
},
"paint": {
"circle-stroke-color": "rgba(232, 28, 28, 1)",
"circle-color": "rgba(236, 14, 14, 0.33)",
"circle-radius": 5,
"circle-stroke-width": 1,
"circle-pitch-scale": "map",
"circle-blur": 0
}
});
}
);
});
</script>
</body>
</html>
{
"version": 8,
"name": "Positron",
"center": [
10.184401828277089,
-1.1368683772161603e-13
],
"zoom": 11.6,
"bearing": 0,
"pitch": 0,
"sources": {
"carto": {
"type": "vector",
"url": "carto-basemap.json"
}
},
"sprite": "https://dl.dropboxusercontent.com/u/580074/vector_basemaps/sprite",
"glyphs": "https://free.tilehosting.com/fonts/{fontstack}/{range}.pbf?key=RiS4gsgZPZqeeMlIyxFo",
"layers": [
{
"id": "background",
"type": "background",
"paint": {
"background-color": "rgb(242,243,240)"
}
},
{
"id": "park",
"type": "fill",
"source": "carto",
"source-layer": "park",
"filter": [
"==",
"$type",
"Polygon"
],
"layout": {
"visibility": "visible"
},
"paint": {
"fill-color": "rgb(230, 233, 229)"
}
},
{
"id": "water",
"type": "fill",
"source": "carto",
"source-layer": "water",
"filter": [
"==",
"$type",
"Polygon"
],
"layout": {
"visibility": "visible"
},
"paint": {
"fill-color": "rgb(194, 200, 202)",
"fill-antialias": true,
"fill-outline-color": {
"base": 1,
"stops": [
[
0,
"hsla(180, 6%, 63%, 0.82)"
],
[
22,
"hsla(180, 6%, 63%, 0.18)"
]
]
}
}
},
{
"id": "landcover_ice_shelf",
"type": "fill",
"source": "carto",
"source-layer": "landcover",
"maxzoom": 8,
"filter": [
"all",
[
"==",
"$type",
"Polygon"
],
[
"==",
"subclass",
"ice_shelf"
]
],
"layout": {
"visibility": "visible"
},
"paint": {
"fill-color": "hsl(0, 0%, 98%)",
"fill-opacity": 0.7
}
},
{
"id": "landcover_glacier",
"type": "fill",
"source": "carto",
"source-layer": "landcover",
"maxzoom": 8,
"filter": [
"all",
[
"==",
"$type",
"Polygon"
],
[
"==",
"subclass",
"glacier"
]
],
"layout": {
"visibility": "visible"
},
"paint": {
"fill-color": "hsl(0, 0%, 98%)",
"fill-opacity": {
"base": 1,
"stops": [
[
0,
1
],
[
8,
0.5
]
]
}
}
},
{
"id": "landuse_residential",
"type": "fill",
"source": "carto",
"source-layer": "landuse",
"maxzoom": 16,
"filter": [
"all",
[
"==",
"$type",
"Polygon"
],
[
"==",
"class",
"residential"
]
],
"layout": {
"visibility": "visible"
},
"paint": {
"fill-color": "rgb(234, 234, 230)",
"fill-opacity": {
"base": 0.6,
"stops": [
[
8,
0.8
],
[
9,
0.6
]
]
}
}
},
{
"id": "landcover_wood",
"type": "fill",
"source": "carto",
"source-layer": "landcover",
"minzoom": 10,
"filter": [
"all",
[
"==",
"$type",
"Polygon"
],
[
"==",
"class",
"wood"
]
],
"layout": {
"visibility": "visible"
},
"paint": {
"fill-color": "rgb(220,224,220)",
"fill-opacity": {
"base": 1,
"stops": [
[
8,
0
],
[
12,
1
]
]
}
}
},
{
"id": "waterway",
"type": "line",
"source": "carto",
"source-layer": "waterway",
"filter": [
"==",
"$type",
"LineString"
],
"layout": {
"visibility": "visible"
},
"paint": {
"line-color": "hsl(195, 17%, 78%)"
}
},
{
"id": "water_name",
"type": "symbol",
"source": "carto",
"source-layer": "water_name",
"filter": [
"==",
"$type",
"LineString"
],
"layout": {
"text-field": "{name}",
"symbol-placement": "line",
"text-rotation-alignment": "map",
"symbol-spacing": 500,
"text-font": [
"Metropolis Medium Italic",
"Klokantech Noto Sans Italic",
"Klokantech Noto Sans CJK Regular"
],
"text-size": 12
},
"paint": {
"text-color": "rgb(157,169,177)",
"text-halo-color": "rgb(242,243,240)",
"text-halo-width": 1,
"text-halo-blur": 1
}
},
{
"id": "building",
"type": "fill",
"source": "carto",
"source-layer": "building",
"minzoom": 12,
"filter": [
"==",
"$type",
"Polygon"
],
"paint": {
"fill-color": "rgb(234, 234, 229)",
"fill-outline-color": "rgb(219, 219, 218)",
"fill-antialias": true
}
},
{
"id": "tunnel_motorway_casing",
"type": "line",
"metadata": {
"mapbox:group": "b6371a3f2f5a9932464fa3867530a2e5"
},
"source": "carto",
"source-layer": "transportation",
"minzoom": 6,
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"all",
[
"==",
"brunnel",
"tunnel"
],
[
"==",
"class",
"motorway"
]
]
],
"layout": {
"line-cap": "butt",
"line-join": "miter",
"visibility": "visible"
},
"paint": {
"line-color": "rgb(213, 213, 213)",
"line-width": {
"base": 1.4,
"stops": [
[
5.8,
0
],
[
6,
3
],
[
20,
40
]
]
},
"line-opacity": 1
}
},
{
"id": "tunnel_motorway_inner",
"type": "line",
"metadata": {
"mapbox:group": "b6371a3f2f5a9932464fa3867530a2e5"
},
"source": "carto",
"source-layer": "transportation",
"minzoom": 6,
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"all",
[
"==",
"brunnel",
"tunnel"
],
[
"==",
"class",
"motorway"
]
]
],
"layout": {
"line-cap": "round",
"line-join": "round",
"visibility": "visible"
},
"paint": {
"line-color": "rgb(234,234,234)",
"line-width": {
"base": 1.4,
"stops": [
[
4,
2
],
[
6,
1.3
],
[
20,
30
]
]
}
}
},
{
"id": "aeroway-taxiway",
"type": "line",
"metadata": {
"mapbox:group": "1444849345966.4436"
},
"source": "carto",
"source-layer": "aeroway",
"minzoom": 12,
"filter": [
"all",
[
"in",
"class",
"taxiway"
]
],
"layout": {
"line-cap": "round",
"line-join": "round",
"visibility": "visible"
},
"paint": {
"line-color": "hsl(0, 0%, 88%)",
"line-width": {
"base": 1.55,
"stops": [
[
13,
1.8
],
[
20,
20
]
]
},
"line-opacity": 1
}
},
{
"id": "aeroway-runway-casing",
"type": "line",
"metadata": {
"mapbox:group": "1444849345966.4436"
},
"source": "carto",
"source-layer": "aeroway",
"minzoom": 11,
"filter": [
"all",
[
"in",
"class",
"runway"
]
],
"layout": {
"line-cap": "round",
"line-join": "round",
"visibility": "visible"
},
"paint": {
"line-color": "hsl(0, 0%, 88%)",
"line-width": {
"base": 1.5,
"stops": [
[
11,
6
],
[
17,
55
]
]
},
"line-opacity": 1
}
},
{
"id": "aeroway-area",
"type": "fill",
"metadata": {
"mapbox:group": "1444849345966.4436"
},
"source": "carto",
"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-runway",
"type": "line",
"metadata": {
"mapbox:group": "1444849345966.4436"
},
"source": "carto",
"source-layer": "aeroway",
"minzoom": 11,
"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
},
"maxzoom": 24
},
{
"id": "highway_path",
"type": "line",
"metadata": {
"mapbox:group": "b6371a3f2f5a9932464fa3867530a2e5"
},
"source": "carto",
"source-layer": "transportation",
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"==",
"class",
"path"
]
],
"layout": {
"line-cap": "round",
"line-join": "round",
"visibility": "visible"
},
"paint": {
"line-color": "rgb(234, 234, 234)",
"line-width": {
"base": 1.2,
"stops": [
[
13,
1
],
[
20,
10
]
]
},
"line-opacity": 0.9
}
},
{
"id": "highway_minor",
"type": "line",
"metadata": {
"mapbox:group": "b6371a3f2f5a9932464fa3867530a2e5"
},
"source": "carto",
"source-layer": "transportation",
"minzoom": 8,
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"in",
"class",
"minor",
"service",
"track"
]
],
"layout": {
"line-cap": "round",
"line-join": "round",
"visibility": "visible"
},
"paint": {
"line-color": "hsl(0, 0%, 88%)",
"line-width": {
"base": 1.55,
"stops": [
[
13,
1.8
],
[
20,
20
]
]
},
"line-opacity": 0.9
}
},
{
"id": "highway_major_casing",
"type": "line",
"metadata": {
"mapbox:group": "b6371a3f2f5a9932464fa3867530a2e5"
},
"source": "carto",
"source-layer": "transportation",
"minzoom": 11,
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"in",
"class",
"primary",
"secondary",
"tertiary",
"trunk"
]
],
"layout": {
"line-cap": "butt",
"line-join": "miter",
"visibility": "visible"
},
"paint": {
"line-color": "rgb(213, 213, 213)",
"line-dasharray": [
12,
0
],
"line-width": {
"base": 1.3,
"stops": [
[
10,
3
],
[
20,
23
]
]
}
}
},
{
"id": "highway_major_inner",
"type": "line",
"metadata": {
"mapbox:group": "b6371a3f2f5a9932464fa3867530a2e5"
},
"source": "carto",
"source-layer": "transportation",
"minzoom": 11,
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"in",
"class",
"primary",
"secondary",
"tertiary",
"trunk"
]
],
"layout": {
"line-cap": "round",
"line-join": "round",
"visibility": "visible"
},
"paint": {
"line-color": "#fff",
"line-width": {
"base": 1.3,
"stops": [
[
10,
2
],
[
20,
20
]
]
}
}
},
{
"id": "highway_major_subtle",
"type": "line",
"metadata": {
"mapbox:group": "b6371a3f2f5a9932464fa3867530a2e5"
},
"source": "carto",
"source-layer": "transportation",
"maxzoom": 11,
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"in",
"class",
"primary",
"secondary",
"tertiary",
"trunk"
]
],
"layout": {
"line-cap": "round",
"line-join": "round",
"visibility": "visible"
},
"paint": {
"line-color": "hsla(0, 0%, 85%, 0.69)",
"line-width": 2
}
},
{
"id": "highway_motorway_casing",
"type": "line",
"metadata": {
"mapbox:group": "b6371a3f2f5a9932464fa3867530a2e5"
},
"source": "carto",
"source-layer": "transportation",
"minzoom": 6,
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"all",
[
"!in",
"brunnel",
"bridge",
"tunnel"
],
[
"==",
"class",
"motorway"
]
]
],
"layout": {
"line-cap": "butt",
"line-join": "miter",
"visibility": "visible"
},
"paint": {
"line-color": "rgb(213, 213, 213)",
"line-width": {
"base": 1.4,
"stops": [
[
5.8,
0
],
[
6,
3
],
[
20,
40
]
]
},
"line-dasharray": [
2,
0
],
"line-opacity": 1
}
},
{
"id": "highway_motorway_inner",
"type": "line",
"metadata": {
"mapbox:group": "b6371a3f2f5a9932464fa3867530a2e5"
},
"source": "carto",
"source-layer": "transportation",
"minzoom": 6,
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"all",
[
"!in",
"brunnel",
"bridge",
"tunnel"
],
[
"==",
"class",
"motorway"
]
]
],
"layout": {
"line-cap": "round",
"line-join": "round",
"visibility": "visible"
},
"paint": {
"line-color": {
"base": 1,
"stops": [
[
5.8,
"hsla(0, 0%, 85%, 0.53)"
],
[
6,
"#fff"
]
]
},
"line-width": {
"base": 1.4,
"stops": [
[
4,
2
],
[
6,
1.3
],
[
20,
30
]
]
}
}
},
{
"id": "highway_motorway_subtle",
"type": "line",
"metadata": {
"mapbox:group": "b6371a3f2f5a9932464fa3867530a2e5"
},
"source": "carto",
"source-layer": "transportation",
"maxzoom": 6,
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"==",
"class",
"motorway"
]
],
"layout": {
"line-cap": "round",
"line-join": "round",
"visibility": "visible"
},
"paint": {
"line-color": "hsla(0, 0%, 85%, 0.53)",
"line-width": {
"base": 1.4,
"stops": [
[
4,
2
],
[
6,
1.3
]
]
}
}
},
{
"id": "railway_service",
"type": "line",
"metadata": {
"mapbox:group": "b6371a3f2f5a9932464fa3867530a2e5"
},
"source": "carto",
"source-layer": "transportation",
"minzoom": 16,
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"all",
[
"==",
"class",
"rail"
],
[
"has",
"service"
]
]
],
"layout": {
"visibility": "visible",
"line-join": "round"
},
"paint": {
"line-color": "#dddddd",
"line-width": 3
}
},
{
"id": "railway_service_dashline",
"type": "line",
"metadata": {
"mapbox:group": "b6371a3f2f5a9932464fa3867530a2e5"
},
"source": "carto",
"source-layer": "transportation",
"minzoom": 16,
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"==",
"class",
"rail"
],
[
"has",
"service"
]
],
"layout": {
"visibility": "visible",
"line-join": "round"
},
"paint": {
"line-color": "#fafafa",
"line-width": 2,
"line-dasharray": [
3,
3
]
}
},
{
"id": "railway",
"type": "line",
"metadata": {
"mapbox:group": "b6371a3f2f5a9932464fa3867530a2e5"
},
"source": "carto",
"source-layer": "transportation",
"minzoom": 13,
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"all",
[
"!has",
"service"
],
[
"==",
"class",
"rail"
]
]
],
"layout": {
"visibility": "visible",
"line-join": "round"
},
"paint": {
"line-color": "#dddddd",
"line-width": {
"base": 1.3,
"stops": [
[
16,
3
],
[
20,
7
]
]
}
}
},
{
"id": "railway_dashline",
"metadata": {
"mapbox:group": "b6371a3f2f5a9932464fa3867530a2e5"
},
"paint": {
"line-color": "#fafafa",
"line-width": {
"base": 1.3,
"stops": [
[
16,
2
],
[
20,
6
]
]
},
"line-dasharray": [
3,
3
]
},
"type": "line",
"source": "carto",
"source-layer": "transportation",
"minzoom": 13,
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"all",
[
"!has",
"service"
],
[
"==",
"class",
"rail"
]
]
],
"layout": {
"visibility": "visible",
"line-join": "round"
}
},
{
"id": "highway_motorway_bridge_casing",
"type": "line",
"metadata": {
"mapbox:group": "b6371a3f2f5a9932464fa3867530a2e5"
},
"source": "carto",
"source-layer": "transportation",
"minzoom": 6,
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"all",
[
"==",
"brunnel",
"bridge"
],
[
"==",
"class",
"motorway"
]
]
],
"layout": {
"line-cap": "butt",
"line-join": "miter",
"visibility": "visible"
},
"paint": {
"line-color": "rgb(213, 213, 213)",
"line-width": {
"base": 1.4,
"stops": [
[
5.8,
0
],
[
6,
5
],
[
20,
45
]
]
},
"line-dasharray": [
2,
0
],
"line-opacity": 1
}
},
{
"id": "highway_motorway_bridge_inner",
"type": "line",
"metadata": {
"mapbox:group": "b6371a3f2f5a9932464fa3867530a2e5"
},
"source": "carto",
"source-layer": "transportation",
"minzoom": 6,
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"all",
[
"==",
"brunnel",
"bridge"
],
[
"==",
"class",
"motorway"
]
]
],
"layout": {
"line-cap": "round",
"line-join": "round",
"visibility": "visible"
},
"paint": {
"line-color": {
"base": 1,
"stops": [
[
5.8,
"hsla(0, 0%, 85%, 0.53)"
],
[
6,
"#fff"
]
]
},
"line-width": {
"base": 1.4,
"stops": [
[
4,
2
],
[
6,
1.3
],
[
20,
30
]
]
}
}
},
{
"id": "highway_name_other",
"type": "symbol",
"metadata": {
"mapbox:group": "b6371a3f2f5a9932464fa3867530a2e5"
},
"source": "carto",
"source-layer": "transportation_name",
"filter": [
"all",
[
"!=",
"class",
"motorway"
],
[
"==",
"$type",
"LineString"
]
],
"layout": {
"text-size": 10,
"text-max-angle": 30,
"text-transform": "uppercase",
"symbol-spacing": 350,
"text-font": [
"Metropolis Regular",
"Klokantech Noto Sans Regular",
"Klokantech Noto Sans CJK Regular"
],
"symbol-placement": "line",
"visibility": "visible",
"text-rotation-alignment": "map",
"text-pitch-alignment": "viewport",
"text-field": "{name}"
},
"paint": {
"text-color": "#bbb",
"text-halo-color": "#fff",
"text-translate": [
0,
0
],
"text-halo-width": 2,
"text-halo-blur": 1
}
},
{
"id": "highway_name_motorway",
"type": "symbol",
"metadata": {
"mapbox:group": "b6371a3f2f5a9932464fa3867530a2e5"
},
"source": "carto",
"source-layer": "transportation_name",
"filter": [
"all",
[
"==",
"$type",
"LineString"
],
[
"==",
"class",
"motorway"
]
],
"layout": {
"text-size": 10,
"symbol-spacing": 350,
"text-font": [
"Metropolis Light",
"Klokantech Noto Sans Regular",
"Klokantech Noto Sans CJK Regular"
],
"symbol-placement": "line",
"visibility": "visible",
"text-rotation-alignment": "viewport",
"text-pitch-alignment": "viewport",
"text-field": "{ref}"
},
"paint": {
"text-color": "rgb(117, 129, 145)",
"text-halo-color": "hsl(0, 0%, 100%)",
"text-translate": [
0,
2
],
"text-halo-width": 1,
"text-halo-blur": 1
}
},
{
"id": "boundary_state",
"type": "line",
"metadata": {
"mapbox:group": "a14c9607bc7954ba1df7205bf660433f"
},
"source": "carto",
"source-layer": "boundary",
"filter": [
"==",
"admin_level",
4
],
"layout": {
"line-cap": "round",
"line-join": "round",
"visibility": "visible"
},
"paint": {
"line-color": "rgb(230, 204, 207)",
"line-width": {
"base": 1.3,
"stops": [
[
3,
1
],
[
22,
15
]
]
},
"line-blur": 0.4,
"line-dasharray": [
2,
2
],
"line-opacity": 1
}
},
{
"id": "boundary_country",
"type": "line",
"metadata": {
"mapbox:group": "a14c9607bc7954ba1df7205bf660433f"
},
"source": "carto",
"source-layer": "boundary",
"filter": [
"==",
"admin_level",
2
],
"layout": {
"line-cap": "round",
"line-join": "round"
},
"paint": {
"line-color": "rgb(230, 204, 207)",
"line-width": {
"base": 1.1,
"stops": [
[
3,
1
],
[
22,
20
]
]
},
"line-blur": {
"base": 1,
"stops": [
[
0,
0.4
],
[
22,
4
]
]
},
"line-opacity": 1
}
},
{
"id": "place_other",
"type": "symbol",
"metadata": {
"mapbox:group": "101da9f13b64a08fa4b6ac1168e89e5f"
},
"source": "carto",
"source-layer": "place",
"maxzoom": 14,
"filter": [
"all",
[
"!in",
"class",
"city",
"suburb",
"town",
"village"
],
[
"==",
"$type",
"Point"
]
],
"layout": {
"text-size": 10,
"text-transform": "uppercase",
"text-font": [
"Metropolis Regular",
"Klokantech Noto Sans Regular",
"Klokantech Noto Sans CJK Regular"
],
"text-justify": "center",
"visibility": "visible",
"text-offset": [
0.5,
0
],
"text-anchor": "center",
"text-field": "{name_en}"
},
"paint": {
"text-color": "rgb(117, 129, 145)",
"text-halo-color": "rgb(242,243,240)",
"text-halo-width": 1,
"text-halo-blur": 1
}
},
{
"id": "place_suburb",
"type": "symbol",
"metadata": {
"mapbox:group": "101da9f13b64a08fa4b6ac1168e89e5f"
},
"source": "carto",
"source-layer": "place",
"maxzoom": 15,
"filter": [
"all",
[
"==",
"$type",
"Point"
],
[
"==",
"class",
"suburb"
]
],
"layout": {
"text-size": 10,
"text-transform": "uppercase",
"text-font": [
"Metropolis Regular",
"Klokantech Noto Sans Regular",
"Klokantech Noto Sans CJK Regular"
],
"text-justify": "center",
"visibility": "visible",
"text-offset": [
0.5,
0
],
"text-anchor": "center",
"text-field": "{name_en}"
},
"paint": {
"text-color": "rgb(117, 129, 145)",
"text-halo-color": "rgb(242,243,240)",
"text-halo-width": 1,
"text-halo-blur": 1
}
},
{
"id": "place_village",
"type": "symbol",
"metadata": {
"mapbox:group": "101da9f13b64a08fa4b6ac1168e89e5f"
},
"source": "carto",
"source-layer": "place",
"maxzoom": 14,
"filter": [
"all",
[
"==",
"$type",
"Point"
],
[
"==",
"class",
"village"
]
],
"layout": {
"text-size": 10,
"text-transform": "uppercase",
"text-font": [
"Metropolis Regular",
"Klokantech Noto Sans Regular",
"Klokantech Noto Sans CJK Regular"
],
"text-justify": "left",
"visibility": "visible",
"text-offset": [
0.5,
0.2
],
"icon-size": 0.4,
"text-anchor": "left",
"text-field": "{name_en}"
},
"paint": {
"text-color": "rgb(117, 129, 145)",
"text-halo-color": "rgb(242,243,240)",
"text-halo-width": 1,
"text-halo-blur": 1,
"icon-opacity": 0.7
}
},
{
"id": "place_town",
"type": "symbol",
"metadata": {
"mapbox:group": "101da9f13b64a08fa4b6ac1168e89e5f"
},
"source": "carto",
"source-layer": "place",
"maxzoom": 15,
"filter": [
"all",
[
"==",
"$type",
"Point"
],
[
"==",
"class",
"town"
]
],
"layout": {
"text-size": 10,
"icon-image": {
"base": 1,
"stops": [
[
0,
"circle-11"
],
[
8,
""
]
]
},
"text-transform": "uppercase",
"text-font": [
"Metropolis Regular",
"Klokantech Noto Sans Regular",
"Klokantech Noto Sans CJK Regular"
],
"text-justify": "left",
"visibility": "visible",
"text-offset": [
0.5,
0.2
],
"icon-size": 0.4,
"text-anchor": {
"base": 1,
"stops": [
[
0,
"left"
],
[
8,
"center"
]
]
},
"text-field": "{name_en}"
},
"paint": {
"text-color": "rgb(117, 129, 145)",
"text-halo-color": "rgb(242,243,240)",
"text-halo-width": 1,
"text-halo-blur": 1,
"icon-opacity": 0.7
}
},
{
"id": "place_city",
"type": "symbol",
"metadata": {
"mapbox:group": "101da9f13b64a08fa4b6ac1168e89e5f"
},
"source": "carto",
"source-layer": "place",
"maxzoom": 14,
"filter": [
"all",
[
"==",
"$type",
"Point"
],
[
"all",
[
"!=",
"capital",
2
],
[
"==",
"class",
"city"
],
[
">",
"rank",
3
]
]
],
"layout": {
"text-size": 10,
"icon-image": {
"base": 1,
"stops": [
[
0,
"circle-11"
],
[
8,
""
]
]
},
"text-transform": "uppercase",
"text-font": [
"Metropolis Regular",
"Klokantech Noto Sans Regular",
"Klokantech Noto Sans CJK Regular"
],
"text-justify": "left",
"visibility": "visible",
"text-offset": [
0.5,
0.2
],
"icon-size": 0.4,
"text-anchor": {
"base": 1,
"stops": [
[
0,
"left"
],
[
8,
"center"
]
]
},
"text-field": "{name_en}"
},
"paint": {
"text-color": "rgb(117, 129, 145)",
"text-halo-color": "rgb(242,243,240)",
"text-halo-width": 1,
"text-halo-blur": 1,
"icon-opacity": 0.7
}
},
{
"id": "place_capital",
"type": "symbol",
"metadata": {
"mapbox:group": "101da9f13b64a08fa4b6ac1168e89e5f"
},
"source": "carto",
"source-layer": "place",
"maxzoom": 12,
"filter": [
"all",
[
"==",
"$type",
"Point"
],
[
"all",
[
"==",
"capital",
2
],
[
"==",
"class",
"city"
]
]
],
"layout": {
"text-size": 14,
"icon-image": {
"base": 1,
"stops": [
[
0,
"star-11"
],
[
8,
""
]
]
},
"text-transform": "uppercase",
"text-font": [
"Metropolis Regular",
"Klokantech Noto Sans Regular",
"Klokantech Noto Sans CJK Regular"
],
"text-justify": "left",
"visibility": "visible",
"text-offset": [
0.5,
0.2
],
"icon-size": 1,
"text-anchor": {
"base": 1,
"stops": [
[
0,
"left"
],
[
8,
"center"
]
]
},
"text-field": "{name}"
},
"paint": {
"text-color": "rgb(117, 129, 145)",
"text-halo-color": "rgb(242,243,240)",
"text-halo-width": 1,
"text-halo-blur": 1,
"icon-opacity": 0.7
}
},
{
"id": "place_city_large",
"type": "symbol",
"metadata": {
"mapbox:group": "101da9f13b64a08fa4b6ac1168e89e5f"
},
"source": "carto",
"source-layer": "place",
"maxzoom": 12,
"filter": [
"all",
[
"==",
"$type",
"Point"
],
[
"all",
[
"!=",
"capital",
2
],
[
"<=",
"rank",
3
],
[
"==",
"class",
"city"
]
]
],
"layout": {
"text-size": 14,
"icon-image": {
"base": 1,
"stops": [
[
0,
"circle-11"
],
[
8,
""
]
]
},
"text-transform": "uppercase",
"text-font": [
"Metropolis Regular",
"Klokantech Noto Sans Regular",
"Klokantech Noto Sans CJK Regular"
],
"text-justify": "left",
"visibility": "visible",
"text-offset": [
0.5,
0.2
],
"icon-size": 0.4,
"text-anchor": {
"base": 1,
"stops": [
[
0,
"left"
],
[
8,
"center"
]
]
},
"text-field": "{name}"
},
"paint": {
"text-color": "rgb(117, 129, 145)",
"text-halo-color": "rgb(242,243,240)",
"text-halo-width": 1,
"text-halo-blur": 1,
"icon-opacity": 0.7
}
},
{
"id": "place_state",
"type": "symbol",
"metadata": {
"mapbox:group": "101da9f13b64a08fa4b6ac1168e89e5f"
},
"source": "carto",
"source-layer": "place",
"maxzoom": 12,
"filter": [
"all",
[
"==",
"$type",
"Point"
],
[
"==",
"class",
"state"
]
],
"layout": {
"visibility": "visible",
"text-field": "{name_en}",
"text-font": [
"Metropolis Regular",
"Klokantech Noto Sans Regular",
"Klokantech Noto Sans CJK Regular"
],
"text-transform": "uppercase",
"text-size": 10
},
"paint": {
"text-color": "rgb(113, 129, 144)",
"text-halo-color": "rgb(242,243,240)",
"text-halo-width": 1,
"text-halo-blur": 1
}
},
{
"id": "place_country_other",
"type": "symbol",
"metadata": {
"mapbox:group": "101da9f13b64a08fa4b6ac1168e89e5f"
},
"source": "carto",
"source-layer": "place",
"maxzoom": 8,
"filter": [
"all",
[
"==",
"$type",
"Point"
],
[
"all",
[
"==",
"class",
"country"
],
[
">=",
"rank",
2
]
]
],
"layout": {
"visibility": "visible",
"text-field": "{name_en}",
"text-font": [
"Metropolis Regular",
"Klokantech Noto Sans Regular",
"Klokantech Noto Sans CJK Regular"
],
"text-transform": "uppercase",
"text-size": {
"base": 1,
"stops": [
[
0,
10
],
[
6,
12
]
]
}
},
"paint": {
"text-halo-width": 1.4,
"text-halo-color": "rgba(236,236,234,0.7)",
"text-color": {
"base": 1,
"stops": [
[
3,
"rgb(157,169,177)"
],
[
4,
"rgb(153, 153, 153)"
]
]
}
}
},
{
"id": "place_country_major",
"type": "symbol",
"metadata": {
"mapbox:group": "101da9f13b64a08fa4b6ac1168e89e5f"
},
"source": "carto",
"source-layer": "place",
"maxzoom": 6,
"filter": [
"all",
[
"==",
"$type",
"Point"
],
[
"all",
[
"<=",
"rank",
1
],
[
"==",
"class",
"country"
]
]
],
"layout": {
"visibility": "visible",
"text-field": "{name_en}",
"text-font": [
"Metropolis Regular",
"Klokantech Noto Sans Regular",
"Klokantech Noto Sans CJK Regular"
],
"text-transform": "uppercase",
"text-size": {
"base": 1.4,
"stops": [
[
0,
10
],
[
3,
12
],
[
4,
14
]
]
},
"text-anchor": "center"
},
"paint": {
"text-halo-width": 1.4,
"text-halo-color": "rgba(236,236,234,0.7)",
"text-color": {
"base": 1,
"stops": [
[
3,
"rgb(157,169,177)"
],
[
4,
"rgb(153, 153, 153)"
]
]
}
}
}
],
"id": "ciwf3o3u2008z2pmq7pmvm6xq"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment