From b6714b9c3c32eb8c48f4d7e14a03226ae296dbcb Mon Sep 17 00:00:00 2001 From: Nathaniel Kelso Date: Mon, 24 Jul 2017 13:51:14 -0700 Subject: [PATCH 1/4] add dev URLs for Terrain v2 sources --- walkabout-style.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/walkabout-style.yaml b/walkabout-style.yaml index a6f1a12..f97fd73 100644 --- a/walkabout-style.yaml +++ b/walkabout-style.yaml @@ -819,9 +819,15 @@ sources: normals: # normals type: Raster # prod - url: https://tile.mapzen.com/mapzen/terrain/v1/normal/{z}/{x}/{y}.png + #url: https://tile.mapzen.com/mapzen/terrain/v1/normal/{z}/{x}/{y}.png # dev - #url: https://tile.dev.mapzen.com/mapzen/terrain/v1/normal/{z}/{x}/{y}.png + # url: https://tile.dev.mapzen.com/mapzen/terrain/v1/normal/{z}/{x}/{y}.png + # Seth's + # url: https://d34o1q5y1d9is8.cloudfront.net/normal/{z}/{x}/{y}.png + # Mapzen + url: https://k6yfeg1cx6.execute-api.us-east-1.amazonaws.com/Prod/normal/{z}/{x}/{y}.png + # url: https://s3.amazonaws.com/elevation-tiles-batchdev/biggertest/normal/{z}/{x}/{y}.png + # url: https://s3.amazonaws.com/elevation-tiles-batchdev/20170629/normal/{z}/{x}/{y}.png url_params: api_key: global.sdk_mapzen_api_key max_zoom: 15 @@ -5688,7 +5694,7 @@ layers: pedestrian: filter: - kind: [pedestrian,common] + kind: [pedestrian,common,footway] draw: terrain: color: [0.945,0.995,0.945] From b2f17a22a7cb2058af44d2517eb053af82fd620f Mon Sep 17 00:00:00 2001 From: Nathaniel Kelso Date: Mon, 7 Aug 2017 15:51:58 -0700 Subject: [PATCH 2/4] add dimmed bike, transit for those routing modes --- index.html | 22 ++++- layers/bike-interlay.yaml | 190 +++++++++++++++++++++++++++++++++++--- walkabout-style.yaml | 153 ++++++++++++++++++------------ 3 files changed, 290 insertions(+), 75 deletions(-) diff --git a/index.html b/index.html index ff04433..3da3bdb 100644 --- a/index.html +++ b/index.html @@ -22,7 +22,7 @@ - + @@ -614,22 +614,38 @@ scene.config.sources.mz_dash_line = {}; scene.config.sources.mz_route_line_bicycle = { type: 'GeoJSON', url: 'https://gist.githubusercontent.com/nvkelso/8a066359dbe7e773926fe01c44c793d4/raw/d32bbf3221a8d8ef47cf22de706768a92ed645d9/map.geojson' } scene.config.global.sdk_bike_network_overlay = false; + scene.config.global.sdk_directions = true; + scene.config.global.sdk_bike_overlay = true; + scene.config.global.sdk_path_overlay = false; + scene.config.global.sdk_transit_overlay = false; } else if( value === 'transit') { scene.config.sources.mz_route_line = {}; scene.config.sources.mz_route_line_transit = { type: 'GeoJSON', url: 'https://gist.githubusercontent.com/anonymous/71ae88cbc6d62c4d141ecd6a61060050/raw/2254bbc18243f5dc609e663a580c9412a7447936/map.geojson' } scene.config.sources.mz_dash_line = { type: 'GeoJSON', url: 'https://gist.githubusercontent.com/anonymous/d73b851c64c3e5fbfc2754aa32f44c10/raw/938ae435776e176919c4797bed1465a92e403ef3/map.geojson' } scene.config.sources.mz_route_line_bicycle = {}; + scene.config.global.sdk_directions = true; + scene.config.global.sdk_bike_overlay = false; + scene.config.global.sdk_path_overlay = false; + scene.config.global.sdk_transit_overlay = true; } else if( value === 'car') { scene.config.sources.mz_route_line = { type: 'GeoJSON', url: 'https://gist.githubusercontent.com/anonymous/9a610ebda6fe4be7bccc/raw/8d217e43f2412d48d01534ba115f1e42dac72e68/map.geojson' } - scene.config.sources.mz_route_line_transit = {} - scene.config.sources.mz_dash_line = {} + scene.config.sources.mz_route_line_transit = {}; + scene.config.sources.mz_dash_line = {}; scene.config.sources.mz_route_line_bicycle = {}; + scene.config.global.sdk_directions = true; + scene.config.global.sdk_bike_overlay = false; + scene.config.global.sdk_path_overlay = false; + scene.config.global.sdk_transit_overlay = false; } else { scene.config.sources.mz_route_line = {}; scene.config.sources.mz_route_line_transit = {}; scene.config.sources.mz_dash_line = {}; scene.config.sources.mz_route_line_bicycle = {} scene.config.global.sdk_bike_network_overlay = true; + scene.config.global.sdk_directions = false; + scene.config.global.sdk_bike_overlay = false; + scene.config.global.sdk_path_overlay = true; + scene.config.global.sdk_transit_overlay = false; } scene.updateConfig(); }); diff --git a/layers/bike-interlay.yaml b/layers/bike-interlay.yaml index 09fc281..24b5bf3 100644 --- a/layers/bike-interlay.yaml +++ b/layers/bike-interlay.yaml @@ -15,12 +15,20 @@ layers: color: black width: [[0,0px],[15,0px],[16,5px],[18,7px],[20,10px]] ux-bicycle-line-overlay: - color: black - width: [[0,0px],[5,0.5px],[11,1px],[13,1.5px],[15,2.5px],[16,0px]] + color: [[11,black],[13,white],[14,white],[17,global.dimmed_gray]] + width: [[11,2px],[11,0.15px],[13,0.15px],[14,2.5px],[15,3.5px],[16,5px]] + outline: + color: black + width: [[11,0.15px],[13,2.0px],[14,2.5px],[15,2.5px],[16,3px]] ux-bicycle-line-highlight: color: yellow - order: function() { if($zoom <16 ) { return global.sdk_order_over_everything_but_text_0; } else { return global.sdk_order_under_roads_0; } } - width: [[0,0px],[5,1px],[11,4px],[13,9px],[14,12px],[15,18px],[16,22px],[17,28px],[18,50px],[20,20m]] + order: function() { if($zoom <15 ) { return global.sdk_order_over_everything_but_text_0; } else { return global.sdk_order_under_roads_0; } } + width: [[11,7px],[13,9px],[14,14px],[15,16px],[16,20px],[18,35px],[21,30m]] + z16: + filter: { $zoom: { min: 16 } } + draw: + ux-bicycle-line-overlay: + visible: false # todo: make special color bike shop icon, hide other icons early @@ -82,6 +90,7 @@ layers: fill: global.bike_green_label size: 9px stroke: { color: global.bike_lightgreen_color_lite, width: 2px } + z_bike_draw_app_state_bike_routing_labels: global.bike_draw_app_state_bike_routing_labels service_road: bike: global.bike_draw_service @@ -134,6 +143,8 @@ layers: - cycle_barrier - bicycle_parking - function() { return global.sdk_bike_overlay; } + - not: + - function() { return global.sdk_directions; } draw: icons: sprite: function() { return 'bike_' + feature.kind; } @@ -215,6 +226,8 @@ layers: all: - kind: bicycle - function() { return global.sdk_bike_overlay; } + - not: + - function() { return global.sdk_directions; } draw: icons: visible: global.sdk_bike_shields @@ -224,6 +237,8 @@ layers: all: - kind: bicycle_rental_station - function() { return global.sdk_bike_overlay; } + - not: + - function() { return global.sdk_directions; } draw: icons: visible: global.sdk_bike_shields @@ -236,6 +251,8 @@ layers: all: - kind: drinking_water - function() { return global.sdk_bike_overlay; } + - not: + - function() { return global.sdk_directions; } draw: icons: visible: global.sdk_bike_shields @@ -245,6 +262,8 @@ layers: all: - kind: drinking_water - function() { return global.sdk_bike_overlay; } + - not: + - function() { return global.sdk_directions; } draw: icons: visible: global.sdk_bike_shields @@ -254,6 +273,8 @@ layers: all: - kind: bicycle_parking - function() { return global.sdk_bike_overlay; } + - not: + - function() { return global.sdk_directions; } draw: icons: priority: 66 @@ -265,6 +286,8 @@ layers: all: - kind: cycle_barrier - function() { return global.sdk_bike_overlay; } + - not: + - function() { return global.sdk_directions; } draw: icons: priority: 31 @@ -274,6 +297,8 @@ layers: all: - kind: [drinking_water,toilets] - function() { return global.sdk_bike_overlay; } + - not: + - function() { return global.sdk_directions; } draw: icons: priority: 31 @@ -288,6 +313,8 @@ layers: - ref: true # - name: [true, false] #- bicycle_network: [icn, ncn, rcn, lcn] + - not: + - function() { return global.sdk_directions; } draw: icons: priority: 21 @@ -340,20 +367,24 @@ layers: icons: visible: false -# sources: - # # Bicycle route line - # mz_route_line_bicycle: - # type: GeoJSON - # url: https://gist.githubusercontent.com/nvkelso/8a066359dbe7e773926fe01c44c793d4/raw/d32bbf3221a8d8ef47cf22de706768a92ed645d9/map.geojson +sources: + # Bicycle route line + mz_route_line_bicycle: + type: GeoJSON + url: https://gist.githubusercontent.com/nvkelso/8a066359dbe7e773926fe01c44c793d4/raw/d32bbf3221a8d8ef47cf22de706768a92ed645d9/map.geojson global: # TODO: temp - sdk_directions: true + sdk_directions: false + # + sdk_bike_overlay: true # should be false + sdk_path_overlay: false # shouldn't be here at all (true by default) # - sdk_bike_overlay: false # should be false - sdk_bike_network_overlay: true # should be true (isn't enabled unless sdk_bike_overlay is true) - sdk_bike_shields: true # should be true, except false for no-labels + # should be true (isn't enabled unless sdk_bike_overlay is true) + sdk_bike_network_overlay: function() { if( global.sdk_directions ) { return false; } else { return true } } + # should be true, except false for no-labels + sdk_bike_shields: function() { if( global.sdk_directions ) { return false; } else { return true } } # COLORS # @@ -642,6 +673,7 @@ global: draw: icons: color: global.bike_lightorange_color + z_bike_draw_app_state_bike_routing_shields: global.bike_draw_app_state_bike_routing_shields no_bike: filter: global.no_bike_tier4_filter draw: @@ -651,6 +683,7 @@ global: #color: global.no_bike_label # maybe these should never be visible? but they are part of cycle relations... #visible: false + z_bike_draw_app_state_bike_routing_shields: global.bike_draw_app_state_bike_routing_shields z18_bike_labels: filter: @@ -664,6 +697,7 @@ global: bike_tier1_off_road_filter: any: - { is_bicycle_related: true, kind_detail: [cycleway, path, pedestrian, steps, bridleway, raceway, corridor] } + - kind_detail: [bridleway] - cycleway: [sidepath, track, opposite_track, buffered_lane] - cycleway_left: [sidepath, track, opposite_track, buffered_lane] - cycleway_right: [sidepath, track, opposite_track, buffered_lane] @@ -697,7 +731,7 @@ global: # brown bike_tier1_off_road_track_filter: all: - - { is_bicycle_related: true, kind_detail: [track, footway] } + - { is_bicycle_related: true, kind_detail: [track, footway, bridleway] } bike_tier1_off_road_unpaved_filter: any: - surface: [unpaved, grass, ground, dirt, earth, sand, woodchips, pebblestones, compacted] @@ -741,6 +775,58 @@ global: - surface: cobblestone # DRAW STYLES + bike_draw_app_state_bike_routing: + enabled: global.sdk_directions + routing: + draw: + lines: + color: global.dimmed_gray + outline: + color: [[14,global.dimmed_gray_casing_light],[16,global.dimmed_gray_casing]] + highlight: + visible: false + bike_draw_app_state_bike_not_protected_routing: + enabled: global.sdk_directions + routing: + draw: + lines: + color: global.dimmed_gray + outline: + style: bike_dash_routing + color: [[14,global.dimmed_gray_casing_light],[16,global.dimmed_gray_casing]] + highlight: + visible: false + bike_draw_app_state_bike_routing_casings: + enabled: global.sdk_directions + routing: + draw: + casing_both: + color: global.dimmed_gray_casing_left_right + casing_left: + color: global.dimmed_gray_casing_left_right + casing_right: + color: global.dimmed_gray_casing_left_right + bike_draw_app_state_bike_routing_labels: + enabled: global.sdk_directions + routing: + draw: + text-blend-order: + font: + fill: global.dimmed_gray_text + stroke: { color: global.dimmed_gray_text_stroke } + bike_draw_app_state_bike_routing_shields: + enabled: global.sdk_directions + routing: + draw: + icons: + visible: false + color: global.dimmed_gray_shield + z17: + filter: { $zoom: { min: 17 } } + draw: + icons: + visible: true + bike_draw_highway: enabled: global.sdk_bike_overlay bike_tier1_off_road: @@ -752,6 +838,7 @@ global: color: [[8, [0.969,0.969,0.969]], [10, [0.969,0.969,0.969]], [11, global.bike_darkgreen_color]] casing: global.bike_draw_left_or_right_or_implied_tier1 networks: global.bike_networks_highway + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing bike_tier2_on_road_protected: filter: global.bike_tier2_on_road_protected_filter draw: @@ -763,6 +850,7 @@ global: width: [[8, 0.5px], [10, 0.75px], [12, 1.5px], [14, 1.75px], [16, 2.5px], [18, 4px]] casing: global.bike_draw_left_or_right_or_implied_tier2 networks: global.bike_networks_highway + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing bike_tier3_on_road_not_protected: filter: global.bike_tier3_on_road_not_protected_filter draw: @@ -775,6 +863,7 @@ global: width: [[8, 0.75px], [10, 0.75px], [12, 1.5px], [14, 1.75px], [16, 2.5px], [18, 4px]] #casing: global.bike_draw_left_or_right_or_implied_tier3 networks: global.bike_networks_highway + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing bike_draw_highway_link: enabled: global.sdk_bike_overlay @@ -789,6 +878,7 @@ global: width: [[8, 0px], [9, 0px], [13, 0px], [14, 0.6px], [16, 1.25px], [18, 2px]] casing: global.bike_draw_left_or_right_or_implied_tier1_narrow networks: global.bike_networks_link + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing bike_tier2_on_road_protected: filter: global.bike_tier2_on_road_protected_filter draw: @@ -800,6 +890,7 @@ global: width: [[8, 0px], [9, 0px], [13, 0px], [14, 0.6px], [16, 1.25px], [18, 2px]] casing: global.bike_draw_left_or_right_or_implied_tier2_narrow networks: global.bike_networks_link + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing bike_tier3_on_road_not_protected: filter: global.bike_tier3_on_road_not_protected_filter draw: @@ -812,6 +903,7 @@ global: width: [[8, 0.5px], [10, 0.75px], [12, 0.4px], [14, 0.6px], [16, 1.25px], [18, 2px]] #casing: global.bike_draw_left_or_right_or_implied_tier3_narrow networks: global.bike_networks_link + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing bike_draw_trunk_primary: enabled: global.sdk_bike_overlay @@ -834,6 +926,7 @@ global: width: [[8, 0.5px], [10, 1.35px], [13, 1.5px], [16, 2.5px], [18, 4px]] casing: global.bike_draw_left_or_right_or_implied_tier1 networks: global.bike_networks_primary + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing bike_tier2_on_road_protected: filter: global.bike_tier2_on_road_protected_filter draw: @@ -845,6 +938,7 @@ global: width: [[8, 0.5px], [11, 0.75px], [12, 0.6px], [14, 1.25px], [16, 2.25px], [17, 3px], [18, 4px]] casing: global.bike_draw_left_or_right_or_implied_tier2 networks: global.bike_networks_primary + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing bike_tier3_on_road_not_protected: filter: global.bike_tier3_on_road_not_protected_filter draw: @@ -857,6 +951,7 @@ global: width: [[8, 0.5px], [10, 0.75px], [11, 0.5px], [12, 0.5px], [14, 0.6px], [16, 2px], [18, 4px]] #casing: global.bike_draw_left_or_right_or_implied_tier3 networks: global.bike_networks_primary + zapplication-bike-route-line: global.bike_draw_app_state_bike_not_protected_routing bike_draw_secondary: enabled: global.sdk_bike_overlay @@ -885,6 +980,7 @@ global: # TODO: thicker outline at 14/15 casing: global.bike_draw_left_or_right_or_implied_tier1 networks: global.bike_networks_secondary + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing bike_tier2_on_road_protected: filter: global.bike_tier2_on_road_protected_filter draw: @@ -896,6 +992,7 @@ global: width: [[10, 0.5px], [11, 0.6px], [12, 0.6px], [14, 1px], [16, 2.25px], [18, 4px]] casing: global.bike_draw_left_or_right_or_implied_tier2 networks: global.bike_networks_secondary + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing bike_tier3_on_road_not_protected: filter: global.bike_tier3_on_road_not_protected_filter draw: @@ -908,6 +1005,7 @@ global: width: [[8, 0.5px], [10, 0.5px], [11, 0.6px], [12, 0.6px], [13, 1px], [16, 2px], [18, 4px]] #casing: global.bike_draw_left_or_right_or_implied_tier3 networks: global.bike_networks_secondary + zapplication-bike-route-line: global.bike_draw_app_state_bike_not_protected_routing bike_draw_tertiary: enabled: global.sdk_bike_overlay @@ -928,6 +1026,7 @@ global: width: [[10, 0px], [11, 0.35px], [12, 0.5px], [13, 1.5px], [16, 2px], [18, 4px]] casing: global.bike_draw_left_or_right_or_implied_tier1 networks: global.bike_networks_tertiary + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing bike_tier2_on_road_protected: filter: global.bike_tier2_on_road_protected_filter draw: @@ -939,6 +1038,7 @@ global: width: [[10, 0.5px], [11, 0.5px], [12, 0.6px], [14, 1px], [16, 2px], [17, 2px], [18, 4px]] casing: global.bike_draw_left_or_right_or_implied_tier2 networks: global.bike_networks_tertiary + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing bike_tier3_on_road_not_protected: filter: global.bike_tier3_on_road_not_protected_filter draw: @@ -951,6 +1051,7 @@ global: width: [[8, 0.5px], [10, 0.5px], [11, 0.5px], [12, 0.8px], [14, 1px], [16, 2px], [17, 2px], [18, 4px]] #casing: global.bike_draw_left_or_right_or_implied_tier3 networks: global.bike_networks_tertiary + zapplication-bike-route-line: global.bike_draw_app_state_bike_not_protected_routing bike_draw_major_road_link: enabled: global.sdk_bike_overlay @@ -971,6 +1072,7 @@ global: width: [[8, 0px], [9, 0px], [13, 0px], [14, 0.6px], [16, 1.25px], [18, 2px]] casing: global.bike_draw_left_or_right_or_implied_tier1_narrow networks: global.bike_networks_link + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing bike_tier2_on_road_protected: filter: global.bike_tier2_on_road_protected_filter draw: @@ -982,6 +1084,7 @@ global: width: [[8, 0px], [9, 0px], [12, 0.25px], [13, 0.25px], [14, 0.6px], [16, 1.25px], [18, 2px]] casing: global.bike_draw_left_or_right_or_implied_tier2_narrow networks: global.bike_networks_link + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing bike_tier3_on_road_not_protected: filter: global.bike_tier3_on_road_not_protected_filter draw: @@ -994,6 +1097,7 @@ global: width: [[8, 0px], [9, 0px], [12, 0.25px], [13, 0.25px], [14, 0.6px], [16, 1.25px], [18, 2px]] #casing: global.bike_draw_left_or_right_or_implied_tier3_narrow networks: global.bike_networks_link + zapplication-bike-route-line: global.bike_draw_app_state_bike_not_protected_routing bike_draw_minor: enabled: global.sdk_bike_overlay @@ -1014,6 +1118,7 @@ global: width: [[8, 0px], [10, 0.25px], [12, 0.5px], [13, 1px], [14, 1.5px], [16, 2.25px], [17, 3px], [18, 4px]] casing: global.bike_draw_left_or_right_or_implied_tier1 networks: global.bike_networks_minor + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing bike_tier1_on_road_greenway: filter: global.greenway_on_road_filter draw: @@ -1030,6 +1135,7 @@ global: draw: lines: order: function() { return feature.sort_rank + 10; } + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing bike_tier2_on_road_protected: filter: global.bike_tier2_on_road_protected_filter @@ -1055,6 +1161,7 @@ global: casing: global.bike_draw_left_or_right_or_implied_tier2 networks: global.bike_networks_minor + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing bike_tier3_on_road_not_protected: filter: global.bike_tier3_on_road_not_protected_filter draw: @@ -1074,8 +1181,10 @@ global: outline: style: bike_dash color: global.bike_lightorange_color + zapplication-bike-route-line: global.bike_draw_app_state_bike_not_protected_routing #casing: global.bike_draw_left_or_right_or_implied_tier3_minor_road networks: global.bike_networks_minor + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing early_order: filter: { $zoom: [12,13,14] } draw: @@ -1102,6 +1211,7 @@ global: width: [[13, 0px], [14, 0.4px], [16, 1px], [18, 2px]] casing: global.bike_draw_left_or_right_or_implied_tier1_narrow networks: global.bike_networks_service + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing bike_tier2_on_road_protected: filter: global.bike_tier2_on_road_protected_filter draw: @@ -1113,6 +1223,7 @@ global: width: [[13, 0px], [14, 0.4px], [16, 1px], [18, 2px]] casing: global.bike_draw_left_or_right_or_implied_tier2_narrow networks: global.bike_networks_service + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing bike_tier3_on_road_not_protected: filter: global.bike_tier3_on_road_not_protected_filter draw: @@ -1124,6 +1235,7 @@ global: width: [[8, 0px], [10, 0px], [13, 0px], [14, 0.4px], [16, 1px], [18, 2px]] #casing: global.bike_draw_left_or_right_or_implied_tier3_narrow networks: global.bike_networks_service + zapplication-bike-route-line: global.bike_draw_app_state_bike_not_protected_routing no_bike_draw_minor: @@ -1137,6 +1249,7 @@ global: style: no_bike_dash color: [[12, [0.900,0.900,0.900]], [13, global.bike_prohibited_color]] width: [[11, 0px], [12, 0px], [13, 0.25px], [14, 1px], [16, 1.5px], [17, 2px], [18, 3px]] + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing no_bike_draw_service: enabled: global.sdk_bike_overlay @@ -1188,7 +1301,9 @@ global: color: [[8, global.bike_brown_color], [10, global.bike_brown_color], [11, global.bike_brown_color_lite]] outline: color: global.bike_brown_color + no_bike: global.no_bike_draw_path networks: global.bike_networks_path + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing bike_tier2_on_road_protected: filter: global.bike_tier2_on_road_protected_filter draw: @@ -1199,6 +1314,7 @@ global: color: global.bike_orange_color width: [[12, 0.5px], [13, 0.6px], [15, 1px], [17, 2px], [18, 3px]] networks: global.bike_networks_path + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing bike_tier3_on_road_not_protected: filter: global.bike_tier3_on_road_not_protected_filter draw: @@ -1209,6 +1325,7 @@ global: color: global.bike_lightorange_color width: [[12, 0.5px], [13, 0.6px], [14, 0.6px], [15, 1px], [17, 2px], [18, 3px]] networks: global.bike_networks_path + zapplication-bike-route-line: global.bike_draw_app_state_bike_not_protected_routing bike_draw_footway: enabled: global.sdk_bike_overlay @@ -1249,7 +1366,10 @@ global: lines: outline: color: global.bike_darkgreen_color + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing networks: global.bike_networks_path + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing bike_draw_track: enabled: global.sdk_bike_overlay @@ -1269,6 +1389,7 @@ global: lines: visible: false networks: global.bike_networks_track + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing bike_draw_steps: enabled: global.sdk_bike_overlay @@ -1284,6 +1405,7 @@ global: draw: lines: visible: false + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing bike_draw_ferry: enabled: global.sdk_bike_overlay @@ -1299,7 +1421,7 @@ global: lines: visible: false networks: global.bike_networks_ferry - + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing no_bike_draw_path: enabled: global.sdk_bike_overlay @@ -1312,6 +1434,7 @@ global: style: no_bike_dash color: [[12, [0.900,0.900,0.900]], [13, global.bike_prohibited_color]] width: [[13, 0px], [14, 0.6px], [15, 1px], [17, 2px], [18, 3px]] + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing no_bike_draw_footway: enabled: global.sdk_bike_overlay @@ -1324,6 +1447,7 @@ global: style: no_bike_dash color: global.bike_prohibited_color width: [[13, 0px], [14, 0.5px], [15, 1px], [17, 2px], [18, 3px]] + zapplication-bike-route-line: global.bike_draw_app_state_bike_not_protected_routing ## WIDE @@ -1348,6 +1472,8 @@ global: order: function() { return feature.sort_rank + 1; } width: 8m special_casing: global.casing_bike_draw_on_off + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing_casings + z_bike_draw_app_state_bike_routing_casings: global.bike_draw_app_state_bike_routing_casings bike_draw_left_or_right_or_implied_tier2: enabled: global.sdk_bike_overlay @@ -1389,6 +1515,8 @@ global: color: global.bike_green_color_casing casing_right: color: global.bike_green_color_casing + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing + z_bike_draw_app_state_bike_routing_casings: global.bike_draw_app_state_bike_routing_casings bike_draw_left_or_right_or_implied_tier3: enabled: global.sdk_bike_overlay @@ -1411,6 +1539,8 @@ global: order: function() { return feature.sort_rank + 1; } width: 8m special_casing: global.casing_bike_draw_on_off + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing + z_bike_draw_app_state_bike_routing_casings: global.bike_draw_app_state_bike_routing_casings bike_draw_left_or_right_or_implied_tier3_minor_road: enabled: global.sdk_bike_overlay @@ -1433,6 +1563,8 @@ global: order: function() { return feature.sort_rank + 1; } width: 7m special_casing: global.casing_bike_draw_on_off + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing + z_bike_draw_app_state_bike_routing_casings: global.bike_draw_app_state_bike_routing_casings ## NARROW bike_draw_left_or_right_or_implied_tier1_narrow: @@ -1456,6 +1588,8 @@ global: order: function() { return feature.sort_rank + 1; } width: 5m special_casing: global.casing_bike_draw_on_off + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing + z_bike_draw_app_state_bike_routing_casings: global.bike_draw_app_state_bike_routing_casings bike_draw_left_or_right_or_implied_tier2_narrow: enabled: global.sdk_bike_overlay @@ -1478,6 +1612,8 @@ global: order: function() { return feature.sort_rank + 1; } width: 5m special_casing: global.casing_bike_draw_on_off + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing + z_bike_draw_app_state_bike_routing_casings: global.bike_draw_app_state_bike_routing_casings bike_draw_left_or_right_or_implied_tier3_narrow: enabled: global.sdk_bike_overlay @@ -1500,6 +1636,8 @@ global: order: function() { return feature.sort_rank + 1; } width: 5m special_casing: global.casing_bike_draw_on_off + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing + z_bike_draw_app_state_bike_routing_casings: global.bike_draw_app_state_bike_routing_casings casing_bike_draw_on_off: enabled: global.sdk_bike_overlay @@ -1546,11 +1684,15 @@ global: draw: casing_left: color: global.bike_darkgreen_color_casing + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing + z_bike_draw_app_state_bike_routing_casings: global.bike_draw_app_state_bike_routing_casings tier1_right: filter: global.casing_bike_tier1_off_road_track_filter_right draw: casing_right: color: global.bike_darkgreen_color_casing + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing + z_bike_draw_app_state_bike_routing_casings: global.bike_draw_app_state_bike_routing_casings tier2_left: filter: global.casing_bike_tier2_on_road_protected_filter_left draw: @@ -1567,6 +1709,8 @@ global: draw: casing_right: color: global.bike_green_color_casing + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing + z_bike_draw_app_state_bike_routing_casings: global.bike_draw_app_state_bike_routing_casings tier2_right: filter: global.casing_bike_tier2_on_road_protected_filter_right @@ -1584,6 +1728,9 @@ global: draw: casing_right: color: global.bike_green_color_casing + zapplication-bike-route-line: global.bike_draw_app_state_bike_routing + z_bike_draw_app_state_bike_routing_casings: global.bike_draw_app_state_bike_routing_casings + # tier3_left: # filter: global.casing_bike_tier3_on_road_not_protected_filter_left # draw: @@ -1644,6 +1791,7 @@ global: font: fill: global.bike_brown_label stroke: { color: global.bike_brown_color_lite, width: [[13,2px],[16,2px],[17,5px]] } + z_bike_draw_app_state_bike_routing_labels: global.bike_draw_app_state_bike_routing_labels steps: filter: kind_detail: steps @@ -1655,6 +1803,7 @@ global: stroke: { color: global.bike_step_color, width: [[13,2px],[16,2px],[17,5px]] } z18: global.z18_bike_labels + z_bike_draw_app_state_bike_routing_labels: global.bike_draw_app_state_bike_routing_labels bike_tier1b: filter: global.bike_tier1_off_road_track_filter draw: @@ -1666,6 +1815,7 @@ global: #size: 10px stroke: { color: global.bike_brown_color_lite, width: [[13,2px],[16,4px],[17,5px]] } z18: global.z18_bike_labels + z_bike_draw_app_state_bike_routing_labels: global.bike_draw_app_state_bike_routing_labels bike_tier1c_greenway: filter: global.greenway_on_road_filter draw: @@ -1677,6 +1827,7 @@ global: #size: 10px stroke: { color: global.bike_green_color_lite, width: [[13,2px],[16,4px],[17,5px]] } z18: global.z18_bike_labels + z_bike_draw_app_state_bike_routing_labels: global.bike_draw_app_state_bike_routing_labels bike_tier2: filter: global.bike_tier2_on_road_protected_filter draw: @@ -1696,6 +1847,7 @@ global: fill: global.bike_green_label stroke: { color: global.bike_lightgreen_color_lite, width: [[13,2px],[16,4px],[17,5px]] } z18: global.z18_bike_labels + z_bike_draw_app_state_bike_routing_labels: global.bike_draw_app_state_bike_routing_labels bike_tier3: filter: global.bike_tier3_on_road_not_protected_filter draw: @@ -1729,7 +1881,9 @@ global: font: fill: global.bike_orange_label stroke: { color: global.bike_lightorange_color_lite, width: 2px } + z_bike_draw_app_state_bike_routing_shields: global.bike_draw_app_state_bike_routing_shields z18: global.z18_bike_labels + z_bike_draw_app_state_bike_routing_labels: global.bike_draw_app_state_bike_routing_labels no_bike: filter: global.no_bike_tier4_filter draw: @@ -1745,6 +1899,7 @@ global: weight: 600 #size: 10px stroke: { color: global.no_bike_color_lite, width: [[13,2px],[16,4px],[17,5px]] } + z_bike_draw_app_state_bike_routing_labels: global.bike_draw_app_state_bike_routing_labels ferry: filter: global.bike_tier1_ferry_filter draw: @@ -1760,6 +1915,7 @@ global: weight: 600 #size: 10px stroke: { color: global.bike_blue_color_lite, width: [[13,2px],[16,4px],[17,5px]] } + z_bike_draw_app_state_bike_routing_labels: global.bike_draw_app_state_bike_routing_labels # # Bike Networks @@ -2209,6 +2365,10 @@ styles: base: lines dash: [1.50, 0.675] dash_background_color: [0.980,0.831,0.671] + bike_dash_routing: + base: lines + dash: [1.50, 0.675] + dash_background_color: global.dimmed_gray_dash_lite no_bike_dash: base: lines dash: [1.00, 0.75] diff --git a/walkabout-style.yaml b/walkabout-style.yaml index 8a3cd65..3cedab3 100644 --- a/walkabout-style.yaml +++ b/walkabout-style.yaml @@ -12,8 +12,8 @@ import: # Layers - - layers/bike-interlay.yaml - layers/path-interlay.yaml + - layers/bike-interlay.yaml global: # Sign up for a Mapzen API key to enjoy higher rate limits @@ -438,7 +438,44 @@ global: text_stroke_address: [0.913,0.925,0.933] # address stroke color townspot_sprite: townspot-m-rev # depends on land color and text settings text_font_family: 'Open Sans' # branding in asperational Unicode, yo (or Helvetica) - + # + # GRAY + dimmed_gray: '#d0d0d0' + dimmed_gray_casing: '#6c6c6c' + dimmed_gray_casing_light: '#aeaeae' + dimmed_gray_casing_left_right: '#b7b7b7' + dimmed_gray_lite: '#d1d1d1' + dimmed_gray_dash: '#bababa' + dimmed_gray_dash_lite: '#ececec' + dimmed_gray_text: '#6a6a6a' + dimmed_gray_text_stroke: '#e6e6e6' + dimmed_gray_shield: '#6c6c6c' + + draw_app_state_transit_routing: + enabled: global.sdk_directions + routing: + draw: + lines: + color: global.dimmed_gray_casing + draw_app_state_transit_routing_labels: + enabled: global.sdk_directions + routing: + draw: + text: + font: + fill: global.dimmed_gray_text + draw_app_state_transit_routing_shields: + enabled: global.sdk_directions + routing: + draw: + icons: + visible: false + color: global.dimmed_gray_shield + z17: + filter: { $zoom: { min: 16 } } + draw: + icons: + visible: true cameras: camera1: global.camera_settings @@ -832,13 +869,13 @@ sources: normals: # normals type: Raster # prod - #url: https://tile.mapzen.com/mapzen/terrain/v1/normal/{z}/{x}/{y}.png + url: https://tile.mapzen.com/mapzen/terrain/v1/normal/{z}/{x}/{y}.png # dev # url: https://tile.dev.mapzen.com/mapzen/terrain/v1/normal/{z}/{x}/{y}.png - # Seth's + # dev 2(s) # url: https://d34o1q5y1d9is8.cloudfront.net/normal/{z}/{x}/{y}.png - # Mapzen - url: https://k6yfeg1cx6.execute-api.us-east-1.amazonaws.com/Prod/normal/{z}/{x}/{y}.png + # dev 2(m) + #url: https://k6yfeg1cx6.execute-api.us-east-1.amazonaws.com/Prod/normal/{z}/{x}/{y}.png # url: https://s3.amazonaws.com/elevation-tiles-batchdev/biggertest/normal/{z}/{x}/{y}.png # url: https://s3.amazonaws.com/elevation-tiles-batchdev/20170629/normal/{z}/{x}/{y}.png url_params: @@ -5964,6 +6001,7 @@ layers: outline: #color: [[11,white],[12,black]] width: [[12,0.25px],[13,0.5px],[14,1px],[16,2px]] + zapplication-transit-route-line: global.draw_app_state_transit_routing has-data-color: filter: { colour: true } draw: @@ -5989,6 +6027,7 @@ layers: draw: lines: order: 512 + zapplication-transit-route-line: global.draw_app_state_transit_routing missing-colour: filter: { colour: false } train-missing-color: @@ -6091,56 +6130,56 @@ layers: draw: icons: visible: false + z_draw_app_state_transit_routing_labels: global.draw_app_state_transit_routing_shields z19-show-long-route-name: - filter: - $zoom: { min: 19 } - draw: - text: - font: - fill: black - style: italic - stroke: { color: white, width: 3px } - - -# transit-bus-roads: -# data: { source: mapzen, layer: roads } -# filter: { is_bus_route: true } -# draw: -# lines: -# visible: global.sdk_transit_overlay -# interactive: false -# color: [[13,[0,0,1,0.5]],[15,blue]] -# width: [[11,0.5px],[12,0.8px],[16,1.25px],[18,1m]] -# # let roads sort themselves past zoom 14 -# order: 488 -# # but give them all the same outline -# outline: -# order: 487 - - - -# transit-platforms: -# data: { source: mapzen, layer: transit } -# filter: { kind: platform, $zoom: { min: 15 }, $geometry: [polygon,line] } -# draw: -# lines: -# visible: global.sdk_transit_overlay -# color: '#bc8f96' -# width: 10m # something fishy here with the #include syntax in v0.7 tangram? -# order: 1000 # this selection should sort above basemap, but grey Zinc color still applies -# outline: -# order: 1002 -# polygons: -# visible: global.sdk_transit_overlay -# order: 1001 -# polygon_geom: -# filter: { $geometry: polygon } -# draw: -# polygons: -# color: '#bc8f96' -# outline: -# color: '#bc8f96' -# width: [[15,0px],[16,0.5px],[17,1px],[19,2px]] -# lines: -# visible: false + filter: + $zoom: { min: 19 } + draw: + text: + font: + fill: black + style: italic + stroke: { color: white, width: 3px } + z_draw_app_state_transit_routing_labels: global.draw_app_state_transit_routing_labels + + + transit-bus-roads: + enabled: global.sdk_transit_overlay + data: { source: mapzen, layer: roads } + filter: { is_bus_route: true } + draw: + lines: + color: [[12,'#8e8eff'],[14,blue],[16,'#673eff']] + width: [[12,0.5px],[16,1.25px],[18,1m]] + # let roads sort themselves past zoom 14 + order: 488 + # but give them all the same outline + outline: + order: 487 + + + transit-platforms: + enabled: global.sdk_transit_overlay + data: { source: mapzen, layer: transit } + filter: { kind: platform, $zoom: { min: 15 }, $geometry: [polygon,line] } + draw: + lines_transparent: + color: '#bc8f96' + width: 10m # something fishy here with the #include syntax in v0.7 tangram? + order: 1000 # this selection should sort above basemap, but grey Zinc color still applies + outline: + order: 1002 + polygons_transparent: + visible: global.sdk_transit_overlay + order: 1001 + polygon_geom: + filter: { $geometry: polygon } + draw: + polygons: + color: '#bc8f96' + outline: + color: '#bc8f96' + width: [[15,0px],[16,0.5px],[17,1px],[19,2px]] + lines: + visible: false From 65c63caa0af9ca0e94eea2f08a1b6e21411a68ca Mon Sep 17 00:00:00 2001 From: Nathaniel Kelso Date: Mon, 7 Aug 2017 16:52:27 -0700 Subject: [PATCH 3/4] to app state global; bug fixes --- index.html | 53 ++++++++++++++++++++++++++++++++++++--- layers/bike-interlay.yaml | 20 ++++++--------- walkabout-style.yaml | 44 ++++++++++++++++++++++++++++---- 3 files changed, 95 insertions(+), 22 deletions(-) diff --git a/index.html b/index.html index 3da3bdb..f19a1ca 100644 --- a/index.html +++ b/index.html @@ -602,6 +602,7 @@ '(default)': false, 'Hide': false, 'Car': 'car', + 'Car TbT': 'car-turn-by-turn', 'Transit': 'transit', 'Bike': 'bike' }; @@ -610,39 +611,83 @@ gui.directions_button = gui.add(gui, 'sdk_directions', sdk_directions).onChange(function(value) { if( value === 'bike' ) { scene.config.sources.mz_route_line = {}; + scene.config.sources.mz_route_start = {} + scene.config.sources.mz_route_destination = {} + scene.config.sources.mz_route_location = {} scene.config.sources.mz_route_line_transit = {}; scene.config.sources.mz_dash_line = {}; scene.config.sources.mz_route_line_bicycle = { type: 'GeoJSON', url: 'https://gist.githubusercontent.com/nvkelso/8a066359dbe7e773926fe01c44c793d4/raw/d32bbf3221a8d8ef47cf22de706768a92ed645d9/map.geojson' } scene.config.global.sdk_bike_network_overlay = false; - scene.config.global.sdk_directions = true; + scene.config.global.sdk_application_state = 'route-planning'; + scene.config.global.sdk_application_state_browse = false; + scene.config.global.sdk_application_state_search = false; + scene.config.global.sdk_application_state_route_plan = true; + scene.config.global.sdk_application_state_route_navigate = false; scene.config.global.sdk_bike_overlay = true; scene.config.global.sdk_path_overlay = false; scene.config.global.sdk_transit_overlay = false; } else if( value === 'transit') { scene.config.sources.mz_route_line = {}; + scene.config.sources.mz_route_start = {} + scene.config.sources.mz_route_destination = {} + scene.config.sources.mz_route_location = {} scene.config.sources.mz_route_line_transit = { type: 'GeoJSON', url: 'https://gist.githubusercontent.com/anonymous/71ae88cbc6d62c4d141ecd6a61060050/raw/2254bbc18243f5dc609e663a580c9412a7447936/map.geojson' } scene.config.sources.mz_dash_line = { type: 'GeoJSON', url: 'https://gist.githubusercontent.com/anonymous/d73b851c64c3e5fbfc2754aa32f44c10/raw/938ae435776e176919c4797bed1465a92e403ef3/map.geojson' } scene.config.sources.mz_route_line_bicycle = {}; - scene.config.global.sdk_directions = true; + scene.config.global.sdk_application_state = 'route-planning'; + scene.config.global.sdk_application_state_browse = false; + scene.config.global.sdk_application_state_search = false; + scene.config.global.sdk_application_state_route_plan = true; + scene.config.global.sdk_application_state_route_navigate = false; scene.config.global.sdk_bike_overlay = false; scene.config.global.sdk_path_overlay = false; scene.config.global.sdk_transit_overlay = true; } else if( value === 'car') { scene.config.sources.mz_route_line = { type: 'GeoJSON', url: 'https://gist.githubusercontent.com/anonymous/9a610ebda6fe4be7bccc/raw/8d217e43f2412d48d01534ba115f1e42dac72e68/map.geojson' } + scene.config.sources.mz_route_start = {} + scene.config.sources.mz_route_destination = {} + scene.config.sources.mz_route_location = {} scene.config.sources.mz_route_line_transit = {}; scene.config.sources.mz_dash_line = {}; scene.config.sources.mz_route_line_bicycle = {}; - scene.config.global.sdk_directions = true; + scene.config.global.sdk_application_state = 'route-planning'; + scene.config.global.sdk_application_state_browse = false; + scene.config.global.sdk_application_state_search = false; + scene.config.global.sdk_application_state_route_plan = true; + scene.config.global.sdk_application_state_route_navigate = false; + scene.config.global.sdk_bike_overlay = false; + scene.config.global.sdk_path_overlay = false; + scene.config.global.sdk_transit_overlay = false; + } else if( value === 'car-turn-by-turn') { + scene.config.sources.mz_route_line = { type: 'GeoJSON', url: 'https://gist.githubusercontent.com/anonymous/9a610ebda6fe4be7bccc/raw/8d217e43f2412d48d01534ba115f1e42dac72e68/map.geojson' } + scene.config.sources.mz_route_start = { type: 'GeoJSON', url: 'https://gist.githubusercontent.com/anonymous/5262969cb7549ea69221/raw/be03f233fa323d9b5cf50ef1d8e89a1faa3750f1/map.geojson' } + scene.config.sources.mz_route_destination = { type: 'GeoJSON', url: 'https://gist.githubusercontent.com/anonymous/dbae9635dfe46796490e/raw/df55c318635a7d91b309ed40754d4738a292fd38/map.geojson' } + scene.config.sources.mz_route_location = { type: 'GeoJSON', url: 'https://gist.githubusercontent.com/anonymous/36613092be6e2aa004fd/raw/f753d13069425199e1dea1b449ef67d723f6510e/map.geojson' } + scene.config.sources.mz_route_line_transit = {}; + scene.config.sources.mz_dash_line = {}; + scene.config.sources.mz_route_line_bicycle = {}; + scene.config.global.sdk_application_state = 'route-planning'; + scene.config.global.sdk_application_state_browse = false; + scene.config.global.sdk_application_state_search = false; + scene.config.global.sdk_application_state_route_plan = false; + scene.config.global.sdk_application_state_route_navigate = true; scene.config.global.sdk_bike_overlay = false; scene.config.global.sdk_path_overlay = false; scene.config.global.sdk_transit_overlay = false; } else { scene.config.sources.mz_route_line = {}; + scene.config.sources.mz_route_start = {} + scene.config.sources.mz_route_destination = {} + scene.config.sources.mz_route_location = {} scene.config.sources.mz_route_line_transit = {}; scene.config.sources.mz_dash_line = {}; scene.config.sources.mz_route_line_bicycle = {} scene.config.global.sdk_bike_network_overlay = true; - scene.config.global.sdk_directions = false; + scene.config.global.sdk_application_state = 'browse'; + scene.config.global.sdk_application_state_browse = true; + scene.config.global.sdk_application_state_search = false; + scene.config.global.sdk_application_state_route_plan = false; + scene.config.global.sdk_application_state_route_navigate = false; scene.config.global.sdk_bike_overlay = false; scene.config.global.sdk_path_overlay = true; scene.config.global.sdk_transit_overlay = false; diff --git a/layers/bike-interlay.yaml b/layers/bike-interlay.yaml index 24b5bf3..bc30493 100644 --- a/layers/bike-interlay.yaml +++ b/layers/bike-interlay.yaml @@ -8,8 +8,7 @@ layers: mz_route_line_bicycle: data: { source: mz_route_line_bicycle } - filter: - function() { return global.sdk_directions; } + enabled: global.sdk_application_state_route_plan draw: ux-bicycle-dot-overlay: color: black @@ -30,7 +29,6 @@ layers: ux-bicycle-line-overlay: visible: false - # todo: make special color bike shop icon, hide other icons early roads: highway: @@ -375,11 +373,7 @@ sources: global: - # TODO: temp - sdk_directions: false - # - sdk_bike_overlay: true # should be false - sdk_path_overlay: false # shouldn't be here at all (true by default) + sdk_bike_overlay: false # should be false # # should be true (isn't enabled unless sdk_bike_overlay is true) sdk_bike_network_overlay: function() { if( global.sdk_directions ) { return false; } else { return true } } @@ -776,7 +770,7 @@ global: # DRAW STYLES bike_draw_app_state_bike_routing: - enabled: global.sdk_directions + enabled: global.sdk_application_state_route_plan routing: draw: lines: @@ -786,7 +780,7 @@ global: highlight: visible: false bike_draw_app_state_bike_not_protected_routing: - enabled: global.sdk_directions + enabled: global.sdk_application_state_route_plan routing: draw: lines: @@ -797,7 +791,7 @@ global: highlight: visible: false bike_draw_app_state_bike_routing_casings: - enabled: global.sdk_directions + enabled: global.sdk_application_state_route_plan routing: draw: casing_both: @@ -807,7 +801,7 @@ global: casing_right: color: global.dimmed_gray_casing_left_right bike_draw_app_state_bike_routing_labels: - enabled: global.sdk_directions + enabled: global.sdk_application_state_route_plan routing: draw: text-blend-order: @@ -815,7 +809,7 @@ global: fill: global.dimmed_gray_text stroke: { color: global.dimmed_gray_text_stroke } bike_draw_app_state_bike_routing_shields: - enabled: global.sdk_directions + enabled: global.sdk_application_state_route_plan routing: draw: icons: diff --git a/walkabout-style.yaml b/walkabout-style.yaml index 3cedab3..64ff57c 100644 --- a/walkabout-style.yaml +++ b/walkabout-style.yaml @@ -212,6 +212,20 @@ global: sdk_order_under_everything_8: 8 sdk_order_under_everything_9: 9 # + # APPLICATION STATE + # Browsing the map, viewing search results, route planning (mobility), turn-by-turn navigation + # https://mapzen.com/documentation/cartography/api-reference/#user-experience + # values: browse, search, route-plan, route-navigation + sdk_application_state: browse + #private + app_state_function: function() { if global.application_state === 'route-plan' || global.application_state == 'route-navigation' ) { return true; } else { return false; } } + # but... + # Tangram doesn't seem to accept functions for enabled :\ + sdk_application_state_browse: true + sdk_application_state_search: false + sdk_application_state_route_plan: false + sdk_application_state_route_navigate: false + # # TRANSIT OVERLAY # should default to "auto", with SDK overriding it to true or false, # or app logic sets other booleans that triggers auto behavior later @@ -1179,6 +1193,7 @@ layers: width: [[0,3.5px],[5,5px],[9,7px],[10,6px],[11,6px],[13,8px],[14,9px],[15,10px],[16,11px],[17,12px],[18,10px]] mz_current_location_gem: data: { source: mz_current_location } + enabled: global.sdk_application_state_browse draw: ux-location-gem-overlay: interactive: global.sdk_interactive @@ -1188,6 +1203,7 @@ layers: transition: { show: { time: 0s }, hide: { time: 0s } } mz_route_location: data: { source: mz_route_location } + enabled: global.sdk_application_state_route_navigate draw: ux-location-gem-overlay: interactive: global.sdk_interactive @@ -1197,6 +1213,7 @@ layers: transition: { show: { time: 0s }, hide: { time: 0s } } mz_route_start: data: { source: mz_route_start } + #enabled: global.sdk_application_state_route_navigate draw: ux-icons-overlay: interactive: global.sdk_interactive @@ -1208,6 +1225,7 @@ layers: transition: { show: { time: 0s }, hide: { time: 0s } } mz_route_destination: data: { source: mz_route_destination } + #enabled: global.sdk_application_state_route_navigate draw: ux-icons-overlay: interactive: global.sdk_interactive @@ -1219,6 +1237,7 @@ layers: transition: { show: { time: 0s }, hide: { time: 0s } } mz_route_transit_stop: data: { source: mz_route_transit_stop } + enabled: global.sdk_application_state_route_plan draw: ux-icons-overlay: interactive: global.sdk_interactive @@ -1228,6 +1247,7 @@ layers: transition: { show: { time: 0s }, hide: { time: 0s } } mz_search_result: data: { source: mz_search_result } + enabled: global.sdk_application_state_search draw: ux-icons-overlay: interactive: global.sdk_interactive @@ -1243,6 +1263,7 @@ layers: sprite: ux-search-inactive mz_dropped_pin: data: { source: mz_dropped_pin } + enabled: global.sdk_application_state_browse draw: ux-icons-overlay: interactive: global.sdk_interactive @@ -6147,7 +6168,9 @@ layers: transit-bus-roads: enabled: global.sdk_transit_overlay data: { source: mapzen, layer: roads } - filter: { is_bus_route: true } + filter: + all: + - is_bus_route: true draw: lines: color: [[12,'#8e8eff'],[14,blue],[16,'#673eff']] @@ -6157,12 +6180,23 @@ layers: # but give them all the same outline outline: order: 487 - + planning: + filter: + all: + - function() { return global.sdk_application_state_route_plan; } + draw: + lines: + color: global.dimmed_gray transit-platforms: enabled: global.sdk_transit_overlay data: { source: mapzen, layer: transit } - filter: { kind: platform, $zoom: { min: 15 }, $geometry: [polygon,line] } + filter: + all: + - kind: platform + - $zoom: { min: 15 } + - $geometry: [polygon,line] + - function() { return global.sdk_application_state_route_plan; } draw: lines_transparent: color: '#bc8f96' @@ -6176,10 +6210,10 @@ layers: polygon_geom: filter: { $geometry: polygon } draw: - polygons: + polygons_transparent: color: '#bc8f96' outline: color: '#bc8f96' width: [[15,0px],[16,0.5px],[17,1px],[19,2px]] - lines: + lines_transparent: visible: false From 903588705e1fced8156d3b312649b5d3801b17a6 Mon Sep 17 00:00:00 2001 From: Nathaniel Kelso Date: Mon, 7 Aug 2017 17:06:40 -0700 Subject: [PATCH 4/4] use updated global name for transit overlay state --- walkabout-style.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/walkabout-style.yaml b/walkabout-style.yaml index 64ff57c..0392c07 100644 --- a/walkabout-style.yaml +++ b/walkabout-style.yaml @@ -466,20 +466,20 @@ global: dimmed_gray_shield: '#6c6c6c' draw_app_state_transit_routing: - enabled: global.sdk_directions + enabled: global.sdk_application_state_route_plan routing: draw: lines: color: global.dimmed_gray_casing draw_app_state_transit_routing_labels: - enabled: global.sdk_directions + enabled: global.sdk_application_state_route_plan routing: draw: text: font: fill: global.dimmed_gray_text draw_app_state_transit_routing_shields: - enabled: global.sdk_directions + enabled: global.sdk_application_state_route_plan routing: draw: icons: