From 11c8be6f948172112e06d922c7d60336b181cd3a Mon Sep 17 00:00:00 2001 From: Eden Halperin Date: Thu, 8 May 2014 16:55:00 -0700 Subject: [PATCH] start of outdoors style --- bin/style.js | 4669 ++++++++++++++++++++++------------ src/map/map.cpp | 2 +- src/shader/shaders_gl.cpp | 36 +- src/shader/shaders_gles2.cpp | 36 +- 4 files changed, 3113 insertions(+), 1630 deletions(-) diff --git a/bin/style.js b/bin/style.js index c89ff81e8..e38af300c 100644 --- a/bin/style.js +++ b/bin/style.js @@ -8,6 +8,7 @@ module.exports = { "field": "maritime", "value": "1", "join": "round", + "cap": "round", "type": "line" }, "admin_level_2": { @@ -23,14 +24,45 @@ module.exports = { "source": "mapbox streets", "layer": "admin", "field": "admin_level", - "value": [ - 3, - 4, - 5 - ], + "value": [3, 4, 5], "join": "round", "type": "line" }, + "landcover_wood": { + "source": "mapbox streets", + "layer": "landcover", + "field": "class", + "value": "wood", + "type": "fill" + }, + "landcover_scrub": { + "source": "mapbox streets", + "layer": "landcover", + "field": "class", + "value": "scrub", + "type": "fill" + }, + "landcover_grass": { + "source": "mapbox streets", + "layer": "landcover", + "field": "class", + "value": "grass", + "type": "fill" + }, + "landcover_crop": { + "source": "mapbox streets", + "layer": "landcover", + "field": "class", + "value": "crop", + "type": "fill" + }, + "landcover_snow": { + "source": "mapbox streets", + "layer": "landcover", + "field": "class", + "value": "snow", + "type": "fill" + }, "water": { "source": "mapbox streets", "layer": "water", @@ -41,28 +73,28 @@ module.exports = { "layer": "waterway", "field": "type", "value": [ - "ditch", - "drain" - ], + "ditch", + "drain" + ], "cap": "round", "type": "line" }, - "waterway_river": { - "source": "mapbox streets", - "layer": "waterway", - "field": "type", - "value": "river", - "cap": "round", - "type": "line" - }, - "waterway_stream_canal": { + "waterway_river_canal": { "source": "mapbox streets", "layer": "waterway", "field": "type", "value": [ - "stream", - "canal" - ], + "river", + "canal" + ], + "cap": "round", + "type": "line" + }, + "waterway_stream": { + "source": "mapbox streets", + "layer": "waterway", + "field": "type", + "value": "stream", "cap": "round", "type": "line" }, @@ -73,6 +105,13 @@ module.exports = { "value": "park", "type": "fill" }, + "landuse_pitch": { + "source": "mapbox streets", + "layer": "landuse", + "field": "class", + "value": "pitch", + "type": "fill" + }, "landuse_cemetary": { "source": "mapbox streets", "layer": "landuse", @@ -87,6 +126,13 @@ module.exports = { "value": "hospital", "type": "fill" }, + "landuse_industrial": { + "source": "mapbox streets", + "layer": "landuse", + "field": "class", + "value": "industrial", + "type": "fill" + }, "landuse_school": { "source": "mapbox streets", "layer": "landuse", @@ -94,18 +140,115 @@ module.exports = { "value": "school", "type": "fill" }, - "landuse_wood": { + "overlay_wetland": { "source": "mapbox streets", - "layer": "landuse", + "layer": "landuse_overlay", "field": "class", - "value": "wood", + "value": "wetland", "type": "fill" }, + "overlay_wetland_noveg": { + "source": "mapbox streets", + "layer": "landuse_overlay", + "field": "class", + "value": "wetland_noveg", + "type": "fill" + }, + "overlay_breakwater_pier": { + "source": "mapbox streets", + "layer": "landuse_overlay", + "field": "class", + "value": [ + "breakwater", + "pier" + ], + "type": "fill" + }, + "hillshade_full_shadow": { + "source": "mapbox streets", + "layer": "hillshade", + "field": "class", + "value": "full_shadow", + "type": "fill" + }, + "hillshade_medium_shadow": { + "source": "mapbox streets", + "layer": "hillshade", + "field": "class", + "value": "medium_shadow", + "type": "fill" + }, + "hillshade_medium_highlight": { + "source": "mapbox streets", + "layer": "hillshade", + "field": "class", + "value": "medium_highlight", + "type": "fill" + }, + "hillshade_full_highlight": { + "source": "mapbox streets", + "layer": "hillshade", + "field": "class", + "value": "full_highlight", + "type": "fill" + }, + "contour_line_10": { + "source": "mapbox streets", + "layer": "contour", + "field": "index", + "value": 10, + "type": "line" + }, + "contour_line_other": { + "source": "mapbox streets", + "layer": "contour", + "type": "line" + }, + "contour_label": { + "source": "mapbox streets", + "layer": "label", + "type": "label" + }, "building": { "source": "mapbox streets", "layer": "building", "type": "fill" }, + "barrier_line_gate": { + "source": "mapbox streets", + "layer": "barrier_line", + "field": "class", + "value": "gate", + "type": "line" + }, + "barrier_line_fence": { + "source": "mapbox streets", + "layer": "barrier_line", + "field": "class", + "value": "fence", + "type": "line" + }, + "barrier_line_hedge": { + "source": "mapbox streets", + "layer": "barrier_line", + "field": "class", + "value": "hedge", + "type": "line" + }, + "barrier_line_land": { + "source": "mapbox streets", + "layer": "barrier_line", + "field": "class", + "value": "land", + "type": "line" + }, + "barrier_line_cliff": { + "source": "mapbox streets", + "layer": "barrier_line", + "field": "class", + "value": "cliff", + "type": "line" + }, "aeroway_fill": { "source": "mapbox streets", "layer": "aeroway", @@ -160,9 +303,9 @@ module.exports = { "layer": "road", "field": "class", "value": [ - "street", - "street_limited" - ], + "street", + "street_limited" + ], "join": "round", "cap": "round", "type": "line", @@ -183,8 +326,49 @@ module.exports = { "layer": "road", "field": "class", "value": "path", - "type": "line", - "enabled": 15 + "type": "line" + }, + "path_footway": { + "source": "mapbox streets", + "layer": "road", + "field": "type", + "value": "footway", + "type": "line" + }, + "path_path": { + "source": "mapbox streets", + "layer": "road", + "field": "type", + "value": "path", + "type": "line" + }, + "path_cycleway": { + "source": "mapbox streets", + "layer": "road", + "field": "type", + "value": "cycleway", + "type": "line" + }, + "path_mtb": { + "source": "mapbox streets", + "layer": "road", + "field": "type", + "value": "mtb", + "type": "line" + }, + "path_steps": { + "source": "mapbox streets", + "layer": "road", + "field": "type", + "value": "steps", + "type": "line" + }, + "path_piste": { + "source": "mapbox streets", + "layer": "road", + "field": "type", + "value": "piste", + "type": "line" }, "major_rail": { "source": "mapbox streets", @@ -198,8 +382,6 @@ module.exports = { "layer": "tunnel", "field": "class", "value": "motorway", - "join": "round", - "cap": "round", "type": "line" }, "tunnel_motorway_link": { @@ -207,8 +389,6 @@ module.exports = { "layer": "tunnel", "field": "class", "value": "motorway_link", - "join": "round", - "cap": "round", "type": "line" }, "tunnel_main": { @@ -216,8 +396,6 @@ module.exports = { "layer": "tunnel", "field": "class", "value": "main", - "join": "round", - "cap": "round", "type": "line" }, "tunnel_street": { @@ -225,28 +403,68 @@ module.exports = { "layer": "tunnel", "field": "class", "value": [ - "street", - "street_limited" - ], - "join": "round", - "type": "line" + "street", + "street_limited" + ], + "type": "line", + "enabled": 12 }, "tunnel_service": { "source": "mapbox streets", "layer": "tunnel", "field": "class", "value": "service", - "join": "round", - "cap": "round", - "type": "line" + "type": "line", + "enabled": 15 }, "tunnel_path": { "source": "mapbox streets", "layer": "tunnel", "field": "class", "value": "path", - "type": "line", - "enabled": 15 + "type": "line" + }, + "tunnel_path_footway": { + "source": "mapbox streets", + "layer": "tunnel", + "field": "type", + "value": "footway", + "type": "line" + }, + "tunnel_path_path": { + "source": "mapbox streets", + "layer": "tunnel", + "field": "type", + "value": "path", + "type": "line" + }, + "tunnel_path_cycleway": { + "source": "mapbox streets", + "layer": "tunnel", + "field": "type", + "value": "cycleway", + "type": "line" + }, + "tunnel_path_mtb": { + "source": "mapbox streets", + "layer": "tunnel", + "field": "type", + "value": "mtb", + "type": "line" + }, + "tunnel_path_steps": { + "source": "mapbox streets", + "layer": "tunnel", + "field": "type", + "value": "steps", + "type": "line" + }, + "tunnel_path_piste": { + "source": "mapbox streets", + "layer": "tunnel", + "field": "type", + "value": "piste", + "type": "line" }, "tunnel_major_rail": { "source": "mapbox streets", @@ -260,7 +478,6 @@ module.exports = { "layer": "bridge", "field": "class", "value": "motorway", - "join": "round", "type": "line" }, "bridge_motorway_link": { @@ -268,7 +485,6 @@ module.exports = { "layer": "bridge", "field": "class", "value": "motorway_link", - "join": "round", "type": "line" }, "bridge_main": { @@ -276,7 +492,6 @@ module.exports = { "layer": "bridge", "field": "class", "value": "main", - "join": "round", "type": "line" }, "bridge_street": { @@ -284,10 +499,9 @@ module.exports = { "layer": "bridge", "field": "class", "value": [ - "street", - "street_limited" - ], - "join": "round", + "street", + "street_limited" + ], "type": "line", "enabled": 12 }, @@ -296,10 +510,56 @@ module.exports = { "layer": "bridge", "field": "class", "value": "service", - "join": "round", "type": "line", "enabled": 15 }, + "bridge_path": { + "source": "mapbox streets", + "layer": "bridge", + "type": "line" + }, + "bridge_path_footway": { + "source": "mapbox streets", + "layer": "bridge", + "field": "type", + "value": "footway", + "type": "line" + }, + "bridge_path_path": { + "source": "mapbox streets", + "layer": "bridge", + "field": "type", + "value": "path", + "type": "line" + }, + "bridge_path_cycleway": { + "source": "mapbox streets", + "layer": "bridge", + "field": "type", + "value": "cycleway", + "type": "line" + }, + "bridge_path_mtb": { + "source": "mapbox streets", + "layer": "bridge", + "field": "type", + "value": "mtb", + "type": "line" + }, + "bridge_path_steps": { + "source": "mapbox streets", + "layer": "bridge", + "field": "type", + "value": "steps", + "type": "line" + }, + "bridge_path_piste": { + "source": "mapbox streets", + "layer": "bridge", + "field": "type", + "value": "piste", + "type": "line" + }, "bridge_major_rail": { "source": "mapbox streets", "layer": "bridge", @@ -307,13 +567,12 @@ module.exports = { "value": "major_rail", "type": "line" }, - "bridge_path": { + "bridge_aerialway": { "source": "mapbox streets", "layer": "bridge", "field": "class", - "value": "path", - "type": "line", - "enabled": 15 + "value": "aerialway", + "type": "line" }, "country_label": { "source": "mapbox streets", @@ -331,9 +590,9 @@ module.exports = { "type": "line", "enabled": 3 }, - "marin_label_1": { + "marine_label_1": { "source": "mapbox streets", - "layer": "marin_label", + "layer": "marine_label", "field": "labelrank", "value": 1, "feature_type": "line", @@ -342,9 +601,9 @@ module.exports = { "path": "curve", "fontSize": 22 }, - "marin_label_2": { + "marine_label_2": { "source": "mapbox streets", - "layer": "marin_label", + "layer": "marine_label", "field": "labelrank", "value": 2, "feature_type": "line", @@ -353,9 +612,9 @@ module.exports = { "path": "curve", "fontSize": 16 }, - "marin_label_3": { + "marine_label_3": { "source": "mapbox streets", - "layer": "marin_label", + "layer": "marine_label", "field": "labelrank", "value": 3, "feature_type": "line", @@ -409,10 +668,10 @@ module.exports = { "layer": "place_label", "field": "type", "value": [ - "hamlet", - "suburb", - "neighbourhood" - ], + "hamlet", + "suburb", + "neighbourhood" + ], "text_field": "name", "path": "horizontal", "fontSize": 14, @@ -459,50 +718,6 @@ module.exports = { }, "type": "point" }, - "poi_rail": { - "source": "mapbox streets", - "layer": "poi_label", - "field": "maki", - "value": "rail", - "size": { - "x": 12, - "y": 12 - }, - "type": "point" - }, - "poi_fire_station": { - "source": "mapbox streets", - "layer": "poi_label", - "field": "maki", - "value": "fire-station", - "size": { - "x": 12, - "y": 12 - }, - "type": "point" - }, - "poi_bus": { - "source": "mapbox streets", - "layer": "poi_label", - "field": "maki", - "value": "bus", - "size": { - "x": 12, - "y": 12 - }, - "type": "point" - }, - "poi_restaurant": { - "source": "mapbox streets", - "layer": "poi_label", - "field": "maki", - "value": "restaurant", - "size": { - "x": 12, - "y": 12 - }, - "type": "point" - }, "poi_park": { "source": "mapbox streets", "layer": "poi_label", @@ -513,1549 +728,2817 @@ module.exports = { "y": 12 }, "type": "point" - }, - "poi_playground": { - "source": "mapbox streets", - "layer": "poi_label", - "field": "maki", - "value": "playground", - "size": { - "x": 12, - "y": 12 - }, - "type": "point" - }, - "poi_hospital": { - "source": "mapbox streets", - "layer": "poi_label", - "field": "maki", - "value": "hospital", - "size": { - "x": 12, - "y": 12 - }, - "type": "point" - }, - "poi_cafe": { - "source": "mapbox streets", - "layer": "poi_label", - "field": "maki", - "value": "cafe", - "size": { - "x": 12, - "y": 12 - }, - "type": "point" - }, - "poi_beer": { - "source": "mapbox streets", - "layer": "poi_label", - "field": "maki", - "value": "beer", - "size": { - "x": 12, - "y": 12 - }, - "type": "point" } }, "constants": { - "land": "#f8f4f0", - "water": "#a0c8f0", - "park": "#d8e8c8", - "cemetary": "#e0e4dd", - "hospital": "#fde", - "school": "#f0e8f8", - "wood": "#6a4", - "building": "#f2eae2", - "building_shadow": "#dfdbd7", - "aeroway": "#f0ede9", - "motorway": "#fc8", - "motorway_casing": "#e9ac77", - "motorway_tunnel": "#ffdaa6", - "main": "#fea", - "main_tunnel": "#fff4c6", + "land": "#f4efe1", + "water": "#cdd", + "water_dark": "#185869", + "crop": "#eeeed4", + "grass": "#e7ebd1", + "scrub": "#e0e8cd", + "wood": "#d4e2c6", + "snow": "#f4f8ff", + "rock": "#ddd", + "sand": "#ffd", + "cemetary": "#edf4ed", + "pitch": "#fff", + "park": "#d4e4bc", + "piste": "blue", + "school": "#e8dfe0", + "hospital": "#f8eee0", + "builtup": "#f6faff", + "case": "#fff", + "motorway": "#d7a8a8", + "main": "#ddc0b9", "street": "#fff", - "street_limited": "#f3f3f3", - "street_casing": "#cfcdca", - "path": "#cba", - "rail": "#bbb", - "text": "#334", - "marine_text": "#8dbeed", - "maki": "#666", - "point_translate": [ - 0, -30 - ] + "text": "#666" }, - "structure": [{ - "name": "background", - "bucket": "background" - }, { - "name": "waterway_other", - "bucket": "waterway_other" - }, { - "name": "waterway_river", - "bucket": "waterway_river" - }, { - "name": "waterway_stream_canal", - "bucket": "waterway_stream_canal" - }, { - "name": "landuse_park", - "bucket": "landuse_park" - }, { - "name": "landuse_cemetary", - "bucket": "landuse_cemetary" - }, { - "name": "landuse_hospital", - "bucket": "landuse_hospital" - }, { - "name": "landuse_school", - "bucket": "landuse_school" - }, { - "name": "landuse_wood", - "bucket": "landuse_wood" - }, { - "name": "water", - "bucket": "water" - }, { - "name": "water_offset", - "bucket": "water" - }, { - "name": "aeroway_fill", - "bucket": "aeroway_fill" - }, { - "name": "aeroway_runway", - "bucket": "aeroway_runway" - }, { - "name": "aeroway_taxiway", - "bucket": "aeroway_taxiway" - }, { - "name": "building_shadow", - "bucket": "building" - }, { - "name": "building", - "bucket": "building" - }, { - "name": "building_wall", - "bucket": "building" - }, { - "name": "tunnel_motorway_link_casing", - "bucket": "tunnel_motorway_link" - }, { - "name": "tunnel_motorway_casing", - "bucket": "tunnel_motorway" - }, { - "name": "tunnel_motorway_link", - "bucket": "tunnel_motorway_link" - }, { - "name": "tunnel_motorway", - "bucket": "tunnel_motorway" - }, { - "name": "tunnel_path", - "bucket": "tunnel_path" - }, { - "name": "tunnel_major_rail", - "bucket": "tunnel_major_rail" - }, { - "name": "tunnel_major_rail_hatching", - "bucket": "tunnel_major_rail" - }, { - "name": "tunnel_service_casing", - "bucket": "tunnel_service" - }, { - "name": "tunnel_service", - "bucket": "tunnel_service" - }, { - "name": "tunnel_main_casing", - "bucket": "tunnel_main" - }, { - "name": "tunnel_street_casing", - "bucket": "tunnel_street" - }, { - "name": "tunnel_street", - "bucket": "tunnel_street" - }, { - "name": "tunnel_main", - "bucket": "tunnel_main" - }, { - "name": "road_motorway_link_casing", - "bucket": "motorway_link" - }, { - "name": "road_service_casing", - "bucket": "service" - }, { - "name": "road_main_casing", - "bucket": "main" - }, { - "name": "road_street_casing", - "bucket": "street" - }, { - "name": "road_motorway_link", - "bucket": "motorway_link" - }, { - "name": "road_service", - "bucket": "service" - }, { - "name": "road_street", - "bucket": "street" - }, { - "name": "road_main", - "bucket": "main" - }, { - "name": "road_motorway_casing", - "bucket": "motorway" - }, { - "name": "road_motorway", - "bucket": "motorway" - }, { - "name": "bridge_service_casing", - "bucket": "bridge_service" - }, { - "name": "bridge_service", - "bucket": "bridge_service" - }, { - "name": "bridge_main_casing", - "bucket": "bridge_main" - }, { - "name": "bridge_main", - "bucket": "bridge_main" - }, { - "name": "bridge_street_casing", - "bucket": "bridge_street" - }, { - "name": "bridge_street", - "bucket": "bridge_street" - }, { - "name": "bridge_motorway_link_casing", - "bucket": "bridge_motorway_link" - }, { - "name": "bridge_motorway_link", - "bucket": "bridge_motorway_link" - }, { - "name": "bridge_motorway_casing", - "bucket": "bridge_motorway" - }, { - "name": "bridge_motorway", - "bucket": "bridge_motorway" - }, { - "name": "road_path", - "bucket": "path" - }, { - "name": "road_major_rail", - "bucket": "major_rail" - }, { - "name": "road_major_rail_hatching", - "bucket": "major_rail" - }, { - "name": "bridge_path", - "bucket": "bridge_path" - }, { - "name": "bridge_major_rail", - "bucket": "bridge_major_rail" - }, { - "name": "bridge_major_rail_hatching", - "bucket": "bridge_major_rail" - }, { - "name": "admin_level_3", - "bucket": "admin_level_3" - }, { - "name": "admin_level_2", - "bucket": "admin_level_2" - }, { - "name": "admin_maritime", - "bucket": "admin_maritime" - }, { - "name": "country_label_line", - "bucket": "country_label_line" - }, { - "name": "country_label", - "bucket": "country_label" - }, { - "name": "marin_label_1", - "bucket": "marin_label_1" - }, { - "name": "marin_label_2", - "bucket": "marin_label_2" - }, { - "name": "marin_label_3", - "bucket": "marin_label_3" - }, { - "name": "place_label_city_point", - "bucket": "place_label_city_point" - }, { - "name": "place_label_city", - "bucket": "place_label_city" - }, { - "name": "place_label_town", - "bucket": "place_label_town" - }, { - "name": "place_label_village", - "bucket": "place_label_village" - }, { - "name": "place_label_other", - "bucket": "place_label_other" - }, { - "name": "road_label", - "bucket": "road_label" - }, { - "name": "poi_label", - "bucket": "poi_label" - }, { - "name": "water_label", - "bucket": "water_label" - }, { - "name": "poi_airport", - "bucket": "poi_airport" - }, { - "name": "poi_rail", - "bucket": "poi_rail" - }, { - "name": "poi_bus", - "bucket": "poi_bus" - }, { - "name": "poi_fire_station", - "bucket": "poi_fire_station" - }, { - "name": "poi_restaurant", - "bucket": "poi_restaurant" - }, { - "name": "poi_park", - "bucket": "poi_park" - }, { - "name": "poi_hospital", - "bucket": "poi_hospital" - }, { - "name": "poi_playground", - "bucket": "poi_playground" - }, { - "name": "poi_cafe", - "bucket": "poi_cafe" - }, { - "name": "poi_beer", - "bucket": "poi_beer" - }], - "classes": [{ - "name": "default", - "layers": { - "background": { - "color": "land", - }, - "admin_maritime": { - "color": "#cfe0fa", - "width": 4.5, - }, - "admin_level_2": { - "color": "#446", + "structure": [ + { + "name": "background", + "bucket": "background" + }, + { + "name": "waterway_other", + "bucket": "waterway_other" + }, + { + "name": "waterway_river_canal", + "bucket": "waterway_river_canal" + }, + { + "name": "waterway_stream", + "bucket": "waterway_stream" + }, + { + "name": "landcover_wood", + "bucket": "landcover_wood" + }, + { + "name": "landcover_scrub", + "bucket": "landcover_scrub" + }, + { + "name": "landcover_grass", + "bucket": "landcover_grass" + }, + { + "name": "landcover_crop", + "bucket": "landcover_crop" + }, + { + "name": "landcover_snow", + "bucket": "landcover_snow" + }, + { + "name": "landuse_park", + "bucket": "landuse_park" + }, + { + "name": "landuse_pitch", + "bucket": "landuse_pitch" + }, + { + "name": "landuse_cemetary", + "bucket": "landuse_cemetary" + }, + { + "name": "landuse_hospital", + "bucket": "landuse_hospital" + }, + { + "name": "landuse_industrial", + "bucket": "landuse_indusrial" + }, + { + "name": "landuse_school", + "bucket": "landuse_school" + }, + { + "name": "overlay_wetland", + "bucket": "overlay_wetland" + }, + { + "name": "overlay_wetland_noveg", + "bucket": "overlay_wetland_noveg" + }, + { + "name": "overlay_breakwater_pier", + "bucket": "overlay_breakwater_pier" + }, + { + "name": "hillshade_full_shadow", + "bucket": "hillshade_full_shadow" + }, + { + "name": "hillshade_medium_shadow", + "bucket": "hillshade_medium_shadow" + }, + { + "name": "hillshade_medium_highlight", + "bucket": "hillshade_medium_highlight" + }, + { + "name": "hillshade_full_highlight", + "bucket": "hillshade_full_highlight" + }, + { + "name": "contour_line_10", + "bucket": "contour_line_10" + }, + { + "name": "contour_line_other", + "bucket": "contour_line_other" + }, + { + "name": "contour_label", + "bucket": "contour_label" + }, + { + "name": "barrier_line_gate", + "bucket": "barrier_line_gate" + }, + { + "name": "barrier_line_fence", + "bucket": "barrier_line_fence" + }, + { + "name": "barrier_line_hedge", + "bucket": "barrier_line_hedge" + }, + { + "name": "barrier_line_land", + "bucket": "barrier_line_land" + }, + { + "name": "barrier_line_cliff", + "bucket": "barrier_line_cliff" + }, + { + "name": "water", + "bucket": "water" + }, + { + "name": "aeroway_fill", + "bucket": "aeroway_fill" + }, + { + "name": "aeroway_runway", + "bucket": "aeroway_runway" + }, + { + "name": "aeroway_taxiway", + "bucket": "aeroway_taxiway" + }, + { + "name": "building_shadow", + "bucket": "building" + }, + { + "name": "building", + "bucket": "building" + }, + { + "name": "building_wall", + "bucket": "building" + }, + { + "name": "tunnel_motorway_link_casing", + "bucket": "tunnel_motorway_link" + }, + { + "name": "tunnel_service_casing", + "bucket": "tunnel_service" + }, + { + "name": "tunnel_main_casing", + "bucket": "tunnel_main" + }, + { + "name": "tunnel_street_casing", + "bucket": "tunnel_street" + }, + { + "name": "tunnel_motorway_link", + "bucket": "tunnel_motorway_link" + }, + { + "name": "tunnel_service", + "bucket": "tunnel_service" + }, + { + "name": "tunnel_street", + "bucket": "tunnel_street" + }, + { + "name": "tunnel_main", + "bucket": "tunnel_main" + }, + { + "name": "tunnel_motorway_casing", + "bucket": "tunnel_motorway" + }, + { + "name": "tunnel_motorway", + "bucket": "tunnel_motorway" + }, + { + "name": "road_path_case", + "bucket": "tunnel_path" + }, + { + "name": "road_path_footway", + "bucket": "tunnel_path_footway" + }, + { + "name": "road_path_path", + "bucket": "tunnel_path_path" + }, + { + "name": "road_path_cycleway", + "bucket": "tunnel_path_cycleway" + }, + { + "name": "road_path_mtb", + "bucket": "tunnel_path_mtb" + }, + { + "name": "road_path_piste", + "bucket": "tunnel_path_piste" + }, + { + "name": "road_path_steps", + "bucket": "tunnel_path_steps" + }, + { + "name": "road_major_rail", + "bucket": "tunnel_major_rail" + }, + { + "name": "road_major_rail_hatching", + "bucket": "tunnel_major_rail" + }, + { + "name": "road_motorway_link_casing", + "bucket": "motorway_link" + }, + { + "name": "road_service_casing", + "bucket": "service" + }, + { + "name": "road_main_casing", + "bucket": "main" + }, + { + "name": "road_street_casing", + "bucket": "street" + }, + { + "name": "road_motorway_link", + "bucket": "motorway_link" + }, + { + "name": "road_service", + "bucket": "service" + }, + { + "name": "road_street", + "bucket": "street" + }, + { + "name": "road_main", + "bucket": "main" + }, + { + "name": "road_motorway_casing", + "bucket": "motorway" + }, + { + "name": "road_motorway", + "bucket": "motorway" + }, + { + "name": "road_path_case", + "bucket": "path" + }, + { + "name": "road_path_footway", + "bucket": "path_footway" + }, + { + "name": "road_path_path", + "bucket": "path_path" + }, + { + "name": "road_path_cycleway", + "bucket": "path_cycleway" + }, + { + "name": "road_path_mtb", + "bucket": "path_mtb" + }, + { + "name": "road_path_piste", + "bucket": "path_piste" + }, + { + "name": "road_path_steps", + "bucket": "path_steps" + }, + { + "name": "road_major_rail", + "bucket": "major_rail" + }, + { + "name": "road_major_rail_hatching", + "bucket": "major_rail" + }, + { + "name": "bridge_motorway_link_casing", + "bucket": "bridge_motorway_link" + }, + { + "name": "bridge_service_casing", + "bucket": "bridge_service" + }, + { + "name": "bridge_main_casing", + "bucket": "bridge_main" + }, + { + "name": "bridge_street_casing", + "bucket": "bridge_street" + }, + { + "name": "bridge_motorway_link", + "bucket": "bridge_motorway_link" + }, + { + "name": "bridge_service", + "bucket": "bridge_service" + }, + { + "name": "bridge_street", + "bucket": "bridge_street" + }, + { + "name": "bridge_main", + "bucket": "bridge_main" + }, + { + "name": "bridge_motorway_casing", + "bucket": "bridge_motorway" + }, + { + "name": "bridge_motorway", + "bucket": "bridge_motorway" + }, + { + "name": "road_path_footway", + "bucket": "bridge_path_footway" + }, + { + "name": "road_path_path", + "bucket": "bridge_path_path" + }, + { + "name": "road_path_cycleway", + "bucket": "bridge_path_cycleway" + }, + { + "name": "road_path_mtb", + "bucket": "bridge_path_mtb" + }, + { + "name": "road_path_piste", + "bucket": "bridge_path_piste" + }, + { + "name": "road_path_steps", + "bucket": "bridge_path_steps" + }, + { + "name": "bridge_aerialway_casing", + "bucket": "bridge_aerialway" + }, + { + "name": "bridge_aerialway", + "bucket": "bridge_aerialway" + }, + { + "name": "road_major_rail", + "bucket": "bridge_major_rail" + }, + { + "name": "road_major_rail_hatching", + "bucket": "bridge_major_rail" + }, + { + "name": "admin_level_3", + "bucket": "admin_level_3" + }, + { + "name": "admin_level_2", + "bucket": "admin_level_2" + }, + { + "name": "admin_maritime", + "bucket": "admin_maritime" + } + ], + "classes": [ + { + "name": "default", + "layers": { + "background": { + "color": "land" + }, + "admin_maritime": { + "color": "#c0d6d6", + "width": 4.5 + }, + "admin_level_2": { + "color": "#88a", "width": [ - "stops", { - "z": 0, - "val": 1.5 - }, { - "z": 6, - "val": 1.5 - }, { - "z": 8, - "val": 3 - }, { - "z": 22, - "val": 3 - } - ], - }, - "admin_level_3": { - "color": "#446", + "stops", + { + "z": 0, + "val": 0.4 + }, + { + "z": 2, + "val": 0.4 + }, + { + "z": 3, + "val": 0.8 + }, + { + "z": 4, + "val": 1 + }, + { + "z": 5, + "val": 1.5 + }, + { + "z": 6, + "val": 2 + }, + { + "z": 8, + "val": 3 + }, + { + "z": 10, + "val": 4 + }, + { + "z": 22, + "val": 4 + } + ] + }, + "admin_level_3": { + "color": "#88a", "dasharray": [ - 30, - 5 - ], + 30, + 5 + ], "width": [ - "stops", { - "z": 0, - "val": 0.5 - }, { - "z": 6, - "val": 0.5 - }, { - "z": 8, - "val": 1 - }, { - "z": 12, - "val": 1.5 - }, { - "z": 22, - "val": 1.5 - } - ], - }, - "waterway_other": { + "stops", + { + "z": 0, + "val": 0.4 + }, + { + "z": 6, + "val": 1 + }, + { + "z": 8, + "val": 2 + }, + { + "z": 12, + "val": 3 + }, + { + "z": 22, + "val": 3 + } + ] + }, + "waterway_other": { "color": "water", + "width": 0.5 + }, + "waterway_river_canal": { + "color": "#87abaf", + "width": [ + "stops", + { + "z": 0, + "val": 0.5 + }, + { + "z": 12, + "val": 1 + }, + { + "z": 14, + "val": 2 + }, + { + "z": 16, + "val": 3 + }, + { + "z": 22, + "val": 3 + } + ] + }, + "waterway_stream": { + "color": "#87abaf", + "width": [ + "stops", + { + "z": 0, + "val": 0.25 + }, + { + "z": 13, + "val": 0.25 + }, + { + "z": 14, + "val": 0.5 + }, + { + "z": 16, + "val": 1.5 + }, + { + "z": 18, + "val": 2 + }, + { + "z": 22, + "val": 2 + } + ] + }, + "landcover_wood": { + "color": "wood" + }, + "landcover_scrub": { + "color": "scrub" + }, + "landcover_grass": { + "color": "grass" + }, + "landcover_crop": { + "color": "crop" + }, + "landcover_snow": { + "color": "snow" + }, + "landuse_park": { + "color": "park" + }, + "landuse_cemetary": { + "color": "cemetary" + }, + "landuse_hospital": { + "color": "hospital" + }, + "landuse_school": { + "color": "school" + }, + "landuse_pitch": { + "color": "rgba(255,255,255,0.5)", + "stroke": "pitch" + }, + "hillshade_full_shadow": { + "color": "#103", + "opacity": [ + "stops", + { + "z": 0, + "val": 0.08 + }, + { + "z": 15, + "val": 0.075 + }, + { + "z": 17, + "val": 0.05 + }, + { + "z": 18, + "val": 0.025 + }, + { + "z": 22, + "val": 0.025 + } + ] + }, + "hillshade_medium_shadow": { + "color": "#206", + "opacity": [ + "stops", + { + "z": 0, + "val": 0.08 + }, + { + "z": 15, + "val": 0.075 + }, + { + "z": 17, + "val": 0.05 + }, + { + "z": 18, + "val": 0.025 + }, + { + "z": 22, + "val": 0.025 + } + ] + }, + "hillshade_full_highlight": { + "color": "#ffd", + "opacity": [ + "stops", + { + "z": 0, + "val": 0.25 + }, + { + "z": 15, + "val": 0.3 + }, + { + "z": 17, + "val": 0.2 + }, + { + "z": 18, + "val": 0.1 + }, + { + "z": 22, + "val": 0.1 + } + ] + }, + "hillshade_medium_highlight": { + "color": "#ffb", + "opacity": [ + "stops", + { + "z": 0, + "val": 0.2 + }, + { + "z": 15, + "val": 0.3 + }, + { + "z": 17, + "val": 0.2 + }, + { + "z": 18, + "val": 0.1 + }, + { + "z": 22, + "val": 0.1 + } + ] + }, + "contour_line_10": { + "color": "#008", + "width": 1.2, + "opacity": [ + "stops", + { + "z": 0, + "val": 0.06 + }, + { + "z": 12, + "val": 0.06 + }, + { + "z": 13, + "val": 0.12 + }, + { + "z": 22, + "val": 0.12 + } + ] + }, + "contour_line_other": { + "color": "#008", "width": 0.5, - }, - "waterway_river": { + "opacity": [ + "stops", + { + "z": 0, + "val": 0.06 + }, + { + "z": 12, + "val": 0.06 + }, + { + "z": 13, + "val": 0.12 + }, + { + "z": 22, + "val": 0.12 + } + ] + }, + "water": { "color": "water", + "stroke": "#a2bdc0" + }, + "aeroway_fill": { + "color": "#ddd" + }, + "aeroway_runway": { + "color": "#ddd", "width": [ - "stops", { - "z": 0, - "val": 1 - }, { - "z": 12, - "val": 1 - }, { - "z": 14, - "val": 2 - }, { - "z": 16, - "val": 3 - }, { - "z": 22, - "val": 3 - } - ], - }, - "waterway_stream_canal": { - "color": "water", + "stops", + { + "z": 10, + "val": 1 + }, + { + "z": 11, + "val": 2 + }, + { + "z": 12, + "val": 3 + }, + { + "z": 13, + "val": 5 + }, + { + "z": 14, + "val": 7 + }, + { + "z": 15, + "val": 11 + }, + { + "z": 16, + "val": 15 + }, + { + "z": 17, + "val": 19 + }, + { + "z": 18, + "val": 23 + }, + { + "z": 22, + "val": 23 + } + ] + }, + "aeroway_taxiway": { + "color": "#ddd", "width": [ - "stops", { - "z": 0, - "val": 1 - }, { - "z": 14, - "val": 1 - }, { - "z": 16, - "val": 2 - }, { - "z": 18, - "val": 3 - }, { - "z": 22, - "val": 3 - } - ], - }, - "landuse_park": { - "color": "park", - }, - "landuse_cemetary": { - "color": "cemetary", - }, - "landuse_hospital": { - "color": "hospital", - }, - "landuse_school": { - "color": "school", - }, - "landuse_wood": { - "color": "wood", - "opacity": 0.1, - }, - "water": { - "color": "water", - }, - "water_offset": { - "color": "#f0f0ff", - "image": "wave", + "stops", + { + "z": 10, + "val": 0.2 + }, + { + "z": 12, + "val": 0.2 + }, + { + "z": 13, + "val": 1 + }, + { + "z": 14, + "val": 1.5 + }, + { + "z": 15, + "val": 2 + }, + { + "z": 16, + "val": 3 + }, + { + "z": 17, + "val": 4 + }, + { + "z": 18, + "val": 5 + }, + { + "z": 22, + "val": 5 + } + ] + }, + "building": { + "color": "#ebe7db" + }, + "building_wall": { + "color": "#ebe7db", + "stroke": "#d5d1c6", + "opacity": [ + "stops", + { + "z": 0, + "val": 0 + }, + { + "z": 16.5, + "val": 0 + }, + { + "z": 17, + "val": 0.7 + }, + { + "z": 22, + "val": 0.7 + } + ] + }, + "building_shadow": { + "color": "#d5d1c6", + "stroke": "#d5d1c6", + "translate": [ + 2, + 2 + ], + "opacity": [ + "stops", + { + "z": 0, + "val": 0 + }, + { + "z": 16.5, + "val": 0 + }, + { + "z": 17, + "val": 1 + }, + { + "z": 22, + "val": 1 + } + ] + }, + "tunnel_motorway_casing": { + "color": "case", + "dasharray": [ + 6, + 6 + ], + "width": [ + "stops", + { + "z": 0, + "val": 0.6 + }, + { + "z": 7.5, + "val": 0.6 + }, + { + "z": 8, + "val": 0.8 + }, + { + "z": 10, + "val": 2.8 + }, + { + "z": 11, + "val": 3 + }, + { + "z": 12, + "val": 4 + }, + { + "z": 13, + "val": 5 + }, + { + "z": 14, + "val": 6.5 + }, + { + "z": 15, + "val": 9 + }, + { + "z": 16, + "val": 12 + }, + { + "z": 17, + "val": 15 + }, + { + "z": 18, + "val": 17 + }, + { + "z": 22, + "val": 17 + } + ], + "opacity": [ + "stops", + { + "z": 0, + "val": 0 + }, + { + "z": 9.5, + "val": 0 + }, + { + "z": 10, + "val": 1 + }, + { + "z": 22, + "val": 1 + } + ] + }, + "tunnel_motorway": { + "color": "#e6cec7", + "width": [ + "stops", + { + "z": 0, + "val": 0 + }, + { + "z": 5, + "val": 0 + }, + { + "z": 6, + "val": 0.5 + }, + { + "z": 8, + "val": 0.8 + }, + { + "z": 10, + "val": 1 + }, + { + "z": 11, + "val": 1.2 + }, + { + "z": 12, + "val": 2 + }, + { + "z": 13, + "val": 3 + }, + { + "z": 14, + "val": 4 + }, + { + "z": 15, + "val": 6 + }, + { + "z": 16, + "val": 9 + }, + { + "z": 17, + "val": 12 + }, + { + "z": 18, + "val": 14 + }, + { + "z": 22, + "val": 14 + } + ], + "opacity": [ + "stops", + { + "z": 0, + "val": 0 + }, + { + "z": 6.5, + "val": 0 + }, + { + "z": 7, + "val": 1 + }, + { + "z": 22, + "val": 1 + } + ] + }, + "tunnel_main_casing": { + "color": "case", + "dasharray": [ + 6, + 6 + ], + "width": [ + "stops", + { + "z": 10, + "val": 2.9 + }, + { + "z": 13, + "val": 2.9 + }, + { + "z": 14, + "val": 3.5 + }, + { + "z": 15, + "val": 4 + }, + { + "z": 16, + "val": 5.5 + }, + { + "z": 17, + "val": 9 + }, + { + "z": 18, + "val": 15 + }, + { + "z": 22, + "val": 15 + } + ] + }, + "tunnel_main": { + "color": "#e6cec7", + "width": [ + "stops", + { + "z": 6, + "val": 1 + }, + { + "z": 12, + "val": 1 + }, + { + "z": 13, + "val": 1 + }, + { + "z": 14, + "val": 1.5 + }, + { + "z": 15, + "val": 2 + }, + { + "z": 16, + "val": 3 + }, + { + "z": 17, + "val": 6 + }, + { + "z": 18, + "val": 10 + }, + { + "z": 19, + "val": 12 + }, + { + "z": 22, + "val": 12 + } + ], + "opacity": [ + "stops", + { + "z": 0, + "val": 0 + }, + { + "z": 6.5, + "val": 0 + }, + { + "z": 7, + "val": 1 + }, + { + "z": 22, + "val": 1 + } + ] + }, + "tunnel_motorway_link_casing": { + "color": "case", + "dasharray": [ + 6, + 6 + ], + "width": [ + "stops", + { + "z": 12, + "val": 2.8 + }, + { + "z": 14, + "val": 3.5 + }, + { + "z": 16, + "val": 5 + }, + { + "z": 18, + "val": 6 + }, + { + "z": 22, + "val": 6 + } + ] + }, + "tunnel_motorway_link": { + "color": "#e6cec7", + "width": [ + "stops", + { + "z": 12, + "val": 1.2 + }, + { + "z": 14, + "val": 2 + }, + { + "z": 16, + "val": 3 + }, + { + "z": 18, + "val": 4 + }, + { + "z": 22, + "val": 4 + } + ] + }, + "tunnel_street_casing_group": { + "opacity": [ + "stops", + { + "z": 0, + "val": 0 + }, + { + "z": 12.5, + "val": 0 + }, + { + "z": 13.5, + "val": 0.6 + }, + { + "z": 22, + "val": 0.6 + } + ] + }, + "tunnel_street_casing": { + "color": "#d9d5c6", + "width": [ + "stops", + { + "z": 10, + "val": 0.5 + }, + { + "z": 12.5, + "val": 0.5 + }, + { + "z": 13, + "val": 0.5 + }, + { + "z": 14, + "val": 2.25 + }, + { + "z": 15, + "val": 5 + }, + { + "z": 16, + "val": 7 + }, + { + "z": 17, + "val": 9 + }, + { + "z": 18, + "val": 11 + }, + { + "z": 22, + "val": 11 + } + ] + }, + "tunnel_street_group": { + "opacity": [ + "stops", + { + "z": 0, + "val": 0 + }, + { + "z": 13.5, + "val": 0 + }, + { + "z": 14.25, + "val": 1 + }, + { + "z": 22, + "val": 1 + } + ] + }, + "tunnel_street": { + "color": "#d9d5c6", + "width": [ + "stops", + { + "z": 11, + "val": 0 + }, + { + "z": 12.5, + "val": 0 + }, + { + "z": 13, + "val": 0.6 + }, + { + "z": 14, + "val": 1.2 + }, + { + "z": 15, + "val": 1.8 + }, + { + "z": 16, + "val": 3 + }, + { + "z": 17, + "val": 5 + }, + { + "z": 18, + "val": 8 + }, + { + "z": 22, + "val": 8 + } + ] + }, + "tunnel_service_casing": { + "color": "#000", + "opacity": 0.04, + "dasharray": [ + 6, + 6 + ], + "width": [ + "stops", + { + "z": 0, + "val": 0.5 + }, + { + "z": 14, + "val": 0.5 + }, + { + "z": 15, + "val": 3 + }, + { + "z": 16, + "val": 3.5 + }, + { + "z": 17, + "val": 4 + }, + { + "z": 18, + "val": 5 + }, + { + "z": 19, + "val": 6 + }, + { + "z": 22, + "val": 6 + } + ] + }, + "tunnel_service": { + "color": "#e6cec7", + "width": 2 + }, + "road_motorway_casing": { + "color": "case", + "width": [ + "stops", + { + "z": 0, + "val": 0.6 + }, + { + "z": 7.5, + "val": 0.6 + }, + { + "z": 8, + "val": 0.8 + }, + { + "z": 10, + "val": 2.8 + }, + { + "z": 11, + "val": 3 + }, + { + "z": 12, + "val": 4 + }, + { + "z": 13, + "val": 5 + }, + { + "z": 14, + "val": 6.5 + }, + { + "z": 15, + "val": 9 + }, + { + "z": 16, + "val": 12 + }, + { + "z": 17, + "val": 15 + }, + { + "z": 18, + "val": 17 + }, + { + "z": 22, + "val": 17 + } + ], + "opacity": [ + "stops", + { + "z": 0, + "val": 0 + }, + { + "z": 9.5, + "val": 0 + }, + { + "z": 10, + "val": 1 + }, + { + "z": 22, + "val": 1 + } + ] + }, + "road_motorway": { + "color": "motorway", + "width": [ + "stops", + { + "z": 0, + "val": 0 + }, + { + "z": 5, + "val": 0 + }, + { + "z": 6, + "val": 0.5 + }, + { + "z": 8, + "val": 0.8 + }, + { + "z": 10, + "val": 1 + }, + { + "z": 11, + "val": 1.2 + }, + { + "z": 12, + "val": 2 + }, + { + "z": 13, + "val": 3 + }, + { + "z": 14, + "val": 4 + }, + { + "z": 15, + "val": 6 + }, + { + "z": 16, + "val": 9 + }, + { + "z": 17, + "val": 12 + }, + { + "z": 18, + "val": 14 + }, + { + "z": 22, + "val": 14 + } + ], + "opacity": [ + "stops", + { + "z": 0, + "val": 0 + }, + { + "z": 6.5, + "val": 0 + }, + { + "z": 7, + "val": 1 + }, + { + "z": 22, + "val": 1 + } + ] + }, + "road_main_casing": { + "color": "case", + "width": [ + "stops", + { + "z": 10, + "val": 2.9 + }, + { + "z": 13, + "val": 2.9 + }, + { + "z": 14, + "val": 3.5 + }, + { + "z": 15, + "val": 4 + }, + { + "z": 16, + "val": 5.5 + }, + { + "z": 17, + "val": 9 + }, + { + "z": 18, + "val": 15 + }, + { + "z": 22, + "val": 15 + } + ] + }, + "road_main": { + "color": "main", + "width": [ + "stops", + { + "z": 6, + "val": 1 + }, + { + "z": 12, + "val": 1 + }, + { + "z": 13, + "val": 1 + }, + { + "z": 14, + "val": 1.5 + }, + { + "z": 15, + "val": 2 + }, + { + "z": 16, + "val": 3 + }, + { + "z": 17, + "val": 6 + }, + { + "z": 18, + "val": 10 + }, + { + "z": 19, + "val": 12 + }, + { + "z": 22, + "val": 12 + } + ], + "opacity": [ + "stops", + { + "z": 0, + "val": 0 + }, + { + "z": 6.5, + "val": 0 + }, + { + "z": 7, + "val": 1 + }, + { + "z": 22, + "val": 1 + } + ] + }, + "road_motorway_link_casing": { + "color": "case", + "width": [ + "stops", + { + "z": 12, + "val": 2.8 + }, + { + "z": 14, + "val": 3.5 + }, + { + "z": 16, + "val": 5 + }, + { + "z": 18, + "val": 6 + }, + { + "z": 22, + "val": 6 + } + ] + }, + "road_motorway_link": { + "color": "motorway", + "width": [ + "stops", + { + "z": 12, + "val": 1.2 + }, + { + "z": 14, + "val": 2 + }, + { + "z": 16, + "val": 3 + }, + { + "z": 18, + "val": 4 + }, + { + "z": 22, + "val": 4 + } + ] + }, + "road_street_casing": { + "color": "#d9d5c6", + "width": [ + "stops", + { + "z": 10, + "val": 0.5 + }, + { + "z": 12.5, + "val": 0.5 + }, + { + "z": 13, + "val": 0.5 + }, + { + "z": 14, + "val": 2.25 + }, + { + "z": 15, + "val": 5 + }, + { + "z": 16, + "val": 7 + }, + { + "z": 17, + "val": 9 + }, + { + "z": 18, + "val": 11 + }, + { + "z": 22, + "val": 11 + } + ], + "opacity": [ + "stops", + { + "z": 0, + "val": 0 + }, + { + "z": 12.5, + "val": 0 + }, + { + "z": 13.5, + "val": 0.6 + }, + { + "z": 22, + "val": 0.6 + } + ] + }, + "road_street": { + "color": "street", + "opacity": [ + "stops", + { + "z": 0, + "val": 0 + }, + { + "z": 13.5, + "val": 0 + }, + { + "z": 14.25, + "val": 1 + }, + { + "z": 22, + "val": 1 + } + ], + "width": [ + "stops", + { + "z": 11, + "val": 0 + }, + { + "z": 12.5, + "val": 0 + }, + { + "z": 13, + "val": 0.6 + }, + { + "z": 14, + "val": 1.2 + }, + { + "z": 15, + "val": 1.8 + }, + { + "z": 16, + "val": 3 + }, + { + "z": 17, + "val": 5 + }, + { + "z": 18, + "val": 8 + }, + { + "z": 22, + "val": 8 + } + ] + }, + "road_service_casing": { + "color": "#000", + "opacity": 0.04, + "width": [ + "stops", + { + "z": 0, + "val": 0.5 + }, + { + "z": 14, + "val": 0.5 + }, + { + "z": 15, + "val": 3 + }, + { + "z": 16, + "val": 3.5 + }, + { + "z": 17, + "val": 4 + }, + { + "z": 18, + "val": 5 + }, + { + "z": 19, + "val": 6 + }, + { + "z": 22, + "val": 6 + } + ] + }, + "road_service": { + "color": "street", + "width": 2 + }, + "road_path_case": { + "color": "#ffd", "opacity": 0.4, - "translate": [ - 0, - 2.5 - ], - }, - "aeroway_fill": { - "color": "aeroway", - "opacity": 0.7, - }, - "aeroway_runway": { - "color": "aeroway", - "width": 5, - }, - "aeroway_taxiway": { - "color": "aeroway", - "width": 1.5, - }, - "building": { - "color": "building", - }, - "building_wall": { - "color": "building", - "stroke": "building_shadow", - "opacity": [ - "stops", { - "z": 0, - "val": 0 - }, { - "z": 17, - "val": 0 - }, { - "z": 18, - "val": 1 - }, { - "z": 22, - "val": 1 - } - ], - }, - "building_shadow": { - "color": "building_shadow", - "translate": [ - 2, - 2 - ], - "opacity": [ - "stops", { - "z": 0, - "val": 0 - }, { - "z": 17, - "val": 0 - }, { - "z": 18, - "val": 1 - }, { - "z": 22, - "val": 1 - } - ], - }, - "road_motorway_casing": { - "color": "motorway_casing", "width": [ - "stops", { - "z": 6, - "val": 0.4 - }, { - "z": 7, - "val": 0.6 - }, { - "z": 8, - "val": 1.5 - }, { - "z": 10, - "val": 3 - }, { - "z": 13, - "val": 3.5 - }, { - "z": 14, - "val": 5 - }, { - "z": 15, - "val": 7 - }, { - "z": 16, - "val": 9 - }, { - "z": 22, - "val": 9 - } - ], - }, - "road_motorway": { + "stops", + { + "z": 10, + "val": 3 + }, + { + "z": 16, + "val": 3 + }, + { + "z": 17, + "val": 4 + }, + { + "z": 22, + "val": 4 + } + ] + }, + "road_path_footway": { + "color": "#bba", + "dasharray": [ + 4, + 2 + ], + "width": [ + "stops", + { + "z": 15, + "val": 1.2 + }, + { + "z": 16, + "val": 1.5 + }, + { + "z": 17, + "val": 1.8 + }, + { + "z": 22, + "val": 1.8 + } + ] + }, + "road_path_path": { + "color": "#987", + "dasharray": [ + 6, + 2 + ], + "opacity": 0.8, + "width": [ + "stops", + { + "z": 15, + "val": 0.8 + }, + { + "z": 16, + "val": 0.9 + }, + { + "z": 17, + "val": 1.2 + }, + { + "z": 22, + "val": 1.2 + } + ] + }, + "road_path_cycleway": { + "color": "#488", + "dasharray": [ + 4, + 2 + ], + "width": [ + "stops", + { + "z": 15, + "val": 1.2 + }, + { + "z": 16, + "val": 1.5 + }, + { + "z": 17, + "val": 1.8 + }, + { + "z": 22, + "val": 1.8 + } + ] + }, + "road_path_mtb": { + "color": "#488", + "dasharray": [ + 12, + 4 + ], + "width": [ + "stops", + { + "z": 15, + "val": 1.2 + }, + { + "z": 16, + "val": 1.5 + }, + { + "z": 17, + "val": 1.8 + }, + { + "z": 22, + "val": 1.8 + } + ] + }, + "road_path_piste": { + "color": "#87b", + "dasharray": [ + 8, + 4 + ], + "width": [ + "stops", + { + "z": 15, + "val": 1.2 + }, + { + "z": 16, + "val": 1.5 + }, + { + "z": 17, + "val": 1.8 + }, + { + "z": 22, + "val": 1.8 + } + ] + }, + "road_path_steps": { + "color": "#bba", + "dasharray": [ + 4, + 2 + ], + "width": 4 + }, + "road_major_rail": { + "color": "#c8c4c0", + "width": 0.8 + }, + "road_major_rail_hatching": { + "color": "#c8c4c0", + "dasharray": [ + 2, + 31 + ], + "width": 5 + }, + "bridge_motorway_casing": { + "color": "case", + "width": [ + "stops", + { + "z": 0, + "val": 0.6 + }, + { + "z": 7.5, + "val": 0.6 + }, + { + "z": 8, + "val": 0.8 + }, + { + "z": 10, + "val": 2.8 + }, + { + "z": 11, + "val": 3 + }, + { + "z": 12, + "val": 4 + }, + { + "z": 13, + "val": 5 + }, + { + "z": 14, + "val": 6.5 + }, + { + "z": 15, + "val": 9 + }, + { + "z": 16, + "val": 12 + }, + { + "z": 17, + "val": 15 + }, + { + "z": 18, + "val": 17 + }, + { + "z": 22, + "val": 17 + } + ], + "opacity": [ + "stops", + { + "z": 0, + "val": 0 + }, + { + "z": 9.5, + "val": 0 + }, + { + "z": 10, + "val": 1 + }, + { + "z": 22, + "val": 1 + } + ] + }, + "bridge_motorway": { "color": "motorway", "width": [ - "stops", { - "z": 7, - "val": 0 - }, { - "z": 8, - "val": 0.5 - }, { - "z": 10, - "val": 1 - }, { - "z": 13, - "val": 2 - }, { - "z": 14, - "val": 3.5 - }, { - "z": 15, - "val": 5 - }, { - "z": 16, - "val": 7 - }, { - "z": 22, - "val": 7 - } - ], + "stops", + { + "z": 0, + "val": 0 + }, + { + "z": 5, + "val": 0 + }, + { + "z": 6, + "val": 0.5 + }, + { + "z": 8, + "val": 0.8 + }, + { + "z": 10, + "val": 1 + }, + { + "z": 11, + "val": 1.2 + }, + { + "z": 12, + "val": 2 + }, + { + "z": 13, + "val": 3 + }, + { + "z": 14, + "val": 4 + }, + { + "z": 15, + "val": 6 + }, + { + "z": 16, + "val": 9 + }, + { + "z": 17, + "val": 12 + }, + { + "z": 18, + "val": 14 + }, + { + "z": 22, + "val": 14 + } + ], "opacity": [ - "stops", { - "z": 7, - "val": 0 - }, { - "z": 8, - "val": 1 - }, { - "z": 22, - "val": 1 - } - ], - }, - "road_main_casing": { - "color": "motorway_casing", + "stops", + { + "z": 0, + "val": 0 + }, + { + "z": 6.5, + "val": 0 + }, + { + "z": 7, + "val": 1 + }, + { + "z": 22, + "val": 1 + } + ] + }, + "bridge_main_casing": { + "color": "case", "width": [ - "stops", { - "z": 6, - "val": 0.2 - }, { - "z": 16, - "val": 8 - }, { - "z": 22, - "val": 8 - } - ], - }, - "road_main": { + "stops", + { + "z": 10, + "val": 2.9 + }, + { + "z": 13, + "val": 2.9 + }, + { + "z": 14, + "val": 3.5 + }, + { + "z": 15, + "val": 4 + }, + { + "z": 16, + "val": 5.5 + }, + { + "z": 17, + "val": 9 + }, + { + "z": 18, + "val": 15 + }, + { + "z": 22, + "val": 15 + } + ] + }, + "bridge_main": { "color": "main", "width": [ - "stops", { - "z": 8, - "val": 0.5 - }, { - "z": 10, - "val": 1 - }, { - "z": 13, - "val": 1.5 - }, { - "z": 14, - "val": 2.5 - }, { - "z": 15, - "val": 3.5 - }, { - "z": 16, - "val": 6 - }, { - "z": 22, - "val": 6 - } - ], - }, - "road_motorway_link_casing": { - "color": "motorway_casing", + "stops", + { + "z": 6, + "val": 1 + }, + { + "z": 12, + "val": 1 + }, + { + "z": 13, + "val": 1 + }, + { + "z": 14, + "val": 1.5 + }, + { + "z": 15, + "val": 2 + }, + { + "z": 16, + "val": 3 + }, + { + "z": 17, + "val": 6 + }, + { + "z": 18, + "val": 10 + }, + { + "z": 19, + "val": 12 + }, + { + "z": 22, + "val": 12 + } + ], + "opacity": [ + "stops", + { + "z": 0, + "val": 0 + }, + { + "z": 6.5, + "val": 0 + }, + { + "z": 7, + "val": 1 + }, + { + "z": 22, + "val": 1 + } + ] + }, + "bridge_motorway_link_casing": { + "color": "case", "width": [ - "stops", { - "z": 13, - "val": 1 - }, { - "z": 14, - "val": 3 - }, { - "z": 15, - "val": 5 - }, { - "z": 16, - "val": 6.5 - }, { - "z": 22, - "val": 6.5 - } - ], - }, - "road_motorway_link": { + "stops", + { + "z": 12, + "val": 2.8 + }, + { + "z": 14, + "val": 3.5 + }, + { + "z": 16, + "val": 5 + }, + { + "z": 18, + "val": 6 + }, + { + "z": 22, + "val": 6 + } + ] + }, + "bridge_motorway_link": { "color": "motorway", "width": [ - "stops", { - "z": 13, - "val": 1.5 - }, { - "z": 14, - "val": 1.5 - }, { - "z": 15, - "val": 3 - }, { - "z": 16, - "val": 4.5 - }, { - "z": 22, - "val": 4.5 - } - ], - }, - "road_street_casing": { - "color": "street_casing", - "width": [ - "stops", { - "z": 0, - "val": 1 - }, { - "z": 12, - "val": 1 - }, { - "z": 14, - "val": 1 - }, { - "z": 15, - "val": 4 - }, { - "z": 16, - "val": 6.5 - }, { - "z": 22, - "val": 6.5 - } - ], - }, - "road_street": { - "color": "street", - "width": [ - "stops", { - "z": 14.5, - "val": 0 - }, { - "z": 15, - "val": 2.5 - }, { - "z": 16, - "val": 4 - }, { - "z": 22, - "val": 4 - } - ], - }, - "road_service_casing": { - "color": "street_casing", - "width": [ - "stops", { - "z": 0, - "val": 1 - }, { - "z": 15, - "val": 1 - }, { - "z": 16, - "val": 4 - }, { - "z": 22, - "val": 4 - } - ], - }, - "road_service": { - "color": "street", - "width": 2, - }, - "road_path": { - "color": "path", - "dasharray": [ - 2, - 1 - ], - "width": [ - "stops", { - "z": 15, - "val": 1 - }, { - "z": 16, - "val": 1.2 - }, { - "z": 17, - "val": 1.5 - }, { - "z": 22, - "val": 1.5 - } - ], - }, - "road_major_rail": { - "color": "rail", - "width": [ - "stops", { - "z": 0, - "val": 0.4 - }, { - "z": 16, - "val": 0.75 - }, { - "z": 22, - "val": 0.75 - } - ], - }, - "road_major_rail_hatching": { - "color": "rail", - "dasharray": [ - 2, - 31 - ], - "width": 4, - }, - "bridge_motorway_casing": { - "color": "motorway_casing", - "width": [ - "stops", { - "z": 6, - "val": 0.4 - }, { - "z": 7, - "val": 0.6 - }, { - "z": 8, - "val": 1.5 - }, { - "z": 10, - "val": 3 - }, { - "z": 13, - "val": 3.5 - }, { - "z": 14, - "val": 5 - }, { - "z": 15, - "val": 7 - }, { - "z": 16, - "val": 9 - }, { - "z": 22, - "val": 9 - } - ], - }, - "bridge_motorway": { - "color": "motorway", - "width": [ - "stops", { - "z": 7, - "val": 0 - }, { - "z": 8, - "val": 0.5 - }, { - "z": 10, - "val": 1 - }, { - "z": 13, - "val": 2 - }, { - "z": 14, - "val": 3.5 - }, { - "z": 15, - "val": 5 - }, { - "z": 16, - "val": 7 - }, { - "z": 22, - "val": 7 - } - ], + "stops", + { + "z": 12, + "val": 1.2 + }, + { + "z": 14, + "val": 2 + }, + { + "z": 16, + "val": 3 + }, + { + "z": 18, + "val": 4 + }, + { + "z": 22, + "val": 4 + } + ] + }, + "bridge_street_casing": { + "color": "#d9d5c6", "opacity": [ - "stops", { - "z": 7, - "val": 0 - }, { - "z": 8, - "val": 1 - }, { - "z": 22, - "val": 1 - } - ], - }, - "bridge_main_casing": { - "color": "motorway_casing", + "stops", + { + "z": 0, + "val": 0 + }, + { + "z": 12.5, + "val": 0 + }, + { + "z": 13.5, + "val": 0.6 + }, + { + "z": 22, + "val": 0.6 + } + ], "width": [ - "stops", { - "z": 6, - "val": 0.2 - }, { - "z": 16, - "val": 8 - }, { - "z": 22, - "val": 8 - } - ], - }, - "bridge_main": { - "color": "main", - "width": [ - "stops", { - "z": 8, - "val": 0.5 - }, { - "z": 10, - "val": 1 - }, { - "z": 13, - "val": 1.5 - }, { - "z": 14, - "val": 2.5 - }, { - "z": 15, - "val": 3.5 - }, { - "z": 16, - "val": 6 - }, { - "z": 22, - "val": 6 - } - ], - }, - "bridge_motorway_link_casing": { - "color": "motorway_casing", - "width": [ - "stops", { - "z": 13, - "val": 1 - }, { - "z": 14, - "val": 3 - }, { - "z": 15, - "val": 5 - }, { - "z": 16, - "val": 6.5 - }, { - "z": 22, - "val": 6.5 - } - ], - }, - "bridge_motorway_link": { - "color": "motorway", - "width": [ - "stops", { - "z": 13, - "val": 1.5 - }, { - "z": 14, - "val": 1.5 - }, { - "z": 15, - "val": 3 - }, { - "z": 16, - "val": 4.5 - }, { - "z": 22, - "val": 4.5 - } - ], - }, - "bridge_street_casing": { - "color": "street_casing", - "width": [ - "stops", { - "z": 12, - "val": 0.5 - }, { - "z": 14, - "val": 1 - }, { - "z": 15, - "val": 4 - }, { - "z": 16, - "val": 6.5 - }, { - "z": 22, - "val": 6.5 - } - ], - }, - "bridge_street": { + "stops", + { + "z": 10, + "val": 0.5 + }, + { + "z": 12.5, + "val": 0.5 + }, + { + "z": 13, + "val": 0.5 + }, + { + "z": 14, + "val": 2.25 + }, + { + "z": 15, + "val": 5 + }, + { + "z": 16, + "val": 7 + }, + { + "z": 17, + "val": 9 + }, + { + "z": 18, + "val": 11 + }, + { + "z": 22, + "val": 11 + } + ] + }, + "bridge_street": { "color": "street", - "width": [ - "stops", { - "z": 14, - "val": 0 - }, { - "z": 15, - "val": 2.5 - }, { - "z": 16, - "val": 4 - }, { - "z": 22, - "val": 4 - } - ], "opacity": [ - "stops", { - "z": 14, - "val": 0 - }, { - "z": 15, - "val": 1 - }, { - "z": 22, - "val": 1 - } - ], - }, - "bridge_service_casing": { - "color": "street_casing", + "stops", + { + "z": 0, + "val": 0 + }, + { + "z": 13.5, + "val": 0 + }, + { + "z": 14.25, + "val": 1 + }, + { + "z": 22, + "val": 1 + } + ], "width": [ - "stops", { - "z": 15, - "val": 1 - }, { - "z": 16, - "val": 4 - }, { - "z": 22, - "val": 4 - } - ], - }, - "bridge_service": { + "stops", + { + "z": 11, + "val": 0 + }, + { + "z": 12.5, + "val": 0 + }, + { + "z": 13, + "val": 0.6 + }, + { + "z": 14, + "val": 1.2 + }, + { + "z": 15, + "val": 1.8 + }, + { + "z": 16, + "val": 3 + }, + { + "z": 17, + "val": 5 + }, + { + "z": 18, + "val": 8 + }, + { + "z": 22, + "val": 8 + } + ] + }, + "bridge_service_casing": { + "color": "#000", + "opacity": 0.04, + "width": [ + "stops", + { + "z": 0, + "val": 0.5 + }, + { + "z": 14, + "val": 0.5 + }, + { + "z": 15, + "val": 3 + }, + { + "z": 16, + "val": 3.5 + }, + { + "z": 17, + "val": 4 + }, + { + "z": 18, + "val": 5 + }, + { + "z": 19, + "val": 6 + }, + { + "z": 22, + "val": 6 + } + ] + }, + "bridge_service": { "color": "street", - "width": 2, - }, - "bridge_path": { - "color": "path", - "dasharray": [ - 2, - 1 - ], + "width": 2 + }, + "bridge_aerialway_casing": { + "color": "white", + "opacity": 0.5, "width": [ - "stops", { - "z": 15, - "val": 1 - }, { - "z": 16, - "val": 1.2 - }, { - "z": 17, - "val": 1.5 - }, { - "z": 22, - "val": 1.5 - } - ], - }, - "bridge_major_rail": { - "color": "rail", + "stops", + { + "z": 0, + "val": 2 + }, + { + "z": 13.5, + "val": 2 + }, + { + "z": 14, + "val": 2.5 + }, + { + "z": 15, + "val": 3 + }, + { + "z": 16, + "val": 3.5 + }, + { + "z": 17, + "val": 4 + }, + { + "z": 22, + "val": 5 + } + ] + }, + "bridge_aerialway": { + "color": "#876", + "opacity": 0.5, "width": [ - "stops", { - "z": 0, - "val": 0.4 - }, { - "z": 16, - "val": 0.75 - }, { - "z": 22, - "val": 0.75 - } - ], - }, - "bridge_major_rail_hatching": { - "color": "rail", - "dasharray": [ - 2, - 31 - ], - "width": 4, - }, - "tunnel_motorway_casing": { - "color": "motorway_casing", - "dasharray": [ - 7, - 2 - ], - "width": [ - "stops", { - "z": 6, - "val": 0.4 - }, { - "z": 7, - "val": 0.6 - }, { - "z": 8, - "val": 1.5 - }, { - "z": 10, - "val": 3 - }, { - "z": 13, - "val": 3.5 - }, { - "z": 14, - "val": 5 - }, { - "z": 15, - "val": 7 - }, { - "z": 16, - "val": 9 - }, { - "z": 22, - "val": 9 - } - ], - }, - "tunnel_motorway": { - "color": "motorway_tunnel", - "width": [ - "stops", { - "z": 7, - "val": 0 - }, { - "z": 8, - "val": 0.5 - }, { - "z": 10, - "val": 1 - }, { - "z": 13, - "val": 2 - }, { - "z": 14, - "val": 3.5 - }, { - "z": 15, - "val": 5 - }, { - "z": 16, - "val": 7 - }, { - "z": 22, - "val": 7 - } - ], - "opacity": [ - "stops", { - "z": 7, - "val": 0 - }, { - "z": 8, - "val": 1 - }, { - "z": 22, - "val": 1 - } - ], - }, - "tunnel_main_casing": { - "color": "motorway_casing", - "dasharray": [ - 7, - 2 - ], - "width": [ - "stops", { - "z": 6, - "val": 0.2 - }, { - "z": 16, - "val": 8 - }, { - "z": 22, - "val": 8 - } - ], - }, - "tunnel_main": { - "color": "main_tunnel", - "width": [ - "stops", { - "z": 8, - "val": 0.5 - }, { - "z": 10, - "val": 1 - }, { - "z": 13, - "val": 1.5 - }, { - "z": 14, - "val": 2.5 - }, { - "z": 15, - "val": 3.5 - }, { - "z": 16, - "val": 6 - }, { - "z": 22, - "val": 6 - } - ], - }, - "tunnel_motorway_link_casing": { - "color": "motorway_casing", - "width": [ - "stops", { - "z": 13, - "val": 1 - }, { - "z": 14, - "val": 3 - }, { - "z": 15, - "val": 5 - }, { - "z": 16, - "val": 6.5 - }, { - "z": 22, - "val": 6.5 - } - ], - }, - "tunnel_motorway_link": { - "color": "motorway", - "width": [ - "stops", { - "z": 14, - "val": 1.5 - }, { - "z": 15, - "val": 3 - }, { - "z": 16, - "val": 4.5 - }, { - "z": 22, - "val": 4.5 - } - ], - }, - "tunnel_street_casing": { - "color": "street_casing", - "dasharray": [ - 7, - 2 - ], - "width": [ - "stops", { - "z": 12, - "val": 0.5 - }, { - "z": 14, - "val": 1 - }, { - "z": 15, - "val": 4 - }, { - "z": 16, - "val": 6.5 - }, { - "z": 22, - "val": 6.5 - } - ], - }, - "tunnel_street": { - "color": "street", - "width": [ - "stops", { - "z": 14, - "val": 0 - }, { - "z": 15, - "val": 2.5 - }, { - "z": 16, - "val": 4 - }, { - "z": 22, - "val": 4 - } - ], - "opacity": [ - "stops", { - "z": 14, - "val": 0 - }, { - "z": 15, - "val": 1 - }, { - "z": 22, - "val": 1 - } - ], - }, - "tunnel_service_casing": { - "color": "street_casing", - "dasharray": [ - 7, - 2 - ], - "width": [ - "stops", { - "z": 15, - "val": 1 - }, { - "z": 16, - "val": 4 - }, { - "z": 22, - "val": 4 - } - ], - }, - "tunnel_service": { - "color": "street", - "width": 2, - }, - "tunnel_major_rail": { - "color": "rail", - "width": [ - "stops", { - "z": 0, - "val": 0.4 - }, { - "z": 16, - "val": 0.75 - }, { - "z": 22, - "val": 0.75 - } - ], - }, - "tunnel_major_rail_hatching": { - "color": "rail", - "dasharray": [ - 2, - 31 - ], - "width": 4, - }, - "country_label": { + "stops", + { + "z": 0, + "val": 0.8 + }, + { + "z": 13.5, + "val": 0.8 + }, + { + "z": 14, + "val": 1.4 + }, + { + "z": 15, + "val": 1.6 + }, + { + "z": 16, + "val": 2 + }, + { + "z": 17, + "val": 2.4 + }, + { + "z": 18, + "val": 3 + }, + { + "z": 22, + "val": 3 + } + ] + }, + "country_label": { "color": "text", "stroke": [ - 1, - 1, - 1, - 0.8 - ], - }, - "country_label_line": { + 1, + 1, + 1, + 0.8 + ] + }, + "country_label_line": { "color": "text", "width": 0.5, - "opacity": 0.5, - }, - "marin_label_1": { - "color": "marine_text", + "opacity": 0.5 + }, + "marine_label_1": { + "color": "text", "stroke": [ - 1, - 1, - 1, - 0.8 - ], - }, - "marin_label_2": { - "color": "marine_text", + 1, + 1, + 1, + 0.8 + ] + }, + "marine_label_2": { + "color": "text", "stroke": [ - 1, - 1, - 1, - 0.8 - ], - }, - "marin_label_3": { - "color": "marine_text", + 1, + 1, + 1, + 0.8 + ] + }, + "marine_label_3": { + "color": "text", "stroke": [ - 1, - 1, - 1, - 0.8 - ], - }, - "place_label_city_point": { + 1, + 1, + 1, + 0.8 + ] + }, + "place_label_city_point": { "color": "#333", - "radius": 2, - }, - "place_label_city": { + "radius": 2 + }, + "place_label_city": { "color": "#333", "stroke": [ - 1, - 1, - 1, - 0.8 - ], + 1, + 1, + 1, + 0.8 + ], "size": [ - "stops", { - "z": 0, - "val": 10 - }, { - "z": 10, - "val": 18 - }, { - "z": 12, - "val": 24 - } - ], + "stops", + { + "z": 0, + "val": 10 + }, + { + "z": 10, + "val": 18 + }, + { + "z": 12, + "val": 24 + } + ], "translate": [ - 0, - 30 - ], - }, - "place_label_town": { + 0, + 30 + ] + }, + "place_label_town": { "color": "#333", "stroke": [ - 1, - 1, - 1, - 0.8 - ], + 1, + 1, + 1, + 0.8 + ], "size": [ - "stops", { - "z": 0, - "val": 14 - }, { - "z": 12, - "val": 16 - }, { - "z": 14, - "val": 20 - }, { - "z": 16, - "val": 24 - } - ], - }, - "place_label_village": { + "stops", + { + "z": 0, + "val": 14 + }, + { + "z": 12, + "val": 16 + }, + { + "z": 14, + "val": 20 + }, + { + "z": 16, + "val": 24 + } + ] + }, + "place_label_village": { "color": "#333", "stroke": [ - 1, - 1, - 1, - 0.8 - ], + 1, + 1, + 1, + 0.8 + ], "size": [ - "stops", { - "z": 0, - "val": 12 - }, { - "z": 12, - "val": 14 - }, { - "z": 14, - "val": 28 - }, { - "z": 16, - "val": 22 - } - ], - }, - "place_label_other": { + "stops", + { + "z": 0, + "val": 12 + }, + { + "z": 12, + "val": 14 + }, + { + "z": 14, + "val": 28 + }, + { + "z": 16, + "val": 22 + } + ] + }, + "place_label_other": { "color": "#633", "stroke": [ - 1, - 1, - 1, - 0.8 - ], + 1, + 1, + 1, + 0.8 + ], "size": [ - "stops", { - "z": 0, - "val": 10 - }, { - "z": 14, - "val": 11 - }, { - "z": 15, - "val": 12 - }, { - "z": 16, - "val": 14 - } - ], - }, - "poi_label": { + "stops", + { + "z": 0, + "val": 10 + }, + { + "z": 14, + "val": 11 + }, + { + "z": 15, + "val": 12 + }, + { + "z": 16, + "val": 14 + } + ] + }, + "poi_label": { "color": "#666", "stroke": [ - 1, - 1, - 1, - 0.5 - ], - }, - "road_label": { + 1, + 1, + 1, + 0.5 + ] + }, + "road_label": { "color": "#765", "stroke": [ - 1, - 1, - 1, - 0.5 - ], + 1, + 1, + 1, + 0.5 + ], "size": [ - "stops", { - "z": 0, - "val": 12 - }, { - "z": 14, - "val": 12 - }, { - "z": 15, - "val": 13 - } - ], - }, - "water_label": { - "color": "marine_text", + "stops", + { + "z": 0, + "val": 12 + }, + { + "z": 14, + "val": 12 + }, + { + "z": 15, + "val": 13 + } + ] + }, + "water_label": { + "color": "text", "stroke": [ - 1, - 1, - 1, - 0.75 - ], - }, - "poi_airport": { - "color": "maki", + 1, + 1, + 1, + 0.75 + ] + }, + "poi_airport": { + "color": "text", "image": "airport-12", - "translate": "point_translate", - }, - "poi_restaurant": { - "color": "maki", - "image": "restaurant-12", - "translate": "point_translate", - }, - "poi_bus": { - "color": "maki", - "image": "bus-12", - "translate": "point_translate", - }, - "poi_rail": { - "color": "maki", - "image": "rail-12", - "translate": "point_translate", - }, - "poi_fire_station": { - "color": "maki", - "image": "fire-station-12", - "translate": "point_translate", - }, - "poi_park": { - "color": "maki", + "translate": [ + 0, + 1 + ] + }, + "poi_park": { + "color": "text", "image": "park-12", - "translate": "point_translate", - }, - "poi_hospital": { - "color": "maki", - "image": "hospital-12", - "translate": "point_translate", - }, - "poi_playground": { - "color": "maki", - "image": "playground-12", - "translate": "point_translate", - }, - "poi_cafe": { - "color": "maki", - "image": "cafe-12", - "translate": "point_translate", - }, - "poi_beer": { - "color": "maki", - "image": "beer-12", - "translate": "point_translate", - } - } - }], + "translate": [ + 0, + 1 + ] + } + } + } + ], "sprite": "/img/maki-sprite" }; diff --git a/src/map/map.cpp b/src/map/map.cpp index 35d845858..b02e47026 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -139,7 +139,7 @@ void Map::setup() { std::unique_ptr(new Source(*this, painter, texturepool, - "http://a.gl-api-us-east-1.tilestream.net/v3/mapbox.mapbox-streets-v4/%d/%d/%d.gl.pbf", + "http://a.gl-api-us-east-1.tilestream.net/v3/mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v42-dev/%d/%d/%d.gl.pbf", Source::Type::vector, {{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }}, 512, diff --git a/src/shader/shaders_gl.cpp b/src/shader/shaders_gl.cpp index 32f8af081..aa98275be 100644 --- a/src/shader/shaders_gl.cpp +++ b/src/shader/shaders_gl.cpp @@ -7,40 +7,40 @@ using namespace llmr; const shader_source llmr::shaders[SHADER_COUNT] = { { - "#version 120\nattribute vec2 a_pos;\nuniform mat4 u_matrix;\nuniform float u_size;\nvoid main ()\n{\n vec4 tmpvar_1;\n tmpvar_1.zw = vec2(0.0, 1.0);\n tmpvar_1.xy = a_pos;\n gl_Position = (u_matrix * tmpvar_1);\n gl_PointSize = u_size;\n}\n\n", - "#version 120\nuniform vec4 u_color;\nuniform float u_blur;\nvoid main ()\n{\n vec2 x_1;\n x_1 = (gl_PointCoord - 0.5);\n float tmpvar_2;\n tmpvar_2 = clamp (((\n sqrt(dot (x_1, x_1))\n - 0.5) / (\n (0.5 - u_blur)\n - 0.5)), 0.0, 1.0);\n gl_FragColor = (u_color * (tmpvar_2 * (tmpvar_2 * \n (3.0 - (2.0 * tmpvar_2))\n )));\n}\n\n", + "#version 120\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform float u_size;\n\nvoid main(void) {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n gl_PointSize = u_size;\n}\n", + "#version 120\nuniform vec4 u_color;\nuniform float u_blur;\n\nvoid main() {\n\tfloat dist = length(gl_PointCoord - 0.5);\n\tfloat t = smoothstep(0.5, 0.5 - u_blur, dist);\n\n gl_FragColor = u_color * t;\n}\n", }, { - "#version 120\nattribute vec2 a_pos;\nattribute vec2 a_extrude;\nattribute float a_linesofar;\nuniform mat4 u_matrix;\nuniform mat4 u_exmatrix;\nuniform float u_ratio;\nuniform vec2 u_linewidth;\nvarying vec2 v_normal;\nvarying float v_linesofar;\nvoid main ()\n{\n vec2 normal_1;\n vec2 tmpvar_2;\n tmpvar_2 = (vec2(mod (a_pos, 2.0)));\n normal_1.x = tmpvar_2.x;\n normal_1.y = sign((tmpvar_2.y - 0.5));\n v_normal = normal_1;\n vec4 tmpvar_3;\n tmpvar_3.zw = vec2(0.0, 0.0);\n tmpvar_3.xy = ((u_linewidth.x * a_extrude) * 0.015873);\n vec4 tmpvar_4;\n tmpvar_4.zw = vec2(0.0, 1.0);\n tmpvar_4.xy = floor((a_pos * 0.5));\n gl_Position = ((u_matrix * tmpvar_4) + (u_exmatrix * tmpvar_3));\n v_linesofar = (a_linesofar * u_ratio);\n}\n\n", - "#version 120\nuniform vec2 u_linewidth;\nuniform vec4 u_color;\nuniform vec2 u_dasharray;\nvarying vec2 v_normal;\nvarying float v_linesofar;\nvoid main ()\n{\n float tmpvar_1;\n tmpvar_1 = (sqrt(dot (v_normal, v_normal)) * u_linewidth.x);\n float tmpvar_2;\n tmpvar_2 = (float(mod (v_linesofar, (u_dasharray.x + u_dasharray.y))));\n gl_FragColor = (u_color * (clamp (\n min ((tmpvar_1 - (u_linewidth.y - 1.0)), (u_linewidth.x - tmpvar_1))\n , 0.0, 1.0) * max (\n float((-(u_dasharray.y) >= 0.0))\n , \n clamp (min (tmpvar_2, (u_dasharray.x - tmpvar_2)), 0.0, 1.0)\n )));\n}\n\n", + "#version 120\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\nattribute vec2 a_pos;\nattribute vec2 a_extrude;\nattribute float a_linesofar;\n\n// posmatrix is for the vertex position, exmatrix is for rotating and projecting\n// the extrusion vector.\nuniform mat4 u_matrix;\nuniform mat4 u_exmatrix;\n\n// shared\nuniform float u_ratio;\nuniform vec2 u_linewidth;\nuniform vec4 u_color;\n\nvarying vec2 v_normal;\nvarying float v_linesofar;\n\nvoid main() {\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n vec4 dist = vec4(u_linewidth.s * a_extrude * scale, 0.0, 0.0);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix. Add the extrusion vector *after* the model/view matrix\n // because we're extruding the line in pixel space, regardless of the current\n // tile's zoom level.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5), 0.0, 1.0) + u_exmatrix * dist;\n v_linesofar = a_linesofar * u_ratio;\n}", + "#version 120\nuniform vec2 u_linewidth;\nuniform vec4 u_color;\n\nuniform vec2 u_dasharray;\n\nvarying vec2 v_normal;\nvarying float v_linesofar;\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * u_linewidth.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float alpha = clamp(min(dist - (u_linewidth.t - 1.0), u_linewidth.s - dist), 0.0, 1.0);\n\n // Calculate the antialiasing fade factor based on distance to the dash.\n // Only affects alpha when line is dashed\n float pos = mod(v_linesofar, u_dasharray.x + u_dasharray.y);\n alpha *= max(step(0.0, -u_dasharray.y), clamp(min(pos, u_dasharray.x - pos), 0.0, 1.0));\n\n gl_FragColor = u_color * alpha;\n}", }, { - "#version 120\nattribute vec2 a_pos;\nuniform mat4 u_matrix;\nuniform vec2 u_world;\nuniform float u_size;\nvarying vec2 v_pos;\nvoid main ()\n{\n vec4 tmpvar_1;\n tmpvar_1.zw = vec2(0.0, 1.0);\n tmpvar_1.xy = floor((a_pos / 2.0));\n vec4 tmpvar_2;\n tmpvar_2 = (u_matrix * tmpvar_1);\n gl_Position = tmpvar_2;\n v_pos = ((tmpvar_2.xy + 1.0) * u_world);\n gl_PointSize = u_size;\n}\n\n", - "#version 120\nuniform vec4 u_color;\nuniform vec2 u_linewidth;\nvarying vec2 v_pos;\nvoid main ()\n{\n float tmpvar_1;\n vec2 x_2;\n x_2 = (v_pos - gl_FragCoord.xy);\n tmpvar_1 = sqrt(dot (x_2, x_2));\n gl_FragColor = (u_color * clamp (min (\n (tmpvar_1 - (u_linewidth.y - 1.0))\n , \n (u_linewidth.x - tmpvar_1)\n ), 0.0, 1.0));\n}\n\n", + "#version 120\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\nuniform float u_size;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(floor(a_pos / 2.0), 0.0, 1.0);\n v_pos = (gl_Position.xy + 1.0) * u_world;\n gl_PointSize = u_size;\n}\n", + "#version 120\nuniform vec4 u_color;\nuniform vec2 u_linewidth;\n\nvarying vec2 v_pos;\n\nvoid main() {\n float dist = length(v_pos - gl_FragCoord.xy);\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float alpha = clamp(min(dist - (u_linewidth.t - 1.0), u_linewidth.s - dist), 0.0, 1.0);\n gl_FragColor = u_color * alpha;\n}\n", }, { - "#version 120\nattribute vec2 a_pos;\nuniform mat4 u_matrix;\nuniform vec2 u_world;\nvarying vec2 v_pos;\nvoid main ()\n{\n vec4 tmpvar_1;\n tmpvar_1.zw = vec2(0.0, 1.0);\n tmpvar_1.xy = a_pos;\n vec4 tmpvar_2;\n tmpvar_2 = (u_matrix * tmpvar_1);\n gl_Position = tmpvar_2;\n v_pos = (((tmpvar_2.xy + 1.0) / 2.0) * u_world);\n}\n\n", - "#version 120\nuniform vec4 u_color;\nvarying vec2 v_pos;\nvoid main ()\n{\n vec2 x_1;\n x_1 = (v_pos - gl_FragCoord.xy);\n float tmpvar_2;\n tmpvar_2 = clamp (((\n sqrt(dot (x_1, x_1))\n - 1.0) / -1.0), 0.0, 1.0);\n gl_FragColor = (u_color * (tmpvar_2 * (tmpvar_2 * \n (3.0 - (2.0 * tmpvar_2))\n )));\n}\n\n", + "#version 120\nattribute vec2 a_pos;\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (gl_Position.xy + 1.0) / 2.0 * u_world;\n}\n", + "#version 120\nuniform vec4 u_color;\n\nvarying vec2 v_pos;\n\nvoid main() {\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n gl_FragColor = u_color * alpha;\n}\n", }, { - "#version 120\nuniform mat4 u_matrix;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\nvoid main ()\n{\n v_pos = a_pos;\n vec4 tmpvar_1;\n tmpvar_1.zw = vec2(0.0, 1.0);\n tmpvar_1.xy = a_pos;\n gl_Position = (u_matrix * tmpvar_1);\n}\n\n", - "#version 120\nuniform vec4 u_color;\nuniform vec2 u_offset;\nuniform vec2 u_pattern_size;\nuniform vec2 u_pattern_tl;\nuniform vec2 u_pattern_br;\nuniform float u_mix;\nuniform sampler2D u_image;\nvarying vec2 v_pos;\nvoid main ()\n{\n vec2 tmpvar_1;\n tmpvar_1 = (vec2(mod (((v_pos + u_offset) / u_pattern_size), 1.0)));\n vec4 tmpvar_2;\n tmpvar_2 = mix (texture2D (u_image, mix (u_pattern_tl, u_pattern_br, tmpvar_1)), texture2D (u_image, mix (u_pattern_tl, u_pattern_br, (vec2(mod (\n (tmpvar_1 * 2.0)\n , 1.0))))), u_mix);\n gl_FragColor = (tmpvar_2 + (u_color * (1.0 - tmpvar_2.w)));\n}\n\n", + "#version 120\nuniform mat4 u_matrix;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos;\n\nvoid main() {\n v_pos = a_pos;\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n", + "#version 120\nuniform vec4 u_color;\n\nuniform vec2 u_offset;\nuniform vec2 u_pattern_size;\nuniform vec2 u_pattern_tl;\nuniform vec2 u_pattern_br;\nuniform float u_mix;\n\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos;\n\nvoid main() {\n\n vec2 imagecoord = mod((v_pos + u_offset) / u_pattern_size, 1.0);\n vec2 pos = mix(u_pattern_tl, u_pattern_br, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord2 = mod(imagecoord * 2.0, 1.0);\n vec2 pos2 = mix(u_pattern_tl, u_pattern_br, imagecoord2);\n vec4 color2 = texture2D(u_image, pos2);\n\n vec4 color = mix(color1, color2, u_mix);\n gl_FragColor = color + u_color * (1.0 - color.a);\n}\n", }, { - "#version 120\nattribute vec2 a_pos;\nuniform mat4 u_matrix;\nvoid main ()\n{\n vec4 tmpvar_1;\n tmpvar_1.zw = vec2(0.0, 1.0);\n tmpvar_1.xy = a_pos;\n gl_Position = (u_matrix * tmpvar_1);\n}\n\n", - "#version 120\nuniform vec4 u_color;\nvoid main ()\n{\n gl_FragColor = u_color;\n}\n\n", + "#version 120\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n", + "#version 120\nuniform vec4 u_color;\n\nvoid main() {\n gl_FragColor = u_color;\n}\n", }, { - "#version 120\nattribute vec2 a_pos;\nuniform mat4 u_matrix;\nuniform float u_size;\nvoid main ()\n{\n vec4 tmpvar_1;\n tmpvar_1.zw = vec2(0.0, 1.0);\n tmpvar_1.xy = a_pos;\n gl_Position = (u_matrix * tmpvar_1);\n gl_PointSize = u_size;\n}\n\n", - "#version 120\nuniform sampler2D u_image;\nuniform vec2 u_tl;\nuniform vec2 u_br;\nuniform vec4 u_color;\nvoid main ()\n{\n vec2 tmpvar_1;\n tmpvar_1 = (((\n ((gl_PointCoord * 2.0) - 1.0)\n * 1.41421) / 2.0) + 0.5);\n gl_FragColor = ((texture2D (u_image, mix (u_tl, u_br, tmpvar_1)) * (\n ((float((tmpvar_1.x >= 0.0)) * float((tmpvar_1.y >= 0.0))) * (1.0 - float((tmpvar_1.x >= 1.0))))\n * \n (1.0 - float((tmpvar_1.y >= 1.0)))\n )) * u_color);\n}\n\n", + "#version 120\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform float u_size;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n gl_PointSize = u_size;\n}\n", + "#version 120\n#define root2 1.4142135623730951\n\nuniform sampler2D u_image;\nuniform vec2 u_tl;\nuniform vec2 u_br;\nuniform vec4 u_color;\n\nuniform vec2 pos;\nuniform float inbounds;\nuniform vec4 color;\n\nvoid main() {\n vec2 pos = (gl_PointCoord * 2.0 - 1.0) * root2 / 2.0 + 0.5;\n\n float inbounds = step(0.0, pos.x) * step(0.0, pos.y) *\n (1.0 - step(1.0, pos.x)) * (1.0 - step(1.0, pos.y));\n\n vec4 color = texture2D(u_image, mix(u_tl, u_br, pos)) * inbounds;\n\n gl_FragColor = color * u_color;\n}\n", }, { - "#version 120\nuniform mat4 u_matrix;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\nvoid main ()\n{\n vec4 tmpvar_1;\n tmpvar_1.zw = vec2(0.0, 1.0);\n tmpvar_1.xy = a_pos;\n gl_Position = (u_matrix * tmpvar_1);\n v_pos = (a_pos / 4096.0);\n}\n\n", - "#version 120\nuniform sampler2D u_image;\nuniform float u_opacity;\nvarying vec2 v_pos;\nvoid main ()\n{\n gl_FragColor = (texture2D (u_image, v_pos) * u_opacity);\n}\n\n", + "#version 120\nuniform mat4 u_matrix;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = a_pos / 4096.0;\n}\n", + "#version 120\nuniform sampler2D u_image;\nuniform float u_opacity;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_FragColor = texture2D(u_image, v_pos) * u_opacity;\n}\n", }, { - "#version 120\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec4 a_data1;\nattribute vec4 a_data2;\nuniform mat4 u_matrix;\nuniform mat4 u_exmatrix;\nuniform float u_angle;\nuniform float u_zoom;\nuniform float u_flip;\nuniform float u_fadedist;\nuniform float u_minfadezoom;\nuniform float u_maxfadezoom;\nuniform float u_fadezoom;\nuniform vec2 u_texsize;\nvarying vec2 v_tex;\nvarying float v_alpha;\nvoid main ()\n{\n float rev_1;\n rev_1 = 0.0;\n float tmpvar_2;\n tmpvar_2 = (float(mod ((a_data1.w + u_angle), 256.0)));\n if ((((u_flip > 0.0) && (tmpvar_2 >= 64.0)) && (tmpvar_2 < 192.0))) {\n rev_1 = 1.0;\n };\n float tmpvar_3;\n tmpvar_3 = (((2.0 - \n float((u_zoom >= a_data2.x))\n ) - (1.0 - \n float((u_zoom >= a_data2.y))\n )) + rev_1);\n float tmpvar_4;\n tmpvar_4 = clamp (((u_fadezoom - a_data1.z) / u_fadedist), 0.0, 1.0);\n if ((u_fadedist >= 0.0)) {\n v_alpha = tmpvar_4;\n } else {\n v_alpha = (1.0 - tmpvar_4);\n };\n if ((u_maxfadezoom < a_data1.z)) {\n v_alpha = 0.0;\n };\n if ((u_minfadezoom >= a_data1.z)) {\n v_alpha = 1.0;\n };\n vec4 tmpvar_5;\n tmpvar_5.zw = vec2(0.0, 1.0);\n tmpvar_5.xy = a_pos;\n vec4 tmpvar_6;\n tmpvar_6.w = 0.0;\n tmpvar_6.xy = (a_offset / 64.0);\n tmpvar_6.z = ((tmpvar_3 + float(\n (0.0 >= v_alpha)\n )) + ((1.0 - \n float((u_angle >= a_data2.z))\n ) * float(\n (u_angle >= a_data2.w)\n )));\n gl_Position = ((u_matrix * tmpvar_5) + (u_exmatrix * tmpvar_6));\n v_tex = ((a_data1.xy * 4.0) / u_texsize);\n}\n\n", - "#version 120\nuniform sampler2D u_texture;\nuniform vec4 u_color;\nuniform float u_buffer;\nuniform float u_gamma;\nvarying vec2 v_tex;\nvarying float v_alpha;\nvoid main ()\n{\n float edge0_1;\n edge0_1 = (u_buffer - u_gamma);\n float tmpvar_2;\n tmpvar_2 = clamp (((texture2D (u_texture, v_tex).w - edge0_1) / (\n (u_buffer + u_gamma)\n - edge0_1)), 0.0, 1.0);\n gl_FragColor = (u_color * ((tmpvar_2 * \n (tmpvar_2 * (3.0 - (2.0 * tmpvar_2)))\n ) * v_alpha));\n}\n\n", + "#version 120\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec4 a_data1;\nattribute vec4 a_data2;\n\n\n// posmatrix is for the vertex position, exmatrix is for rotating and projecting\n// the extrusion vector.\nuniform mat4 u_matrix;\nuniform mat4 u_exmatrix;\nuniform float u_angle;\nuniform float u_zoom;\nuniform float u_flip;\nuniform float u_fadedist;\nuniform float u_minfadezoom;\nuniform float u_maxfadezoom;\nuniform float u_fadezoom;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying float v_alpha;\n\nvoid main() {\n vec2 a_tex = a_data1.xy;\n float a_labelminzoom = a_data1[2];\n float a_angle = a_data1[3];\n vec2 a_zoom = a_data2.st;\n vec2 a_range = a_data2.pq;\n\n float rev = 0.0;\n\n // u_angle is angle of the map, -128..128 representing 0..2PI\n // a_angle is angle of the label, 0..256 representing 0..2PI, where 0 is horizontal text\n float rotated = mod(a_angle + u_angle, 256.0);\n // if the label rotates with the map, and if the rotated label is upside down, hide it\n if (u_flip > 0.0 && rotated >= 64.0 && rotated < 192.0) rev = 1.0;\n\n // If the label should be invisible, we move the vertex outside\n // of the view plane so that the triangle gets clipped. This makes it easier\n // for us to create degenerate triangle strips.\n // u_zoom is the current zoom level adjusted for the change in font size\n float z = 2.0 - step(a_zoom[0], u_zoom) - (1.0 - step(a_zoom[1], u_zoom)) + rev;\n\n // fade out labels\n float alpha = clamp((u_fadezoom - a_labelminzoom) / u_fadedist, 0.0, 1.0);\n\n if (u_fadedist >= 0.0) {\n v_alpha = alpha;\n } else {\n v_alpha = 1.0 - alpha;\n }\n if (u_maxfadezoom < a_labelminzoom) {\n v_alpha = 0.0;\n }\n if (u_minfadezoom >= a_labelminzoom) {\n v_alpha = 1.0;\n }\n\n // if label has been faded out, clip it\n z += step(v_alpha, 0.0);\n\n // all the angles are 0..256 representing 0..2PI\n // hide if (angle >= a_rangeend && angle < rangestart)\n z += (1.0 - step(a_range[0], u_angle)) * step(a_range[1], u_angle);\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + u_exmatrix * vec4(a_offset / 64.0, z, 0);\n v_tex = a_tex * 4.0 / u_texsize;\n}\n", + "#version 120\nuniform sampler2D u_texture;\nuniform vec4 u_color;\nuniform float u_buffer;\nuniform float u_gamma;\n\nvarying vec2 v_tex;\nvarying float v_alpha;\n\nvoid main() {\n float dist = texture2D(u_texture, v_tex).a;\n float alpha = smoothstep(u_buffer - u_gamma, u_buffer + u_gamma, dist) * v_alpha;\n gl_FragColor = u_color * alpha;\n}\n", } }; #endif diff --git a/src/shader/shaders_gles2.cpp b/src/shader/shaders_gles2.cpp index cd247a9e5..60417ed6f 100644 --- a/src/shader/shaders_gles2.cpp +++ b/src/shader/shaders_gles2.cpp @@ -7,40 +7,40 @@ using namespace llmr; const shader_source llmr::shaders[SHADER_COUNT] = { { - "precision highp float;\nattribute vec2 a_pos;\nuniform mat4 u_matrix;\nuniform float u_size;\nvoid main ()\n{\n vec4 tmpvar_1;\n tmpvar_1.zw = vec2(0.0, 1.0);\n tmpvar_1.xy = a_pos;\n gl_Position = (u_matrix * tmpvar_1);\n gl_PointSize = u_size;\n}\n\n", - "precision highp float;\nuniform vec4 u_color;\nuniform float u_blur;\nvoid main ()\n{\n mediump vec2 x_1;\n x_1 = (gl_PointCoord - 0.5);\n mediump float tmpvar_2;\n tmpvar_2 = clamp (((\n sqrt(dot (x_1, x_1))\n - 0.5) / (\n (0.5 - u_blur)\n - 0.5)), 0.0, 1.0);\n gl_FragColor = (u_color * (tmpvar_2 * (tmpvar_2 * \n (3.0 - (2.0 * tmpvar_2))\n )));\n}\n\n", + "precision highp float;\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform float u_size;\n\nvoid main(void) {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n gl_PointSize = u_size;\n}\n", + "precision highp float;\nuniform vec4 u_color;\nuniform float u_blur;\n\nvoid main() {\n\tfloat dist = length(gl_PointCoord - 0.5);\n\tfloat t = smoothstep(0.5, 0.5 - u_blur, dist);\n\n gl_FragColor = u_color * t;\n}\n", }, { - "precision highp float;\nattribute vec2 a_pos;\nattribute vec2 a_extrude;\nattribute float a_linesofar;\nuniform mat4 u_matrix;\nuniform mat4 u_exmatrix;\nuniform float u_ratio;\nuniform vec2 u_linewidth;\nvarying vec2 v_normal;\nvarying float v_linesofar;\nvoid main ()\n{\n vec2 normal_1;\n vec2 tmpvar_2;\n tmpvar_2 = (vec2(mod (a_pos, 2.0)));\n normal_1.x = tmpvar_2.x;\n normal_1.y = sign((tmpvar_2.y - 0.5));\n v_normal = normal_1;\n vec4 tmpvar_3;\n tmpvar_3.zw = vec2(0.0, 0.0);\n tmpvar_3.xy = ((u_linewidth.x * a_extrude) * 0.015873);\n vec4 tmpvar_4;\n tmpvar_4.zw = vec2(0.0, 1.0);\n tmpvar_4.xy = floor((a_pos * 0.5));\n gl_Position = ((u_matrix * tmpvar_4) + (u_exmatrix * tmpvar_3));\n v_linesofar = (a_linesofar * u_ratio);\n}\n\n", - "precision highp float;\nuniform vec2 u_linewidth;\nuniform vec4 u_color;\nuniform vec2 u_dasharray;\nvarying vec2 v_normal;\nvarying float v_linesofar;\nvoid main ()\n{\n float tmpvar_1;\n tmpvar_1 = (sqrt(dot (v_normal, v_normal)) * u_linewidth.x);\n float tmpvar_2;\n tmpvar_2 = (float(mod (v_linesofar, (u_dasharray.x + u_dasharray.y))));\n gl_FragColor = (u_color * (clamp (\n min ((tmpvar_1 - (u_linewidth.y - 1.0)), (u_linewidth.x - tmpvar_1))\n , 0.0, 1.0) * max (\n float((-(u_dasharray.y) >= 0.0))\n , \n clamp (min (tmpvar_2, (u_dasharray.x - tmpvar_2)), 0.0, 1.0)\n )));\n}\n\n", + "precision highp float;\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\nattribute vec2 a_pos;\nattribute vec2 a_extrude;\nattribute float a_linesofar;\n\n// posmatrix is for the vertex position, exmatrix is for rotating and projecting\n// the extrusion vector.\nuniform mat4 u_matrix;\nuniform mat4 u_exmatrix;\n\n// shared\nuniform float u_ratio;\nuniform vec2 u_linewidth;\nuniform vec4 u_color;\n\nvarying vec2 v_normal;\nvarying float v_linesofar;\n\nvoid main() {\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n vec4 dist = vec4(u_linewidth.s * a_extrude * scale, 0.0, 0.0);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix. Add the extrusion vector *after* the model/view matrix\n // because we're extruding the line in pixel space, regardless of the current\n // tile's zoom level.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5), 0.0, 1.0) + u_exmatrix * dist;\n v_linesofar = a_linesofar * u_ratio;\n}", + "precision highp float;\nuniform vec2 u_linewidth;\nuniform vec4 u_color;\n\nuniform vec2 u_dasharray;\n\nvarying vec2 v_normal;\nvarying float v_linesofar;\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * u_linewidth.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float alpha = clamp(min(dist - (u_linewidth.t - 1.0), u_linewidth.s - dist), 0.0, 1.0);\n\n // Calculate the antialiasing fade factor based on distance to the dash.\n // Only affects alpha when line is dashed\n float pos = mod(v_linesofar, u_dasharray.x + u_dasharray.y);\n alpha *= max(step(0.0, -u_dasharray.y), clamp(min(pos, u_dasharray.x - pos), 0.0, 1.0));\n\n gl_FragColor = u_color * alpha;\n}", }, { - "precision highp float;\nattribute vec2 a_pos;\nuniform mat4 u_matrix;\nuniform vec2 u_world;\nuniform float u_size;\nvarying highp vec2 v_pos;\nvoid main ()\n{\n vec4 tmpvar_1;\n tmpvar_1.zw = vec2(0.0, 1.0);\n tmpvar_1.xy = floor((a_pos / 2.0));\n vec4 tmpvar_2;\n tmpvar_2 = (u_matrix * tmpvar_1);\n gl_Position = tmpvar_2;\n v_pos = ((tmpvar_2.xy + 1.0) * u_world);\n gl_PointSize = u_size;\n}\n\n", - "precision highp float;\nuniform vec4 u_color;\nuniform vec2 u_linewidth;\nvarying vec2 v_pos;\nvoid main ()\n{\n highp float tmpvar_1;\n highp vec2 x_2;\n x_2 = (v_pos - gl_FragCoord.xy);\n tmpvar_1 = sqrt(dot (x_2, x_2));\n highp vec4 tmpvar_3;\n tmpvar_3 = (u_color * clamp (min (\n (tmpvar_1 - (u_linewidth.y - 1.0))\n , \n (u_linewidth.x - tmpvar_1)\n ), 0.0, 1.0));\n gl_FragColor = tmpvar_3;\n}\n\n", + "precision highp float;\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\nuniform float u_size;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(floor(a_pos / 2.0), 0.0, 1.0);\n v_pos = (gl_Position.xy + 1.0) * u_world;\n gl_PointSize = u_size;\n}\n", + "precision highp float;\nuniform vec4 u_color;\nuniform vec2 u_linewidth;\n\nvarying vec2 v_pos;\n\nvoid main() {\n float dist = length(v_pos - gl_FragCoord.xy);\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float alpha = clamp(min(dist - (u_linewidth.t - 1.0), u_linewidth.s - dist), 0.0, 1.0);\n gl_FragColor = u_color * alpha;\n}\n", }, { - "precision highp float;\nattribute vec2 a_pos;\nuniform mat4 u_matrix;\nuniform vec2 u_world;\nvarying highp vec2 v_pos;\nvoid main ()\n{\n vec4 tmpvar_1;\n tmpvar_1.zw = vec2(0.0, 1.0);\n tmpvar_1.xy = a_pos;\n vec4 tmpvar_2;\n tmpvar_2 = (u_matrix * tmpvar_1);\n gl_Position = tmpvar_2;\n v_pos = (((tmpvar_2.xy + 1.0) / 2.0) * u_world);\n}\n\n", - "precision highp float;\nuniform vec4 u_color;\nvarying vec2 v_pos;\nvoid main ()\n{\n highp vec2 x_1;\n x_1 = (v_pos - gl_FragCoord.xy);\n highp float tmpvar_2;\n tmpvar_2 = clamp (((\n sqrt(dot (x_1, x_1))\n - 1.0) / -1.0), 0.0, 1.0);\n highp vec4 tmpvar_3;\n tmpvar_3 = (u_color * (tmpvar_2 * (tmpvar_2 * \n (3.0 - (2.0 * tmpvar_2))\n )));\n gl_FragColor = tmpvar_3;\n}\n\n", + "precision highp float;\nattribute vec2 a_pos;\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (gl_Position.xy + 1.0) / 2.0 * u_world;\n}\n", + "precision highp float;\nuniform vec4 u_color;\n\nvarying vec2 v_pos;\n\nvoid main() {\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n gl_FragColor = u_color * alpha;\n}\n", }, { - "precision highp float;\nuniform mat4 u_matrix;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\nvoid main ()\n{\n v_pos = a_pos;\n vec4 tmpvar_1;\n tmpvar_1.zw = vec2(0.0, 1.0);\n tmpvar_1.xy = a_pos;\n gl_Position = (u_matrix * tmpvar_1);\n}\n\n", - "precision highp float;\nuniform vec4 u_color;\nuniform vec2 u_offset;\nuniform vec2 u_pattern_size;\nuniform vec2 u_pattern_tl;\nuniform vec2 u_pattern_br;\nuniform float u_mix;\nuniform sampler2D u_image;\nvarying vec2 v_pos;\nvoid main ()\n{\n vec2 tmpvar_1;\n tmpvar_1 = (vec2(mod (((v_pos + u_offset) / u_pattern_size), 1.0)));\n lowp vec4 tmpvar_2;\n tmpvar_2 = mix (texture2D (u_image, mix (u_pattern_tl, u_pattern_br, tmpvar_1)), texture2D (u_image, mix (u_pattern_tl, u_pattern_br, (vec2(mod (\n (tmpvar_1 * 2.0)\n , 1.0))))), u_mix);\n lowp vec4 tmpvar_3;\n tmpvar_3 = (tmpvar_2 + (u_color * (1.0 - tmpvar_2.w)));\n gl_FragColor = tmpvar_3;\n}\n\n", + "precision highp float;\nuniform mat4 u_matrix;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos;\n\nvoid main() {\n v_pos = a_pos;\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n", + "precision highp float;\nuniform vec4 u_color;\n\nuniform vec2 u_offset;\nuniform vec2 u_pattern_size;\nuniform vec2 u_pattern_tl;\nuniform vec2 u_pattern_br;\nuniform float u_mix;\n\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos;\n\nvoid main() {\n\n vec2 imagecoord = mod((v_pos + u_offset) / u_pattern_size, 1.0);\n vec2 pos = mix(u_pattern_tl, u_pattern_br, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord2 = mod(imagecoord * 2.0, 1.0);\n vec2 pos2 = mix(u_pattern_tl, u_pattern_br, imagecoord2);\n vec4 color2 = texture2D(u_image, pos2);\n\n vec4 color = mix(color1, color2, u_mix);\n gl_FragColor = color + u_color * (1.0 - color.a);\n}\n", }, { - "precision highp float;\nattribute vec2 a_pos;\nuniform mat4 u_matrix;\nvoid main ()\n{\n vec4 tmpvar_1;\n tmpvar_1.zw = vec2(0.0, 1.0);\n tmpvar_1.xy = a_pos;\n gl_Position = (u_matrix * tmpvar_1);\n}\n\n", - "precision highp float;\nuniform vec4 u_color;\nvoid main ()\n{\n gl_FragColor = u_color;\n}\n\n", + "precision highp float;\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n", + "precision highp float;\nuniform vec4 u_color;\n\nvoid main() {\n gl_FragColor = u_color;\n}\n", }, { - "precision highp float;\nattribute vec2 a_pos;\nuniform mat4 u_matrix;\nuniform float u_size;\nvoid main ()\n{\n vec4 tmpvar_1;\n tmpvar_1.zw = vec2(0.0, 1.0);\n tmpvar_1.xy = a_pos;\n gl_Position = (u_matrix * tmpvar_1);\n gl_PointSize = u_size;\n}\n\n", - "precision highp float;\nuniform sampler2D u_image;\nuniform vec2 u_tl;\nuniform vec2 u_br;\nuniform vec4 u_color;\nvoid main ()\n{\n mediump vec2 tmpvar_1;\n tmpvar_1 = (((\n ((gl_PointCoord * 2.0) - 1.0)\n * 1.41421) / 2.0) + 0.5);\n mediump vec2 tmpvar_2;\n tmpvar_2 = mix (u_tl, u_br, tmpvar_1);\n lowp vec4 tmpvar_3;\n tmpvar_3 = texture2D (u_image, tmpvar_2);\n gl_FragColor = ((tmpvar_3 * (\n ((float((tmpvar_1.x >= 0.0)) * float((tmpvar_1.y >= 0.0))) * (1.0 - float((tmpvar_1.x >= 1.0))))\n * \n (1.0 - float((tmpvar_1.y >= 1.0)))\n )) * u_color);\n}\n\n", + "precision highp float;\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform float u_size;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n gl_PointSize = u_size;\n}\n", + "precision highp float;\n#define root2 1.4142135623730951\n\nuniform sampler2D u_image;\nuniform vec2 u_tl;\nuniform vec2 u_br;\nuniform vec4 u_color;\n\nuniform vec2 pos;\nuniform float inbounds;\nuniform vec4 color;\n\nvoid main() {\n vec2 pos = (gl_PointCoord * 2.0 - 1.0) * root2 / 2.0 + 0.5;\n\n float inbounds = step(0.0, pos.x) * step(0.0, pos.y) *\n (1.0 - step(1.0, pos.x)) * (1.0 - step(1.0, pos.y));\n\n vec4 color = texture2D(u_image, mix(u_tl, u_br, pos)) * inbounds;\n\n gl_FragColor = color * u_color;\n}\n", }, { - "precision highp float;\nuniform mat4 u_matrix;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\nvoid main ()\n{\n vec4 tmpvar_1;\n tmpvar_1.zw = vec2(0.0, 1.0);\n tmpvar_1.xy = a_pos;\n gl_Position = (u_matrix * tmpvar_1);\n v_pos = (a_pos / 4096.0);\n}\n\n", - "precision highp float;\nuniform sampler2D u_image;\nuniform float u_opacity;\nvarying vec2 v_pos;\nvoid main ()\n{\n lowp vec4 tmpvar_1;\n tmpvar_1 = (texture2D (u_image, v_pos) * u_opacity);\n gl_FragColor = tmpvar_1;\n}\n\n", + "precision highp float;\nuniform mat4 u_matrix;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = a_pos / 4096.0;\n}\n", + "precision highp float;\nuniform sampler2D u_image;\nuniform float u_opacity;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_FragColor = texture2D(u_image, v_pos) * u_opacity;\n}\n", }, { - "precision highp float;\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec4 a_data1;\nattribute vec4 a_data2;\nuniform mat4 u_matrix;\nuniform mat4 u_exmatrix;\nuniform float u_angle;\nuniform float u_zoom;\nuniform float u_flip;\nuniform float u_fadedist;\nuniform float u_minfadezoom;\nuniform float u_maxfadezoom;\nuniform float u_fadezoom;\nuniform vec2 u_texsize;\nvarying vec2 v_tex;\nvarying float v_alpha;\nvoid main ()\n{\n float rev_1;\n rev_1 = 0.0;\n float tmpvar_2;\n tmpvar_2 = (float(mod ((a_data1.w + u_angle), 256.0)));\n if ((((u_flip > 0.0) && (tmpvar_2 >= 64.0)) && (tmpvar_2 < 192.0))) {\n rev_1 = 1.0;\n };\n float tmpvar_3;\n tmpvar_3 = (((2.0 - \n float((u_zoom >= a_data2.x))\n ) - (1.0 - \n float((u_zoom >= a_data2.y))\n )) + rev_1);\n float tmpvar_4;\n tmpvar_4 = clamp (((u_fadezoom - a_data1.z) / u_fadedist), 0.0, 1.0);\n if ((u_fadedist >= 0.0)) {\n v_alpha = tmpvar_4;\n } else {\n v_alpha = (1.0 - tmpvar_4);\n };\n if ((u_maxfadezoom < a_data1.z)) {\n v_alpha = 0.0;\n };\n if ((u_minfadezoom >= a_data1.z)) {\n v_alpha = 1.0;\n };\n vec4 tmpvar_5;\n tmpvar_5.zw = vec2(0.0, 1.0);\n tmpvar_5.xy = a_pos;\n vec4 tmpvar_6;\n tmpvar_6.w = 0.0;\n tmpvar_6.xy = (a_offset / 64.0);\n tmpvar_6.z = ((tmpvar_3 + float(\n (0.0 >= v_alpha)\n )) + ((1.0 - \n float((u_angle >= a_data2.z))\n ) * float(\n (u_angle >= a_data2.w)\n )));\n gl_Position = ((u_matrix * tmpvar_5) + (u_exmatrix * tmpvar_6));\n v_tex = ((a_data1.xy * 4.0) / u_texsize);\n}\n\n", - "precision highp float;\nuniform sampler2D u_texture;\nuniform vec4 u_color;\nuniform float u_buffer;\nuniform float u_gamma;\nvarying vec2 v_tex;\nvarying float v_alpha;\nvoid main ()\n{\n float edge0_1;\n edge0_1 = (u_buffer - u_gamma);\n lowp float tmpvar_2;\n tmpvar_2 = clamp (((texture2D (u_texture, v_tex).w - edge0_1) / (\n (u_buffer + u_gamma)\n - edge0_1)), 0.0, 1.0);\n lowp vec4 tmpvar_3;\n tmpvar_3 = (u_color * ((tmpvar_2 * \n (tmpvar_2 * (3.0 - (2.0 * tmpvar_2)))\n ) * v_alpha));\n gl_FragColor = tmpvar_3;\n}\n\n", + "precision highp float;\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec4 a_data1;\nattribute vec4 a_data2;\n\n\n// posmatrix is for the vertex position, exmatrix is for rotating and projecting\n// the extrusion vector.\nuniform mat4 u_matrix;\nuniform mat4 u_exmatrix;\nuniform float u_angle;\nuniform float u_zoom;\nuniform float u_flip;\nuniform float u_fadedist;\nuniform float u_minfadezoom;\nuniform float u_maxfadezoom;\nuniform float u_fadezoom;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying float v_alpha;\n\nvoid main() {\n vec2 a_tex = a_data1.xy;\n float a_labelminzoom = a_data1[2];\n float a_angle = a_data1[3];\n vec2 a_zoom = a_data2.st;\n vec2 a_range = a_data2.pq;\n\n float rev = 0.0;\n\n // u_angle is angle of the map, -128..128 representing 0..2PI\n // a_angle is angle of the label, 0..256 representing 0..2PI, where 0 is horizontal text\n float rotated = mod(a_angle + u_angle, 256.0);\n // if the label rotates with the map, and if the rotated label is upside down, hide it\n if (u_flip > 0.0 && rotated >= 64.0 && rotated < 192.0) rev = 1.0;\n\n // If the label should be invisible, we move the vertex outside\n // of the view plane so that the triangle gets clipped. This makes it easier\n // for us to create degenerate triangle strips.\n // u_zoom is the current zoom level adjusted for the change in font size\n float z = 2.0 - step(a_zoom[0], u_zoom) - (1.0 - step(a_zoom[1], u_zoom)) + rev;\n\n // fade out labels\n float alpha = clamp((u_fadezoom - a_labelminzoom) / u_fadedist, 0.0, 1.0);\n\n if (u_fadedist >= 0.0) {\n v_alpha = alpha;\n } else {\n v_alpha = 1.0 - alpha;\n }\n if (u_maxfadezoom < a_labelminzoom) {\n v_alpha = 0.0;\n }\n if (u_minfadezoom >= a_labelminzoom) {\n v_alpha = 1.0;\n }\n\n // if label has been faded out, clip it\n z += step(v_alpha, 0.0);\n\n // all the angles are 0..256 representing 0..2PI\n // hide if (angle >= a_rangeend && angle < rangestart)\n z += (1.0 - step(a_range[0], u_angle)) * step(a_range[1], u_angle);\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + u_exmatrix * vec4(a_offset / 64.0, z, 0);\n v_tex = a_tex * 4.0 / u_texsize;\n}\n", + "precision highp float;\nuniform sampler2D u_texture;\nuniform vec4 u_color;\nuniform float u_buffer;\nuniform float u_gamma;\n\nvarying vec2 v_tex;\nvarying float v_alpha;\n\nvoid main() {\n float dist = texture2D(u_texture, v_tex).a;\n float alpha = smoothstep(u_buffer - u_gamma, u_buffer + u_gamma, dist) * v_alpha;\n gl_FragColor = u_color * alpha;\n}\n", } }; #endif