Skip to content

Commit

Permalink
Merge pull request #85 from tangrams/sensescape/more-shields
Browse files Browse the repository at this point in the history
updated icons and more shields
  • Loading branch information
nvkelso authored Feb 14, 2018
2 parents 2aaf35b + 6b88c5e commit e8cbe56
Show file tree
Hide file tree
Showing 6 changed files with 1,170 additions and 354 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.0.0
11.0.0
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<!-- Main tangram library -->
<!-- production -->
<script src="https://mapzen.com/tangram/0.14/tangram.min.js"></script>
<script src="https://www.nextzen.org/tangram/0.14/tangram.min.js"></script>
<!-- <script src="https://precog.mapzen.com/tangrams/tangram/master/dist/tangram.min.js"></script> -->
<!-- production debug -->
<!-- <script src="https://mapzen.com/tangram/0.14/tangram.debug.js"></script> -->
Expand Down Expand Up @@ -384,7 +384,7 @@
if( dev_or_prod == 'dev' ) {
url += 'dev.';
}
url += 'mapzen.com/mapzen/vector/v1/all/' + zoom + '/' + tileCoords.x + '/' + tileCoords.y + '.topojson' + '?api_key=' + mapzen_api_key;
url += 'nextzen.org/tilezen/vector/v1/all/' + zoom + '/' + tileCoords.x + '/' + tileCoords.y + '.topojson' + '?api_key=' + mapzen_api_key;
return url;
}

Expand Down
264 changes: 189 additions & 75 deletions refill-style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import:
global:
# Sign up for a Mapzen API key to enjoy higher rate limits
# https://mapzen.com/documentation/overview/#developer-accounts-and-api-keys
sdk_mapzen_api_key: '' # set this value to your Mapzen API key
sdk_api_key: '' # set this value to your Mapzen API key

#ux/ui
ux_language: false # l10n language code, trusting OSM in v0.10 tiles, fixed in v1.0 tiles
Expand Down Expand Up @@ -254,20 +254,18 @@ textures:

sources:
mapzen:
type: TopoJSON #GeoJSON, MVT, TopoJSON
url: https://tile.mapzen.com/mapzen/vector/v1/512/all/{z}/{x}/{y}.topojson
type: MVT #GeoJSON, MVT, TopoJSON
url: https://tile.nextzen.org/tilezen/vector/v1/512/all/{z}/{x}/{y}.mvt
url_params:
api_key: global.sdk_mapzen_api_key
#url: https://tile.dev.mapzen.com/mapzen/vector/v1/all/{z}/{x}/{y}.topojson
# url: //localhost:8080/vector/all/{z}/{x}/{y}.topojson
api_key: global.sdk_api_key
tile_size: 512
max_zoom: 16
normals: # normals
type: Raster
# prod
url: https://tile.mapzen.com/mapzen/terrain/v1/512/normal/{z}/{x}/{y}.png
url: https://tile.nextzen.org/tilezen/terrain/v1/512/normal/{z}/{x}/{y}.png
url_params:
api_key: global.sdk_mapzen_api_key
api_key: global.sdk_api_key
tile_size: 512
max_zoom: 14

Expand Down Expand Up @@ -2317,6 +2315,7 @@ layers:
}
}
sprite_default: generic_shield_5char
size: [[7,[90%,90%]],[12,[100%,100%]],[15,[110%,110%]]]
priority: 58
repeat_group: shields
repeat_distance: [[8, 90px],[10, 40px],[13, 30px]]
Expand Down Expand Up @@ -2407,42 +2406,42 @@ layers:
# draw:
# mapzen_icon_library:
# visible: false
width_1char:
filter: |
function() {
if( feature.shield_text ) {
return (feature.shield_text.length === 1)
} else {
return (feature.ref.length === 1)
}
}
draw:
mapzen_icon_library:
size: [[6,[14px,14px]],[13,[16px,16px]],[16,[18px,18px]]]
width_2char:
filter: |
function() {
if( feature.shield_text ) {
return (feature.shield_text.length === 2)
} else {
return (feature.ref.length === 2)
}
}
draw:
mapzen_icon_library:
size: [[6,[18px,14px]],[13,[20px,15px]],[16,[24px,18px]]]
width_3char:
filter: |
function() {
if( feature.shield_text ) {
return (feature.shield_text.length === 3)
} else {
return (feature.ref.length === 3)
}
}
draw:
mapzen_icon_library:
size: [[6,[25px,14px]],[13,[27px,15px]],[16,[33px,18px]]]
# width_1char:
# filter: |
# function() {
# if( feature.shield_text ) {
# return (feature.shield_text.length === 1)
# } else {
# return (feature.ref.length === 1)
# }
# }
# draw:
# mapzen_icon_library:
# size: [[6,[14px,14px]],[13,[16px,16px]],[16,[18px,18px]]]
# width_2char:
# filter: |
# function() {
# if( feature.shield_text ) {
# return (feature.shield_text.length === 2)
# } else {
# return (feature.ref.length === 2)
# }
# }
# draw:
# mapzen_icon_library:
# size: [[6,[18px,14px]],[13,[20px,15px]],[16,[24px,18px]]]
# width_3char:
# filter: |
# function() {
# if( feature.shield_text ) {
# return (feature.shield_text.length === 3)
# } else {
# return (feature.ref.length === 3)
# }
# }
# draw:
# mapzen_icon_library:
# size: [[6,[25px,14px]],[13,[27px,15px]],[16,[33px,18px]]]
width_4char:
filter: |
function() {
Expand All @@ -2453,8 +2452,8 @@ layers:
}
}
draw:
mapzen_icon_library:
size: [[6,[29px,14px]],[13,[31px,15px]],[16,[38px,18px]]]
# mapzen_icon_library:
# size: [[6,[29px,14px]],[13,[31px,15px]],[16,[38px,18px]]]
# London sucks
early:
filter: { $zoom: { max: 14 } }
Expand All @@ -2471,8 +2470,8 @@ layers:
}
}
draw:
mapzen_icon_library:
size: [[6,[34px,14px]],[13,[37px,15px]],[16,[45px,18px]]]
# mapzen_icon_library:
# size: [[6,[34px,14px]],[13,[37px,15px]],[16,[45px,18px]]]
# London sucks
early:
filter: { $zoom: { max: 14 } }
Expand Down Expand Up @@ -2502,17 +2501,27 @@ layers:
#
# Now for the good stuff
#
legit-shields:
filter: { shield_text: true }
z-legit-shields:
filter: |
function() {
return feature.shield_text ||
/^A.*$/.test(feature.ref) ||
/^B.*$/.test(feature.ref) ||
/^D.*$/.test(feature.ref) ||
/^N.*$/.test(feature.ref) ||
/^MEX.*$/.test(feature.ref)
}
# draw:
# mapzen_icon_library:
# color: red

# US Interstate roads
US-I:
filter:
network: 'US:I'
draw:
mapzen_icon_library:
texture: mapzen_icon_library_shields_usa
# you need to match any custom shield to the vector tile `network` values
sprite: function() { return (feature.network + '-' + feature.shield_text.length + 'char'); }
priority: 46
Expand Down Expand Up @@ -2554,6 +2563,7 @@ layers:
$zoom: { min: 7 }
draw:
mapzen_icon_library:
texture: mapzen_icon_library_shields_usa
# you need to match any custom shield to the vector tile `network` values
sprite: |
function() { return ('US:US-' + feature.shield_text.length + 'char'); }
Expand Down Expand Up @@ -2619,6 +2629,7 @@ layers:
}
draw:
mapzen_icon_library:
texture: mapzen_icon_library_shields_usa
sprite: function() { return (feature.network + '-' + feature.shield_text.length + 'char'); }
text:
offset: [0px, 1px]
Expand Down Expand Up @@ -2675,6 +2686,7 @@ layers:
}
draw:
mapzen_icon_library:
texture: mapzen_icon_library_shields_usa
sprite: |
function() { return ( 'US:NY-' + feature.shield_text.length + 'char'); }
text:
Expand Down Expand Up @@ -2716,6 +2728,7 @@ layers:
}
draw:
mapzen_icon_library:
texture: mapzen_icon_library_shields_usa
sprite: |
function() { return ( 'US:PA-' + feature.shield_text.length + 'char'); }
text:
Expand Down Expand Up @@ -2783,6 +2796,7 @@ layers:
}
draw:
mapzen_icon_library:
texture: mapzen_icon_library_shields_usa
# you need to match any custom shield to the vector tile `network` values
sprite: function() { return ('county_shield-' + feature.shield_text.length + 'char'); }
# priority: 19
Expand All @@ -2796,31 +2810,131 @@ layers:
# draw:
# mapzen_icon_library:
# visible: false
width_1char:
filter: function() { return (feature.shield_text.length === 1) }
draw:
mapzen_icon_library:
size: [[6,[14px,14px]],[13,[16px,16px]],[15,[18px,18px]]]
width_2char:
filter: function() { return (feature.shield_text.length === 2) }
draw:
mapzen_icon_library:
size: [[6,[16px,14px]],[13,[18px,16px]],[15,[22px,18px]]]
width_3char:
filter: function() { return (feature.shield_text.length === 3) }
draw:
mapzen_icon_library:
size: [[6,[20px,14px]],[13,[21px,15px]],[15,[26px,18px]]]
width_4char:
filter: function() { return (feature.shield_text.length === 4) }
draw:
mapzen_icon_library:
size: [[6,[25px,14px]],[13,[28px,15px]],[15,[34px,18px]]]
width_5char:
filter: function() { return (feature.shield_text.length === 5) }
draw:
mapzen_icon_library:
size: [[6,[30px,14px]],[13,[33px,15px]],[15,[40px,18px]]]
# width_1char:
# filter: function() { return (feature.shield_text.length === 1) }
# draw:
# mapzen_icon_library:
# size: [[6,[14px,14px]],[13,[16px,16px]],[15,[18px,18px]]]
# width_2char:
# filter: function() { return (feature.shield_text.length === 2) }
# draw:
# mapzen_icon_library:
# size: [[6,[16px,14px]],[13,[18px,16px]],[15,[22px,18px]]]
# width_3char:
# filter: function() { return (feature.shield_text.length === 3) }
# draw:
# mapzen_icon_library:
# size: [[6,[20px,14px]],[13,[21px,15px]],[15,[26px,18px]]]
# width_4char:
# filter: function() { return (feature.shield_text.length === 4) }
# draw:
# mapzen_icon_library:
# size: [[6,[25px,14px]],[13,[28px,15px]],[15,[34px,18px]]]
# width_5char:
# filter: function() { return (feature.shield_text.length === 5) }
# draw:
# mapzen_icon_library:
# size: [[6,[30px,14px]],[13,[33px,15px]],[15,[40px,18px]]]

US-OTHER:
filter: |
function() {
return feature.shield_text &&
/^US:AK$/.test(feature.network) ||
/^US:AL$/.test(feature.network) ||
/^US:AR$/.test(feature.network) ||
/^US:AZ$/.test(feature.network) ||
/^US:BIA$/.test(feature.network) ||
/^US:BLM$/.test(feature.network) ||
/^US:CO$/.test(feature.network) ||
/^US:DC$/.test(feature.network) ||
/^US:FL$/.test(feature.network) ||
/^US:FSH$/.test(feature.network) ||
/^US:FSR$/.test(feature.network) ||
/^US:GA$/.test(feature.network) ||
/^US:HI$/.test(feature.network) ||
/^US:ID$/.test(feature.network) ||
/^US:KS$/.test(feature.network) ||
/^US:LA$/.test(feature.network) ||
/^US:MA$/.test(feature.network) ||
/^US:CT$/.test(feature.network) ||
/^US:IL$/.test(feature.network) ||
/^US:TX$/.test(feature.network) ||
/^US:IN$/.test(feature.network) ||
/^US:RI$/.test(feature.network) ||
/^US:ME$/.test(feature.network) ||
/^US:WV$/.test(feature.network) ||
/^US:MT$/.test(feature.network) ||
/^US:MD$/.test(feature.network) ||
/^US:MN$/.test(feature.network) ||
/^US:MO$/.test(feature.network) ||
/^US:NC$/.test(feature.network) ||
/^US:MI$/.test(feature.network) ||
/^US:ND$/.test(feature.network) ||
/^US:NE$/.test(feature.network) ||
/^US:NH$/.test(feature.network) ||
/^US:NJ$/.test(feature.network) ||
/^US:IA$/.test(feature.network) ||
/^US:DE$/.test(feature.network) ||
/^US:KY$/.test(feature.network) ||
/^US:MS$/.test(feature.network) ||
/^US:NM$/.test(feature.network) ||
/^US:NV$/.test(feature.network) ||
/^US:OH$/.test(feature.network) ||
/^US:OK$/.test(feature.network) ||
/^US:OR$/.test(feature.network) ||
/^US:SC$/.test(feature.network) ||
/^US:SD$/.test(feature.network) ||
/^US:TN$/.test(feature.network) ||
/^US:UT$/.test(feature.network) ||
/^US:VA$/.test(feature.network) ||
/*TODO: US:VA:secondary*/
/^US:VT$/.test(feature.network) ||
/^US:WA$/.test(feature.network) ||
/^US:WI$/.test(feature.network) ||
/^US:WY$/.test(feature.network)
/*US:CA*/
/*US:I*/
/*US:NY*/
/*US:PA*/
/*US:US*/
/*county_shield*/
}
draw:
mapzen_icon_library:
texture: mapzen_icon_library_shields_usa
sprite: |
function() { return ( feature.network + '-' + feature.shield_text.length + 'char'); }
text:
# offset: [0px, 1px]
font:
fill: global.black_color
#size: [[7,7px],[13,9px],[15,10px]]
# width_1char:
# filter: function() { return (feature.shield_text.length === 1) }
# draw:
# mapzen_icon_library:
# size: [[6,[13px,17px]],[13,[15px,19px]],[15,[18px,22px]]]
# width_2char:
# filter: function() { return (feature.shield_text.length === 2) }
# draw:
# mapzen_icon_library:
# size: [[6,[17px,17px]],[13,[19px,19px]],[15,[22px,22px]]]
# width_3char:
# filter: function() { return (feature.shield_text.length === 3) }
# draw:
# mapzen_icon_library:
# size: [[6,[20px,17px]],[13,[22px,19px]],[15,[27px,22px]]]
# width_4char:
# filter: function() { return (feature.shield_text.length === 4) }
# draw:
# mapzen_icon_library:
# size: [[6,[21px,17px]],[13,[24px,19px]],[15,[29px,22px]]]
# width_5char:
# filter: function() { return (feature.shield_text.length === 5) }
# draw:
# mapzen_icon_library:
# size: [[6,[22px,17px]],[13,[25px,19px]],[15,[30px,22px]]]


winter_sport_pistes:
Expand Down
Binary file added themes/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified themes/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e8cbe56

Please sign in to comment.