Merge branch 'master' into fuzz-pipe
This commit is contained in:
300
bin/style.json
300
bin/style.json
@@ -190,9 +190,7 @@
|
||||
},
|
||||
"layers": [{
|
||||
"id": "background",
|
||||
"render": {
|
||||
"type": "background"
|
||||
},
|
||||
"type": "background",
|
||||
"style": {
|
||||
"background-color": "@land"
|
||||
},
|
||||
@@ -204,9 +202,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "landcover",
|
||||
"filter": { "class": "snow" },
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"style": {
|
||||
"fill-color": "@snow"
|
||||
},
|
||||
@@ -218,9 +214,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "landcover",
|
||||
"filter": { "class": "crop" },
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"style": {
|
||||
"fill-color": "@crop"
|
||||
},
|
||||
@@ -232,9 +226,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "landcover",
|
||||
"filter": { "class": "grass" },
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"style": {
|
||||
"fill-color": "@grass",
|
||||
"fill-opacity": {
|
||||
@@ -254,9 +246,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "landcover",
|
||||
"filter": { "class": "scrub" },
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"style": {
|
||||
"fill-color": "@scrub",
|
||||
"fill-opacity": {
|
||||
@@ -276,9 +266,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "landcover",
|
||||
"filter": { "class": "wood" },
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"style": {
|
||||
"fill-color": "@wood",
|
||||
"fill-opacity": {
|
||||
@@ -298,9 +286,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "landuse",
|
||||
"filter": { "class": "wood" },
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"style": {
|
||||
"fill-color": "@wood"
|
||||
},
|
||||
@@ -313,9 +299,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "landuse",
|
||||
"filter": { "class": "school" },
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"style": {
|
||||
"fill-color": "@school"
|
||||
},
|
||||
@@ -327,9 +311,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "landuse",
|
||||
"filter": { "class": "sand" },
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"style": {
|
||||
"fill-color": "@sand"
|
||||
},
|
||||
@@ -342,9 +324,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "landuse",
|
||||
"filter": { "class": "pitch" },
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"style": {
|
||||
"fill-color": "rgba(255,255,255,0.5)",
|
||||
"fill-outline-color": "@pitch"
|
||||
@@ -358,9 +338,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "landuse",
|
||||
"filter": { "class": "park" },
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"style": {
|
||||
"fill-color": "@park"
|
||||
},
|
||||
@@ -372,9 +350,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "landuse",
|
||||
"filter": { "class": "industrial" },
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"style": {
|
||||
"fill-color": "rgba(246,250,255,0.5)"
|
||||
},
|
||||
@@ -386,9 +362,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "landuse",
|
||||
"filter": { "class": "scrub" },
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"style": {
|
||||
"fill-color": "@scrub"
|
||||
},
|
||||
@@ -401,9 +375,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "landuse",
|
||||
"filter": { "class": "grass" },
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"style": {
|
||||
"fill-color": "@grass"
|
||||
},
|
||||
@@ -416,9 +388,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "landuse",
|
||||
"filter": { "class": "crop" },
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"style": {
|
||||
"fill-color": "@crop"
|
||||
},
|
||||
@@ -431,9 +401,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "landuse",
|
||||
"filter": { "class": "rock" },
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"style": {
|
||||
"fill-color": "@rock"
|
||||
},
|
||||
@@ -446,9 +414,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "landuse",
|
||||
"filter": { "class": "snow" },
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"style": {
|
||||
"fill-color": "@snow"
|
||||
},
|
||||
@@ -461,9 +427,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "landuse",
|
||||
"filter": { "class": "hospital" },
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"style": {
|
||||
"fill-color": "@hospital"
|
||||
},
|
||||
@@ -475,9 +439,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "landuse",
|
||||
"filter": { "class": "cemetery" },
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"style": {
|
||||
"fill-color": "@cemetery"
|
||||
},
|
||||
@@ -489,9 +451,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "landuse_overlay",
|
||||
"filter": { "class": ["wetland", "wetland_noveg"] },
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"style": {
|
||||
"fill-color": "rgba(210,225,225,0.2)",
|
||||
"fill-image": "wetland_noveg_64"
|
||||
@@ -505,9 +465,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "landuse_overlay",
|
||||
"filter": { "class": ["breakwater", "pier"] },
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"style": {
|
||||
"fill-color": "@land"
|
||||
},
|
||||
@@ -519,8 +477,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "waterway",
|
||||
"filter": { "type": ["river", "canal"] },
|
||||
"type": "line",
|
||||
"render": {
|
||||
"type": "line",
|
||||
"line-cap": "round"
|
||||
},
|
||||
"style": {
|
||||
@@ -536,8 +494,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "waterway",
|
||||
"filter": { "type": "stream" },
|
||||
"type": "line",
|
||||
"render": {
|
||||
"type": "line",
|
||||
"line-cap": "round"
|
||||
},
|
||||
"style": {
|
||||
@@ -552,9 +510,7 @@
|
||||
"id": "building_shadow",
|
||||
"source": "mapbox",
|
||||
"source-layer": "building",
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"style": {
|
||||
"fill-color": "#d5d1c6",
|
||||
"fill-translate": [1, 1],
|
||||
@@ -606,9 +562,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "hillshade",
|
||||
"filter": { "class": "full_highlight" },
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"rasterize": "@hillshade_rasterize",
|
||||
"style": {
|
||||
"fill-color": "#fffff3",
|
||||
@@ -631,9 +585,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "hillshade",
|
||||
"filter": { "class": "medium_highlight" },
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"rasterize": "@hillshade_rasterize",
|
||||
"style": {
|
||||
"fill-color": "#ffd",
|
||||
@@ -656,9 +608,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "hillshade",
|
||||
"filter": { "class": "medium_shadow" },
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"rasterize": "@hillshade_rasterize",
|
||||
"style": {
|
||||
"fill-color": "#206",
|
||||
@@ -681,9 +631,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "hillshade",
|
||||
"filter": { "class": "full_shadow" },
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"rasterize": "@hillshade_rasterize",
|
||||
"style": {
|
||||
"fill-color": "#103",
|
||||
@@ -706,8 +654,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "contour",
|
||||
"filter": { "index": 5 },
|
||||
"type": "line",
|
||||
"render": {
|
||||
"type": "line",
|
||||
"line-join": "round"
|
||||
},
|
||||
"style": {
|
||||
@@ -730,8 +678,8 @@
|
||||
"id": "contour_line_regular",
|
||||
"source": "mapbox",
|
||||
"source-layer": "contour",
|
||||
"type": "line",
|
||||
"render": {
|
||||
"type": "line",
|
||||
"line-join": "round"
|
||||
},
|
||||
"style": {
|
||||
@@ -755,9 +703,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "barrier_line",
|
||||
"filter": { "class": "gate" },
|
||||
"render": {
|
||||
"type": "line"
|
||||
},
|
||||
"type": "line",
|
||||
"style": {
|
||||
"line-width": 2.5,
|
||||
"line-color": "#aab"
|
||||
@@ -771,9 +717,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "barrier_line",
|
||||
"filter": { "class": "fence" },
|
||||
"render": {
|
||||
"type": "line"
|
||||
},
|
||||
"type": "line",
|
||||
"style": {
|
||||
"line-color": "#aeada3",
|
||||
"line-width": "@fence_width"
|
||||
@@ -787,9 +731,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "barrier_line",
|
||||
"filter": { "class": "hedge" },
|
||||
"render": {
|
||||
"type": "line"
|
||||
},
|
||||
"type": "line",
|
||||
"style": {
|
||||
"line-color": "#8de99b",
|
||||
"line-width": "@hedge_width"
|
||||
@@ -803,9 +745,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "barrier_line",
|
||||
"filter": { "class": "land" },
|
||||
"render": {
|
||||
"type": "line"
|
||||
},
|
||||
"type": "line",
|
||||
"style": {
|
||||
"line-color": "@land",
|
||||
"line-width": "@barrier_line_land_width"
|
||||
@@ -819,9 +759,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "barrier_line",
|
||||
"filter": { "class": "land" },
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"style": {
|
||||
"fill-color": "@land"
|
||||
},
|
||||
@@ -833,9 +771,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "barrier_line",
|
||||
"filter": { "class": "cliff" },
|
||||
"render": {
|
||||
"type": "line"
|
||||
},
|
||||
"type": "line",
|
||||
"style": {
|
||||
"line-color": "#987",
|
||||
"line-width": 4
|
||||
@@ -848,9 +784,7 @@
|
||||
"id": "water",
|
||||
"source": "mapbox",
|
||||
"source-layer": "water",
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"style": {
|
||||
"fill-color": "@water",
|
||||
"fill-outline-color": "#a2bdc0"
|
||||
@@ -863,9 +797,7 @@
|
||||
"id": "aeroway_fill",
|
||||
"source": "mapbox",
|
||||
"source-layer": "aeroway",
|
||||
"render": {
|
||||
"type": "fill"
|
||||
},
|
||||
"type": "fill",
|
||||
"style": {
|
||||
"fill-color": "#ddd"
|
||||
},
|
||||
@@ -877,9 +809,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "aeroway",
|
||||
"filter": { "type": "runway" },
|
||||
"render": {
|
||||
"type": "line"
|
||||
},
|
||||
"type": "line",
|
||||
"style": {
|
||||
"line-color": "#ddd",
|
||||
"line-width": "@runway_width"
|
||||
@@ -893,9 +823,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "aeroway",
|
||||
"filter": { "type": "taxiway" },
|
||||
"render": {
|
||||
"type": "line"
|
||||
},
|
||||
"type": "line",
|
||||
"style": {
|
||||
"line-color": "#ddd",
|
||||
"line-width": "@taxiway_width"
|
||||
@@ -909,9 +837,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "tunnel",
|
||||
"filter": { "class": "motorway_link" },
|
||||
"render": {
|
||||
"type": "line"
|
||||
},
|
||||
"type": "line",
|
||||
"style": {
|
||||
"line-color": "@case",
|
||||
"line-dasharray": [6, 6],
|
||||
@@ -927,9 +853,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "tunnel",
|
||||
"filter": { "class": "service" },
|
||||
"render": {
|
||||
"type": "line"
|
||||
},
|
||||
"type": "line",
|
||||
"style": {
|
||||
"line-color": "#000",
|
||||
"line-opacity": 0.04,
|
||||
@@ -947,9 +871,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "tunnel",
|
||||
"filter": { "class": "main" },
|
||||
"render": {
|
||||
"type": "line"
|
||||
},
|
||||
"type": "line",
|
||||
"style": {
|
||||
"line-color": "@case",
|
||||
"line-dasharray": [6, 6],
|
||||
@@ -973,9 +895,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "tunnel",
|
||||
"filter": { "class": ["street", "street_limited"] },
|
||||
"render": {
|
||||
"type": "line"
|
||||
},
|
||||
"type": "line",
|
||||
"style": {
|
||||
"line-color": "#d9d5c6",
|
||||
"line-width": "@street_casing_width",
|
||||
@@ -1043,9 +963,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "tunnel",
|
||||
"filter": { "class": "motorway" },
|
||||
"render": {
|
||||
"type": "line"
|
||||
},
|
||||
"type": "line",
|
||||
"style": {
|
||||
"line-color": "@case",
|
||||
"line-dasharray": [6, 6],
|
||||
@@ -1088,9 +1006,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "road",
|
||||
"filter": { "class": "path" },
|
||||
"render": {
|
||||
"type": "line"
|
||||
},
|
||||
"type": "line",
|
||||
"style": {
|
||||
"line-color": "#ffd",
|
||||
"line-opacity": 0.4,
|
||||
@@ -1108,9 +1024,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "bridge",
|
||||
"filter": { "type": "footway" },
|
||||
"render": {
|
||||
"type": "line"
|
||||
},
|
||||
"type": "line",
|
||||
"style": {
|
||||
"line-color": "#bba",
|
||||
"line-dasharray": [10, 4],
|
||||
@@ -1126,9 +1040,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "bridge",
|
||||
"filter": { "type": "path" },
|
||||
"render": {
|
||||
"type": "line"
|
||||
},
|
||||
"type": "line",
|
||||
"style": {
|
||||
"line-color": "#987",
|
||||
"line-dasharray": [10, 4],
|
||||
@@ -1152,9 +1064,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "bridge",
|
||||
"filter": { "type": "cycleway" },
|
||||
"render": {
|
||||
"type": "line"
|
||||
},
|
||||
"type": "line",
|
||||
"style": {
|
||||
"line-color": "#488",
|
||||
"line-dasharray": [10, 4],
|
||||
@@ -1170,9 +1080,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "bridge",
|
||||
"filter": { "type": "mtb" },
|
||||
"render": {
|
||||
"type": "line"
|
||||
},
|
||||
"type": "line",
|
||||
"style": {
|
||||
"line-color": "#488",
|
||||
"line-dasharray": [12, 4],
|
||||
@@ -1188,9 +1096,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "bridge",
|
||||
"filter": { "type": "piste" },
|
||||
"render": {
|
||||
"type": "line"
|
||||
},
|
||||
"type": "line",
|
||||
"style": {
|
||||
"line-color": "#87b",
|
||||
"line-dasharray": [8, 4],
|
||||
@@ -1206,9 +1112,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "bridge",
|
||||
"filter": { "type": "steps" },
|
||||
"render": {
|
||||
"type": "line"
|
||||
},
|
||||
"type": "line",
|
||||
"style": {
|
||||
"line-color": "#bba",
|
||||
"line-dasharray": [10, 4],
|
||||
@@ -1225,9 +1129,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "bridge",
|
||||
"filter": { "class": "major_rail" },
|
||||
"render": {
|
||||
"type": "line"
|
||||
},
|
||||
"type": "line",
|
||||
"style": {
|
||||
"line-color": "#c8c4c0",
|
||||
"line-width": 0.8
|
||||
@@ -1241,8 +1143,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "road",
|
||||
"filter": { "class": "motorway_link" },
|
||||
"type": "line",
|
||||
"render": {
|
||||
"type": "line",
|
||||
"line-join": "round",
|
||||
"line-cap": "round"
|
||||
},
|
||||
@@ -1259,8 +1161,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "road",
|
||||
"filter": { "class": "service" },
|
||||
"type": "line",
|
||||
"render": {
|
||||
"type": "line",
|
||||
"line-join": "round",
|
||||
"line-cap": "round"
|
||||
},
|
||||
@@ -1279,8 +1181,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "road",
|
||||
"filter": { "class": "main" },
|
||||
"type": "line",
|
||||
"render": {
|
||||
"type": "line",
|
||||
"line-join": "round",
|
||||
"line-cap": "round"
|
||||
},
|
||||
@@ -1305,8 +1207,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "road",
|
||||
"filter": { "class": ["street", "street_limited"] },
|
||||
"type": "line",
|
||||
"render": {
|
||||
"type": "line",
|
||||
"line-join": "round",
|
||||
"line-cap": "round"
|
||||
},
|
||||
@@ -1377,8 +1279,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "road",
|
||||
"filter": { "class": "motorway" },
|
||||
"type": "line",
|
||||
"render": {
|
||||
"type": "line",
|
||||
"line-join": "round",
|
||||
"line-cap": "round"
|
||||
},
|
||||
@@ -1435,9 +1337,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "bridge",
|
||||
"filter": { "class": "motorway_link" },
|
||||
"render": {
|
||||
"type": "line"
|
||||
},
|
||||
"type": "line",
|
||||
"style": {
|
||||
"line-color": "@case",
|
||||
"line-width": "@motorway_link_casing_width"
|
||||
@@ -1451,9 +1351,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "bridge",
|
||||
"filter": { "class": "service" },
|
||||
"render": {
|
||||
"type": "line"
|
||||
},
|
||||
"type": "line",
|
||||
"style": {
|
||||
"line-color": "#000",
|
||||
"line-opacity": 0.04,
|
||||
@@ -1469,9 +1367,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "bridge",
|
||||
"filter": { "class": "main" },
|
||||
"render": {
|
||||
"type": "line"
|
||||
},
|
||||
"type": "line",
|
||||
"style": {
|
||||
"line-color": "@case",
|
||||
"line-width": "@main_casing_width",
|
||||
@@ -1493,9 +1389,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "bridge",
|
||||
"filter": { "class": ["street", "street_limited"] },
|
||||
"render": {
|
||||
"type": "line"
|
||||
},
|
||||
"type": "line",
|
||||
"style": {
|
||||
"line-color": "#d9d5c6",
|
||||
"line-width": "@street_casing_width",
|
||||
@@ -1563,9 +1457,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "bridge",
|
||||
"filter": { "class": "motorway" },
|
||||
"render": {
|
||||
"type": "line"
|
||||
},
|
||||
"type": "line",
|
||||
"style": {
|
||||
"line-color": "@case",
|
||||
"line-width": "@motorway_casing_width",
|
||||
@@ -1606,9 +1498,7 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "bridge",
|
||||
"filter": { "class": "aerialway" },
|
||||
"render": {
|
||||
"type": "line"
|
||||
},
|
||||
"type": "line",
|
||||
"style": {
|
||||
"line-color": "white",
|
||||
"line-opacity": 0.5,
|
||||
@@ -1637,8 +1527,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "admin",
|
||||
"filter": { "admin_level": [3, 4, 5] },
|
||||
"type": "line",
|
||||
"render": {
|
||||
"type": "line",
|
||||
"line-join": "round"
|
||||
},
|
||||
"style": {
|
||||
@@ -1664,8 +1554,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "admin",
|
||||
"filter": { "admin_level": 2 },
|
||||
"type": "line",
|
||||
"render": {
|
||||
"type": "line",
|
||||
"line-join": "round",
|
||||
"line-cap": "round"
|
||||
},
|
||||
@@ -1682,8 +1572,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "admin",
|
||||
"filter": { "maritime": 1 },
|
||||
"type": "line",
|
||||
"render": {
|
||||
"type": "line",
|
||||
"line-join": "round",
|
||||
"line-cap": "round"
|
||||
},
|
||||
@@ -1716,9 +1606,9 @@
|
||||
"id": "country_label_line",
|
||||
"source": "mapbox",
|
||||
"source-layer": "country_label_line",
|
||||
"type": "line",
|
||||
"render": {
|
||||
"text-max-width": 5,
|
||||
"type": "line"
|
||||
},
|
||||
"style": {
|
||||
"line-color": "@country_text",
|
||||
@@ -1735,8 +1625,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "country_label",
|
||||
"filter": { "$type": "Point" },
|
||||
"type": "text",
|
||||
"render": {
|
||||
"type": "text",
|
||||
"text-field": "{name_en}",
|
||||
"text-path": "horizontal",
|
||||
"text-font": "Open Sans Semibold, Arial Unicode MS Bold",
|
||||
@@ -1760,8 +1650,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "marine_label",
|
||||
"filter": { "$type": "LineString", "labelrank": 1 },
|
||||
"type": "text",
|
||||
"render": {
|
||||
"type": "text",
|
||||
"text-field": "{name_en}",
|
||||
"text-path": "curve",
|
||||
"text-font": "Open Sans Semibold Italic, Arial Unicode MS Bold",
|
||||
@@ -1790,8 +1680,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "marine_label",
|
||||
"filter": { "$type": "LineString", "labelrank": 2 },
|
||||
"type": "text",
|
||||
"render": {
|
||||
"type": "text",
|
||||
"text-field": "{name_en}",
|
||||
"text-path": "curve",
|
||||
"text-font": "Open Sans Semibold Italic, Arial Unicode MS Bold",
|
||||
@@ -1819,8 +1709,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "marine_label",
|
||||
"filter": { "$type": "LineString", "labelrank": 3 },
|
||||
"type": "text",
|
||||
"render": {
|
||||
"type": "text",
|
||||
"text-field": "{name_en}",
|
||||
"text-path": "curve",
|
||||
"text-font": "Open Sans Semibold Italic, Arial Unicode MS Bold",
|
||||
@@ -1848,8 +1738,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "marine_label",
|
||||
"filter": { "$type": "LineString", "labelrank": [4, 5, 6] },
|
||||
"type": "text",
|
||||
"render": {
|
||||
"type": "text",
|
||||
"text-field": "{name_en}",
|
||||
"text-path": "curve",
|
||||
"text-font": "Open Sans Semibold Italic, Arial Unicode MS Bold",
|
||||
@@ -1877,8 +1767,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "marine_label",
|
||||
"filter": { "$type": "Point", "labelrank": 1 },
|
||||
"type": "text",
|
||||
"render": {
|
||||
"type": "text",
|
||||
"text-field": "{name_en}",
|
||||
"text-path": "horizontal",
|
||||
"text-font": "Open Sans Semibold Italic, Arial Unicode MS Bold",
|
||||
@@ -1908,8 +1798,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "marine_label",
|
||||
"filter": { "$type": "Point", "labelrank": 2 },
|
||||
"type": "text",
|
||||
"render": {
|
||||
"type": "text",
|
||||
"text-field": "{name_en}",
|
||||
"text-path": "horizontal",
|
||||
"text-font": "Open Sans Semibold Italic, Arial Unicode MS Bold",
|
||||
@@ -1939,8 +1829,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "marine_label",
|
||||
"filter": { "$type": "Point", "labelrank": 3 },
|
||||
"type": "text",
|
||||
"render": {
|
||||
"type": "text",
|
||||
"text-field": "{name_en}",
|
||||
"text-path": "horizontal",
|
||||
"text-font": "Open Sans Semibold Italic, Arial Unicode MS Bold",
|
||||
@@ -1970,8 +1860,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "marine_label",
|
||||
"filter": { "$type": "Point", "labelrank": [4, 5, 6] },
|
||||
"type": "text",
|
||||
"render": {
|
||||
"type": "text",
|
||||
"text-field": "{name_en}",
|
||||
"text-path": "horizontal",
|
||||
"text-font": "Open Sans Semibold Italic, Arial Unicode MS Bold",
|
||||
@@ -2001,8 +1891,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "state_label",
|
||||
"filter": { "$type": "Point" },
|
||||
"type": "text",
|
||||
"render": {
|
||||
"type": "text",
|
||||
"text-field": "{name_en}",
|
||||
"text-path": "horizontal",
|
||||
"text-font": "Open Sans Regular, Arial Unicode MS Regular",
|
||||
@@ -2032,8 +1922,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "place_label",
|
||||
"filter": { "type": "city", "$type": "Point" },
|
||||
"type": "text",
|
||||
"render": {
|
||||
"type": "text",
|
||||
"text-field": "{name_en}",
|
||||
"text-path": "horizontal",
|
||||
"text-font": "Open Sans Semibold, Arial Unicode MS Bold",
|
||||
@@ -2063,8 +1953,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "place_label",
|
||||
"filter": { "type": "town", "$type": "Point" },
|
||||
"type": "text",
|
||||
"render": {
|
||||
"type": "text",
|
||||
"text-field": "{name_en}",
|
||||
"text-path": "horizontal",
|
||||
"text-font": "Open Sans Semibold, Arial Unicode MS Bold",
|
||||
@@ -2094,8 +1984,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "place_label",
|
||||
"filter": { "type": "village", "$type": "Point" },
|
||||
"type": "text",
|
||||
"render": {
|
||||
"type": "text",
|
||||
"text-field": "{name_en}",
|
||||
"text-path": "horizontal",
|
||||
"text-font": "Open Sans Semibold, Arial Unicode MS Bold",
|
||||
@@ -2125,8 +2015,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "place_label",
|
||||
"filter": { "type": ["hamlet", "suburb", "neighbourhood"], "$type": "Point" },
|
||||
"type": "text",
|
||||
"render": {
|
||||
"type": "text",
|
||||
"text-field": "{name_en}",
|
||||
"text-path": "horizontal",
|
||||
"text-font": "Open Sans Semibold, Arial Unicode MS Bold",
|
||||
@@ -2155,8 +2045,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "road_label",
|
||||
"filter": { "class": ["motorway", "main"], "$type": "LineString" },
|
||||
"type": "text",
|
||||
"render": {
|
||||
"type": "text",
|
||||
"text-field": "{name_en}",
|
||||
"text-path": "curve",
|
||||
"text-padding": 2,
|
||||
@@ -2181,8 +2071,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "road_label",
|
||||
"filter": { "class": ["street", "street_limited"], "$type": "LineString" },
|
||||
"type": "text",
|
||||
"render": {
|
||||
"type": "text",
|
||||
"text-field": "{name_en}",
|
||||
"text-path": "curve",
|
||||
"text-padding": 2,
|
||||
@@ -2207,8 +2097,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "road_label",
|
||||
"filter": { "class": ["service", "driveway", "path"], "$type": "LineString" },
|
||||
"type": "text",
|
||||
"render": {
|
||||
"type": "text",
|
||||
"text-field": "{name_en}",
|
||||
"text-path": "curve",
|
||||
"text-padding": 2,
|
||||
@@ -2233,8 +2123,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "contour",
|
||||
"filter": { "index": [5, 10], "$type": "LineString" },
|
||||
"type": "text",
|
||||
"render": {
|
||||
"type": "text",
|
||||
"text-path": "curve",
|
||||
"text-field": "{ele} m",
|
||||
"text-font": "Open Sans Regular, Arial Unicode MS Regular",
|
||||
@@ -2258,8 +2148,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "water_label",
|
||||
"filter": { "$type": "Point" },
|
||||
"type": "text",
|
||||
"render": {
|
||||
"type": "text",
|
||||
"text-field": "{name_en}",
|
||||
"text-path": "horizontal",
|
||||
"text-font": "Open Sans Semibold Italic, Arial Unicode MS Bold",
|
||||
@@ -2279,8 +2169,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "waterway_label",
|
||||
"filter": { "$type": "LineString" },
|
||||
"type": "text",
|
||||
"render": {
|
||||
"type": "text",
|
||||
"text-field": "{name_en}",
|
||||
"text-path": "curve",
|
||||
"text-font": "Open Sans Semibold Italic, Arial Unicode MS Bold",
|
||||
@@ -2301,8 +2191,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "poi_label",
|
||||
"filter": { "scalerank": [1, 2] },
|
||||
"type": "icon",
|
||||
"render": {
|
||||
"type": "icon",
|
||||
"icon-image": "{maki}-12",
|
||||
"icon-size": 12
|
||||
},
|
||||
@@ -2312,8 +2202,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "poi_label",
|
||||
"filter": { "scalerank": [1, 2], "$type": "Point" },
|
||||
"type": "text",
|
||||
"render": {
|
||||
"type": "text",
|
||||
"text-field": "{name_en}",
|
||||
"text-path": "horizontal",
|
||||
"text-padding": 2,
|
||||
@@ -2339,8 +2229,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "poi_label",
|
||||
"filter": { "scalerank": 3 },
|
||||
"type": "icon",
|
||||
"render": {
|
||||
"type": "icon",
|
||||
"icon-image": "{maki}-12",
|
||||
"icon-size": 12
|
||||
},
|
||||
@@ -2361,8 +2251,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "poi_label",
|
||||
"filter": { "scalerank": 3, "$type": "Point" },
|
||||
"type": "text",
|
||||
"render": {
|
||||
"type": "text",
|
||||
"text-field": "{name_en}",
|
||||
"text-path": "horizontal",
|
||||
"text-padding": 2,
|
||||
@@ -2396,8 +2286,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "poi_label",
|
||||
"filter": { "scalerank": 4 },
|
||||
"type": "icon",
|
||||
"render": {
|
||||
"type": "icon",
|
||||
"icon-image": "{maki}-12",
|
||||
"icon-size": 12
|
||||
},
|
||||
@@ -2418,8 +2308,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "poi_label",
|
||||
"filter": { "scalerank": 4, "$type": "Point" },
|
||||
"type": "text",
|
||||
"render": {
|
||||
"type": "text",
|
||||
"text-field": "{name_en}",
|
||||
"text-path": "horizontal",
|
||||
"text-padding": 2,
|
||||
@@ -2453,8 +2343,8 @@
|
||||
"source": "mapbox",
|
||||
"source-layer": "poi_label",
|
||||
"filter": { "maki": "airport" },
|
||||
"type": "icon",
|
||||
"render": {
|
||||
"type": "icon",
|
||||
"icon-image": "{maki}-12",
|
||||
"icon-size": 12
|
||||
},
|
||||
|
||||
@@ -71,7 +71,8 @@ class StyleBucket {
|
||||
public:
|
||||
typedef std::shared_ptr<StyleBucket> Ptr;
|
||||
|
||||
BucketType type = BucketType::None;
|
||||
StyleBucket(StyleLayerType type);
|
||||
|
||||
std::string name;
|
||||
std::shared_ptr<Source> source;
|
||||
std::string source_layer;
|
||||
|
||||
@@ -61,6 +61,8 @@ public:
|
||||
// The name of this layer.
|
||||
const std::string id;
|
||||
|
||||
StyleLayerType type = StyleLayerType::Unknown;
|
||||
|
||||
// Bucket information, telling the renderer how to generate the geometries
|
||||
// for this layer (feature property filters, tessellation instructions, ...).
|
||||
std::shared_ptr<StyleBucket> bucket;
|
||||
|
||||
@@ -9,19 +9,20 @@ namespace llmr {
|
||||
// Stores a premultiplied color, with all four channels ranging from 0..1
|
||||
typedef std::array<float, 4> Color;
|
||||
|
||||
enum class BucketType : uint8_t {
|
||||
None,
|
||||
enum class StyleLayerType : uint8_t {
|
||||
Unknown,
|
||||
Fill,
|
||||
Line,
|
||||
Icon,
|
||||
Text,
|
||||
Raster,
|
||||
Default = None
|
||||
Composite,
|
||||
Background
|
||||
};
|
||||
|
||||
BucketType parseBucketType(const std::string &type);
|
||||
const char *stringifyBucketType(BucketType type);
|
||||
std::ostream& operator<<(std::ostream&, BucketType type);
|
||||
StyleLayerType parseStyleLayerType(const std::string &type);
|
||||
const char *stringifyStyleLayerType(StyleLayerType type);
|
||||
std::ostream& operator<<(std::ostream&, StyleLayerType type);
|
||||
|
||||
|
||||
enum class WindingType : uint8_t {
|
||||
|
||||
@@ -600,23 +600,23 @@ void Map::renderLayer(std::shared_ptr<StyleLayer> layer_desc, RenderPass pass) {
|
||||
|
||||
// Abort early if we can already deduce from the bucket type that
|
||||
// we're not going to render anything anyway during this pass.
|
||||
switch (layer_desc->bucket->type) {
|
||||
case BucketType::Fill:
|
||||
switch (layer_desc->type) {
|
||||
case StyleLayerType::Fill:
|
||||
if (!layer_desc->getProperties<FillProperties>().isVisible()) return;
|
||||
break;
|
||||
case BucketType::Line:
|
||||
case StyleLayerType::Line:
|
||||
if (pass == Opaque) return;
|
||||
if (!layer_desc->getProperties<LineProperties>().isVisible()) return;
|
||||
break;
|
||||
case BucketType::Icon:
|
||||
case StyleLayerType::Icon:
|
||||
if (pass == Opaque) return;
|
||||
if (!layer_desc->getProperties<IconProperties>().isVisible()) return;
|
||||
break;
|
||||
case BucketType::Text:
|
||||
case StyleLayerType::Text:
|
||||
if (pass == Opaque) return;
|
||||
if (!layer_desc->getProperties<TextProperties>().isVisible()) return;
|
||||
break;
|
||||
case BucketType::Raster:
|
||||
case StyleLayerType::Raster:
|
||||
if (pass == Translucent) return;
|
||||
if (!layer_desc->getProperties<RasterProperties>().isVisible()) return;
|
||||
break;
|
||||
@@ -626,7 +626,7 @@ void Map::renderLayer(std::shared_ptr<StyleLayer> layer_desc, RenderPass pass) {
|
||||
|
||||
if (debug::renderTree) {
|
||||
std::cout << std::string(indent * 4, ' ') << "- " << layer_desc->id << " ("
|
||||
<< layer_desc->bucket->type << ")" << std::endl;
|
||||
<< layer_desc->type << ")" << std::endl;
|
||||
}
|
||||
|
||||
layer_desc->bucket->source->render(painter, layer_desc);
|
||||
|
||||
@@ -122,7 +122,7 @@ std::unique_ptr<Bucket> TileParser::createBucket(std::shared_ptr<StyleBucket> bu
|
||||
} else if (bucket_desc->render.is<StyleBucketRaster>()) {
|
||||
return nullptr;
|
||||
} else {
|
||||
fprintf(stderr, "[WARNING] unknown bucket render type for layer '%s'\n", bucket_desc->source_layer.c_str());
|
||||
fprintf(stderr, "[WARNING] unknown bucket render type for layer '%s' (source layer '%s')\n", bucket_desc->name.c_str(), bucket_desc->source_layer.c_str());
|
||||
}
|
||||
} else {
|
||||
// The layer specified in the bucket does not exist. Do nothing.
|
||||
|
||||
16
src/style/style_bucket.cpp
Normal file
16
src/style/style_bucket.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#include <llmr/style/style_bucket.hpp>
|
||||
|
||||
namespace llmr {
|
||||
|
||||
StyleBucket::StyleBucket(StyleLayerType type) {
|
||||
switch (type) {
|
||||
case StyleLayerType::Fill: render = StyleBucketFill{}; break;
|
||||
case StyleLayerType::Line: render = StyleBucketLine{}; break;
|
||||
case StyleLayerType::Icon: render = StyleBucketIcon{}; break;
|
||||
case StyleLayerType::Text: render = StyleBucketText{}; break;
|
||||
case StyleLayerType::Raster: render = StyleBucketRaster{}; break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,7 +11,7 @@ StyleLayer::StyleLayer(const std::string &id, std::map<ClassID, ClassProperties>
|
||||
: id(id), styles(std::move(styles)), rasterize(std::move(rasterize)) {}
|
||||
|
||||
bool StyleLayer::isBackground() const {
|
||||
return id == "background";
|
||||
return type == StyleLayerType::Background && id == "background";
|
||||
}
|
||||
|
||||
void StyleLayer::setClasses(const std::vector<std::string> &class_names, const timestamp now,
|
||||
@@ -257,19 +257,15 @@ void StyleLayer::updateProperties(float z, const timestamp now) {
|
||||
|
||||
cleanupAppliedStyleProperties(now);
|
||||
|
||||
if (layers) {
|
||||
applyStyleProperties<CompositeProperties>(z, now);
|
||||
} else if (bucket) {
|
||||
switch (bucket->type) {
|
||||
case BucketType::Fill: applyStyleProperties<FillProperties>(z, now); break;
|
||||
case BucketType::Line: applyStyleProperties<LineProperties>(z, now); break;
|
||||
case BucketType::Icon: applyStyleProperties<IconProperties>(z, now); break;
|
||||
case BucketType::Text: applyStyleProperties<TextProperties>(z, now); break;
|
||||
case BucketType::Raster: applyStyleProperties<RasterProperties>(z, now); break;
|
||||
default: properties.set<std::false_type>(); break;
|
||||
}
|
||||
} else {
|
||||
return applyStyleProperties<BackgroundProperties>(z, now);
|
||||
switch (type) {
|
||||
case StyleLayerType::Fill: applyStyleProperties<FillProperties>(z, now); break;
|
||||
case StyleLayerType::Line: applyStyleProperties<LineProperties>(z, now); break;
|
||||
case StyleLayerType::Icon: applyStyleProperties<IconProperties>(z, now); break;
|
||||
case StyleLayerType::Text: applyStyleProperties<TextProperties>(z, now); break;
|
||||
case StyleLayerType::Raster: applyStyleProperties<RasterProperties>(z, now); break;
|
||||
case StyleLayerType::Composite: applyStyleProperties<CompositeProperties>(z, now); break;
|
||||
case StyleLayerType::Background: applyStyleProperties<BackgroundProperties>(z, now); break;
|
||||
default: properties.set<std::false_type>(); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -548,6 +548,15 @@ void StyleParser::parseLayer(std::pair<JSVal, std::shared_ptr<StyleLayer>> &pair
|
||||
return;
|
||||
}
|
||||
|
||||
if (value.HasMember("type")) {
|
||||
JSVal type = value["type"];
|
||||
if (!type.IsString()) {
|
||||
fprintf(stderr, "[WARNING] layer type of '%s' must be a string\n", layer->id.c_str());
|
||||
} else {
|
||||
layer->type = parseStyleLayerType({ type.GetString(), type.GetStringLength() });
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure we have not previously attempted to parse this layer.
|
||||
if (std::find(stack.begin(), stack.end(), layer.get()) != stack.end()) {
|
||||
fprintf(stderr, "[WARNING] layer reference of '%s' is circular\n", layer->id.c_str());
|
||||
@@ -694,20 +703,24 @@ void StyleParser::parseReference(JSVal value, std::shared_ptr<StyleLayer> &layer
|
||||
parseLayer(it->second);
|
||||
stack.pop_front();
|
||||
|
||||
|
||||
std::shared_ptr<StyleLayer> reference = it->second.second;
|
||||
|
||||
layer->type = reference->type;
|
||||
|
||||
if (reference->layers) {
|
||||
fprintf(stderr, "[WARNING] layer '%s' references composite layer\n", layer->id.c_str());
|
||||
// We cannot parse this layer further.
|
||||
return;
|
||||
} else {
|
||||
layer->bucket = reference->bucket;
|
||||
}
|
||||
|
||||
layer->bucket = reference->bucket;
|
||||
}
|
||||
|
||||
#pragma mark - Parse Bucket
|
||||
|
||||
void StyleParser::parseBucket(JSVal value, std::shared_ptr<StyleLayer> &layer) {
|
||||
layer->bucket = std::make_shared<StyleBucket>();
|
||||
layer->bucket = std::make_shared<StyleBucket>(layer->type);
|
||||
|
||||
// We name the buckets according to the layer that defined it.
|
||||
layer->bucket->name = layer->id;
|
||||
@@ -844,23 +857,14 @@ void StyleParser::parseRender(JSVal value, std::shared_ptr<StyleLayer> &layer) {
|
||||
|
||||
StyleBucket &bucket = *layer->bucket;
|
||||
|
||||
if (value.HasMember("type")) {
|
||||
JSVal type = value["type"];
|
||||
if (type.IsString()) {
|
||||
bucket.type = parseBucketType({ type.GetString(), type.GetStringLength() });
|
||||
}
|
||||
}
|
||||
|
||||
switch (bucket.type) {
|
||||
case BucketType::Fill: {
|
||||
bucket.render = StyleBucketFill{};
|
||||
switch (layer->type) {
|
||||
case StyleLayerType::Fill: {
|
||||
StyleBucketFill &render = bucket.render.get<StyleBucketFill>();
|
||||
|
||||
parseRenderProperty(value, render.winding, "fill-winding", parseWindingType);
|
||||
} break;
|
||||
|
||||
case BucketType::Line: {
|
||||
bucket.render = StyleBucketLine{};
|
||||
case StyleLayerType::Line: {
|
||||
StyleBucketLine &render = bucket.render.get<StyleBucketLine>();
|
||||
|
||||
parseRenderProperty(value, render.cap, "line-cap", parseCapType);
|
||||
@@ -869,8 +873,7 @@ void StyleParser::parseRender(JSVal value, std::shared_ptr<StyleLayer> &layer) {
|
||||
parseRenderProperty(value, render.round_limit, "line-round-limit");
|
||||
} break;
|
||||
|
||||
case BucketType::Icon: {
|
||||
bucket.render = StyleBucketIcon{};
|
||||
case StyleLayerType::Icon: {
|
||||
StyleBucketIcon &render = bucket.render.get<StyleBucketIcon>();
|
||||
|
||||
parseRenderProperty(value, render.size, "icon-size");
|
||||
@@ -884,8 +887,7 @@ void StyleParser::parseRender(JSVal value, std::shared_ptr<StyleLayer> &layer) {
|
||||
parseRenderProperty(value, render.translate_anchor, "icon-translate-anchor", parseTranslateAnchorType);
|
||||
} break;
|
||||
|
||||
case BucketType::Text: {
|
||||
bucket.render = StyleBucketText{};
|
||||
case StyleLayerType::Text: {
|
||||
StyleBucketText &render = bucket.render.get<StyleBucketText>();
|
||||
|
||||
parseRenderProperty(value, render.field, "text-field");
|
||||
@@ -915,15 +917,6 @@ void StyleParser::parseRender(JSVal value, std::shared_ptr<StyleLayer> &layer) {
|
||||
}
|
||||
parseRenderProperty(value, render.translate_anchor, "text-translate-anchor", parseTranslateAnchorType);
|
||||
} break;
|
||||
|
||||
case BucketType::Raster: {
|
||||
bucket.render = StyleBucketRaster{};
|
||||
} break;
|
||||
|
||||
default:
|
||||
layer->bucket.reset();
|
||||
fprintf(stderr, "[WARNING] bucket type of layer '%s' is invalid\n", layer->id.c_str());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,28 +4,32 @@
|
||||
|
||||
namespace llmr {
|
||||
|
||||
BucketType parseBucketType(const std::string &type) {
|
||||
if (type == "fill") return BucketType::Fill;
|
||||
if (type == "line") return BucketType::Line;
|
||||
if (type == "icon") return BucketType::Icon;
|
||||
if (type == "text") return BucketType::Text;
|
||||
if (type == "raster") return BucketType::Raster;
|
||||
return BucketType::None;
|
||||
StyleLayerType parseStyleLayerType(const std::string &type) {
|
||||
if (type == "fill") return StyleLayerType::Fill;
|
||||
if (type == "line") return StyleLayerType::Line;
|
||||
if (type == "icon") return StyleLayerType::Icon;
|
||||
if (type == "text") return StyleLayerType::Text;
|
||||
if (type == "raster") return StyleLayerType::Raster;
|
||||
if (type == "composite") return StyleLayerType::Composite;
|
||||
if (type == "background") return StyleLayerType::Background;
|
||||
return StyleLayerType::Unknown;
|
||||
}
|
||||
|
||||
const char *stringifyBucketType(BucketType type) {
|
||||
const char *stringifyStyleLayerType(StyleLayerType type) {
|
||||
switch (type) {
|
||||
case BucketType::Fill: return "fill";
|
||||
case BucketType::Line: return "line";
|
||||
case BucketType::Icon: return "icon";
|
||||
case BucketType::Text: return "text";
|
||||
case BucketType::Raster: return "raster";
|
||||
default: return "none";
|
||||
case StyleLayerType::Fill: return "fill";
|
||||
case StyleLayerType::Line: return "line";
|
||||
case StyleLayerType::Icon: return "icon";
|
||||
case StyleLayerType::Text: return "text";
|
||||
case StyleLayerType::Raster: return "raster";
|
||||
case StyleLayerType::Composite: return "composite";
|
||||
case StyleLayerType::Background: return "background";
|
||||
default: return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, BucketType type) {
|
||||
return os << stringifyBucketType(type);
|
||||
std::ostream& operator<<(std::ostream& os, StyleLayerType type) {
|
||||
return os << stringifyStyleLayerType(type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user