Skip to content

Commit

Permalink
colorize usa and international shield text
Browse files Browse the repository at this point in the history
  • Loading branch information
nvkelso committed Dec 4, 2018
1 parent f2ecffd commit 9372788
Show file tree
Hide file tree
Showing 15 changed files with 255 additions and 29 deletions.
52 changes: 26 additions & 26 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 ***/
Expand All @@ -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: '<a href="https://mapzen.com/tangram" target="_blank">Tangram</a>, &copy; OSM contributors'
});
Expand Down Expand Up @@ -444,27 +444,33 @@


// 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 );

// 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 );
}
Expand All @@ -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;
}
}

Expand Down
2 changes: 1 addition & 1 deletion themes/color-black.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ global:

textures:
sdk_terrain_texture:
url: images/refill-spheremap-light.jpg
url: images/refill-spheremap-light.jpg
17 changes: 17 additions & 0 deletions themes/color-blue-gray.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
21 changes: 21 additions & 0 deletions themes/color-blue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 17 additions & 0 deletions themes/color-brown-orange.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
18 changes: 18 additions & 0 deletions themes/color-gray-gold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
22 changes: 21 additions & 1 deletion themes/color-gray.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,24 @@ styles:
pixel-pattern-light:
shaders:
uniforms:
u_tint: [0.990,0.990,0.990]
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
1 change: 0 additions & 1 deletion themes/color-high-contrast.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ layers:
lines:
color: global.black_color


landuse:
landuse-not-filtered:
runway:
Expand Down
19 changes: 19 additions & 0 deletions themes/color-inverted-dark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
19 changes: 19 additions & 0 deletions themes/color-inverted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
18 changes: 18 additions & 0 deletions themes/color-pink-yellow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
22 changes: 22 additions & 0 deletions themes/color-pink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 18 additions & 0 deletions themes/color-purple-green.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading

0 comments on commit 9372788

Please sign in to comment.