From 9372788ab76217b50a97b61d60e76d3a1fe0d5d2 Mon Sep 17 00:00:00 2001 From: Nathaniel Kelso Date: Mon, 3 Dec 2018 22:09:32 -0800 Subject: [PATCH] colorize usa and international shield text --- index.html | 52 ++++++++++++++++----------------- themes/color-black.yaml | 2 +- themes/color-blue-gray.yaml | 17 +++++++++++ themes/color-blue.yaml | 21 +++++++++++++ themes/color-brown-orange.yaml | 17 +++++++++++ themes/color-gray-gold.yaml | 18 ++++++++++++ themes/color-gray.yaml | 22 +++++++++++++- themes/color-high-contrast.yaml | 1 - themes/color-inverted-dark.yaml | 19 ++++++++++++ themes/color-inverted.yaml | 19 ++++++++++++ themes/color-pink-yellow.yaml | 18 ++++++++++++ themes/color-pink.yaml | 22 ++++++++++++++ themes/color-purple-green.yaml | 18 ++++++++++++ themes/color-sepia.yaml | 21 +++++++++++++ themes/color-zinc.yaml | 17 +++++++++++ 15 files changed, 255 insertions(+), 29 deletions(-) diff --git a/index.html b/index.html index 116b131..980467d 100644 --- a/index.html +++ b/index.html @@ -216,21 +216,21 @@ // So many themes var theme_defaults = { color: 'black', detail: 10, label: 5 }; - var all_theme_imports = { color: 'themes/color-' + theme_defaults.color + '.yaml', + var all_theme_imports = { road_shields_usa: 'themes/refill-road-shields-usa.yaml', + road_shields_international: 'themes/refill-road-shields-international.yaml', + color: 'themes/color-' + theme_defaults.color + '.yaml', label: 'themes/label-' + theme_defaults.label + '.yaml', detail: 'themes/detail-' + theme_defaults.detail + '.yaml', texture: '', - terrain: '', - road_shields_usa: 'themes/refill-road-shields-usa.yaml', - road_shields_international: 'themes/refill-road-shields-international.yaml' + terrain: '' }; - var old_theme_imports = { color: 'themes/color-' + theme_defaults.color + '.yaml', + var old_theme_imports = { road_shields_usa: 'themes/refill-road-shields-usa.yaml', + road_shields_international: 'themes/refill-road-shields-international.yaml', + color: 'themes/color-' + theme_defaults.color + '.yaml', label: 'themes/label-' + theme_defaults.label + '.yaml', detail: 'themes/detail-' + theme_defaults.detail + '.yaml', texture: '', - terrain: '', - road_shields_usa: 'themes/refill-road-shields-usa.yaml', - road_shields_international: 'themes/refill-road-shields-international.yaml' + terrain: '' }; /*** Map ***/ @@ -257,11 +257,11 @@ // default (some): 'vector-tiles-W2tPU-Y' // no: 'vector-tiles-haXTO7g' scene: { import: [ tg_baseScene, + 'themes/refill-road-shields-usa.yaml', + 'themes/refill-road-shields-international.yaml', 'themes/color-' + theme_defaults.color + '.yaml', 'themes/label-' + theme_defaults.label + '.yaml', - 'themes/detail-' + theme_defaults.detail + '.yaml', - 'themes/refill-road-shields-usa.yaml', - 'themes/refill-road-shields-international.yaml'], + 'themes/detail-' + theme_defaults.detail + '.yaml' ], global: tg_global }, attribution: 'Tangram, © OSM contributors' }); @@ -444,20 +444,20 @@ // So many themes - var all_theme_imports = { color: null, + var all_theme_imports = { road_shields_usa: 'themes/refill-road-shields-usa.yaml', + road_shields_international: 'themes/refill-road-shields-international.yaml', detail: null, label: null, - road_shields_usa: 'themes/refill-road-shields-usa.yaml', - road_shields_international: 'themes/refill-road-shields-international.yaml' }; + color: null }; function update_scene_with_themes() { - if( old_theme_imports.color === all_theme_imports.color && + if( old_theme_imports.road_shields_usa === all_theme_imports.road_shields_usa && + old_theme_imports.road_shields_international === all_theme_imports.road_shields_international && + old_theme_imports.color === all_theme_imports.color && old_theme_imports.detail === all_theme_imports.detail && old_theme_imports.label === all_theme_imports.label && old_theme_imports.texture === all_theme_imports.texture && - old_theme_imports.terrain === all_theme_imports.terrain && - old_theme_imports.road_shields_usa === all_theme_imports.road_shields_usa && - old_theme_imports.road_shields_international === all_theme_imports.road_shields_international ) { + old_theme_imports.terrain === all_theme_imports.terrain ) { //console.log( 'no change' ); } else { //console.log( all_theme_imports, old_theme_imports ); @@ -465,6 +465,12 @@ // construct the import array themes_as_array = [tg_baseScene]; + if( all_theme_imports.road_shields_usa ) { + themes_as_array.push( all_theme_imports.road_shields_usa ); + } + if( all_theme_imports.road_shields_international ) { + themes_as_array.push( all_theme_imports.road_shields_international ); + } if( all_theme_imports.color ) { themes_as_array.push( all_theme_imports.color ); } @@ -480,24 +486,18 @@ if( all_theme_imports.terrain ) { themes_as_array.push( all_theme_imports.terrain ); } - if( all_theme_imports.road_shields_usa ) { - themes_as_array.push( all_theme_imports.road_shields_usa ); - } - if( all_theme_imports.road_shields_international ) { - themes_as_array.push( all_theme_imports.road_shields_international ); - } //console.log ( themes_as_array ); scene.load({ import: themes_as_array, global: tg_global }); + old_theme_imports.road_shields_usa = all_theme_imports.road_shields_usa; + old_theme_imports.road_shields_international = all_theme_imports.road_shields_international; old_theme_imports.color = all_theme_imports.color; old_theme_imports.detail = all_theme_imports.detail; old_theme_imports.label = all_theme_imports.label; old_theme_imports.texture = all_theme_imports.texture; old_theme_imports.terrain = all_theme_imports.terrain; - old_theme_imports.road_shields_usa = all_theme_imports.road_shields_usa; - old_theme_imports.road_shields_international = all_theme_imports.road_shields_international; } } diff --git a/themes/color-black.yaml b/themes/color-black.yaml index cfbb016..c98b1e0 100644 --- a/themes/color-black.yaml +++ b/themes/color-black.yaml @@ -76,4 +76,4 @@ global: textures: sdk_terrain_texture: - url: images/refill-spheremap-light.jpg + url: images/refill-spheremap-light.jpg \ No newline at end of file diff --git a/themes/color-blue-gray.yaml b/themes/color-blue-gray.yaml index abc7ea7..07c5f86 100644 --- a/themes/color-blue-gray.yaml +++ b/themes/color-blue-gray.yaml @@ -155,6 +155,23 @@ layers: lines: color: global.two_color_lighter + shields: + shields-usa: + z-uber-ales: + filter: { network: true, shield_text: true } + draw: + mapzen_icon_library: + text: + font: + fill: global.black_color + shields-international: + z-uber-ales: + filter: { network: true, shield_text: true } + draw: + mapzen_icon_library: + text: + font: + fill: global.black_color landuse: national_park: diff --git a/themes/color-blue.yaml b/themes/color-blue.yaml index 293a0d7..47049fd 100644 --- a/themes/color-blue.yaml +++ b/themes/color-blue.yaml @@ -83,3 +83,24 @@ styles: shaders: uniforms: u_tint: [0.626,0.738,0.920] + + +layers: + roads: + shields: + shields-usa: + z-uber-ales: + filter: { network: true, shield_text: true } + draw: + mapzen_icon_library: + text: + font: + fill: global.black_color + shields-international: + z-uber-ales: + filter: { network: true, shield_text: true } + draw: + mapzen_icon_library: + text: + font: + fill: global.black_color diff --git a/themes/color-brown-orange.yaml b/themes/color-brown-orange.yaml index 7cd0a7b..31bcd8c 100644 --- a/themes/color-brown-orange.yaml +++ b/themes/color-brown-orange.yaml @@ -154,6 +154,23 @@ layers: draw: lines: color: global.two_color_light + shields: + shields-usa: + z-uber-ales: + filter: { network: true, shield_text: true } + draw: + mapzen_icon_library: + text: + font: + fill: global.black_color + shields-international: + z-uber-ales: + filter: { network: true, shield_text: true } + draw: + mapzen_icon_library: + text: + font: + fill: global.black_color landuse: diff --git a/themes/color-gray-gold.yaml b/themes/color-gray-gold.yaml index 014b4c3..73c5ab8 100644 --- a/themes/color-gray-gold.yaml +++ b/themes/color-gray-gold.yaml @@ -168,6 +168,24 @@ layers: lines: color: global.two_color_light + shields: + shields-usa: + z-uber-ales: + filter: { network: true, shield_text: true } + draw: + mapzen_icon_library: + text: + font: + fill: global.black_color + shields-international: + z-uber-ales: + filter: { network: true, shield_text: true } + draw: + mapzen_icon_library: + text: + font: + fill: global.black_color + buildings: draw: polygons: diff --git a/themes/color-gray.yaml b/themes/color-gray.yaml index 3e7403b..12ca2c2 100644 --- a/themes/color-gray.yaml +++ b/themes/color-gray.yaml @@ -87,4 +87,24 @@ styles: pixel-pattern-light: shaders: uniforms: - u_tint: [0.990,0.990,0.990] \ No newline at end of file + u_tint: [0.990,0.990,0.990] + +layers: + roads: + shields: + shields-usa: + z-uber-ales: + filter: { network: true, shield_text: true } + draw: + mapzen_icon_library: + text: + font: + fill: global.black_color + shields-international: + z-uber-ales: + filter: { network: true, shield_text: true } + draw: + mapzen_icon_library: + text: + font: + fill: global.black_color diff --git a/themes/color-high-contrast.yaml b/themes/color-high-contrast.yaml index 7aaf876..309242c 100644 --- a/themes/color-high-contrast.yaml +++ b/themes/color-high-contrast.yaml @@ -215,7 +215,6 @@ layers: lines: color: global.black_color - landuse: landuse-not-filtered: runway: diff --git a/themes/color-inverted-dark.yaml b/themes/color-inverted-dark.yaml index 36a9f37..cfd4d91 100644 --- a/themes/color-inverted-dark.yaml +++ b/themes/color-inverted-dark.yaml @@ -177,6 +177,25 @@ layers: lines: color: global.mid_color + shields: + shields-usa: + z-uber-ales: + filter: { network: true, shield_text: true } + draw: + mapzen_icon_library: + text: + font: + fill: global.black_color + shields-international: + z-uber-ales: + filter: { network: true, shield_text: true } + draw: + mapzen_icon_library: + text: + font: + fill: global.black_color + + landuse: parks-and-national-forests-not-national-park: draw: diff --git a/themes/color-inverted.yaml b/themes/color-inverted.yaml index cabb270..b5a9ea7 100644 --- a/themes/color-inverted.yaml +++ b/themes/color-inverted.yaml @@ -177,6 +177,25 @@ layers: lines: color: global.mid_color + shields: + shields-usa: + z-uber-ales: + filter: { network: true, shield_text: true } + draw: + mapzen_icon_library: + text: + font: + fill: global.black_color + shields-international: + z-uber-ales: + filter: { network: true, shield_text: true } + draw: + mapzen_icon_library: + text: + font: + fill: global.black_color + + landuse: parks-and-national-forests-not-national-park: draw: diff --git a/themes/color-pink-yellow.yaml b/themes/color-pink-yellow.yaml index 2f95d09..7c70dcb 100644 --- a/themes/color-pink-yellow.yaml +++ b/themes/color-pink-yellow.yaml @@ -155,6 +155,24 @@ layers: lines: color: global.light_color + shields: + shields-usa: + z-uber-ales: + filter: { network: true, shield_text: true } + draw: + mapzen_icon_library: + text: + font: + fill: global.black_color + shields-international: + z-uber-ales: + filter: { network: true, shield_text: true } + draw: + mapzen_icon_library: + text: + font: + fill: global.black_color + landuse: national_park: diff --git a/themes/color-pink.yaml b/themes/color-pink.yaml index 7cbda22..b4cccf8 100644 --- a/themes/color-pink.yaml +++ b/themes/color-pink.yaml @@ -77,3 +77,25 @@ global: textures: sdk_terrain_texture: url: images/refill-spheremap-light.jpg + + + +layers: + roads: + shields: + shields-usa: + z-uber-ales: + filter: { network: true, shield_text: true } + draw: + mapzen_icon_library: + text: + font: + fill: global.black_color + shields-international: + z-uber-ales: + filter: { network: true, shield_text: true } + draw: + mapzen_icon_library: + text: + font: + fill: global.black_color diff --git a/themes/color-purple-green.yaml b/themes/color-purple-green.yaml index afcc0e7..4f2e96f 100644 --- a/themes/color-purple-green.yaml +++ b/themes/color-purple-green.yaml @@ -170,6 +170,24 @@ layers: lines: color: global.two_color_ultralight + shields: + shields-usa: + z-uber-ales: + filter: { network: true, shield_text: true } + draw: + mapzen_icon_library: + text: + font: + fill: global.black_color + shields-international: + z-uber-ales: + filter: { network: true, shield_text: true } + draw: + mapzen_icon_library: + text: + font: + fill: global.black_color + buildings: draw: polygons: diff --git a/themes/color-sepia.yaml b/themes/color-sepia.yaml index 0aba2e9..6482f34 100644 --- a/themes/color-sepia.yaml +++ b/themes/color-sepia.yaml @@ -77,3 +77,24 @@ global: textures: sdk_terrain_texture: url: images/refill-spheremap-light.jpg + + +layers: + roads: + shields: + shields-usa: + z-uber-ales: + filter: { network: true, shield_text: true } + draw: + mapzen_icon_library: + text: + font: + fill: global.black_color + shields-international: + z-uber-ales: + filter: { network: true, shield_text: true } + draw: + mapzen_icon_library: + text: + font: + fill: global.black_color diff --git a/themes/color-zinc.yaml b/themes/color-zinc.yaml index 1f38eb4..b8c6ba4 100644 --- a/themes/color-zinc.yaml +++ b/themes/color-zinc.yaml @@ -397,6 +397,23 @@ layers: lines: color: global.dark_gray_color + shields: + shields-usa: + z-uber-ales: + filter: { network: true, shield_text: true } + draw: + mapzen_icon_library: + text: + font: + fill: global.black_color + shields-international: + z-uber-ales: + filter: { network: true, shield_text: true } + draw: + mapzen_icon_library: + text: + font: + fill: global.black_color buildings: