Updated bubble-wrap scene to use v1 release of mapzen vector tiles 99/92199/2
authorVarun <tallytalwar@gmail.com>
Thu, 13 Oct 2016 21:32:52 +0000 (17:32 -0400)
committerVarun <tallytalwar@gmail.com>
Fri, 14 Oct 2016 01:04:26 +0000 (21:04 -0400)
Change-Id: Ia52aa5c540c60b32efc039a4481f375893c605a3

scenes/bubble-wrap/bubble-wrap.yaml

index 7845653..dce07e5 100644 (file)
@@ -154,7 +154,7 @@ global:
     sdk_transit_overlay: false
     #
     # default order for basemap features
-    feature_order: function() { return feature.sort_key; }
+    feature_order: function() { return feature.sort_rank; }
     #
     #label visibility
     text_visible_continent: true
@@ -176,6 +176,7 @@ global:
     label_visible_poi_landuse_e: true
     icon_visible_poi_landuse_e: true
     text_visible_poi_landuse_e: true
+    text_visible_landuse_generic: true
     label_visible_station: true
     icon_visible_station: true
     text_visible_station: true
@@ -535,11 +536,15 @@ textures:
 
 sources:
     mapzen:
-        type: MVT
-        url: https://vector.mapzen.com/osm/all/{z}/{x}/{y}.mvt
-        # url: http://vector.dev.mapzen.com/osm/all/{z}/{x}/{y}.mvt
+        # EraserMaps the app only supports MVT format tiles
+        type:  MVT #TopoJSON
+        #url:  http://tile.dev.mapzen.com/mapzen/vector/v1/all/{z}/{x}/{y}.mvt
+        url:  https://tile.mapzen.com/mapzen/vector/v1/all/{z}/{x}/{y}.mvt
+        #enforce_winding: true  #because Tangram v0.4 and tiles v0.5-pre don't play nice
+        #url:  //localhost:8080/vector/all/{z}/{x}/{y}.mvt
+        # road labels in Tangram JS are broken when overzooming, set max_zoom: 18 to preview fix
         url_params:
-            api_key: vector-tiles-P6dkVl4
+            api_key: vector-tiles-7bfyfz8
         max_zoom: 16
 
 #    # Only enable this for local debug, should not be enabled for prod (app inserts these at runtime)
@@ -602,6 +607,10 @@ cameras:
         type: isometric
 
 styles:
+    dashed:
+        base: lines
+        dash: [1.25, 1.25]
+        dash_background_color: [0.808,0.860,0.851]
     dashedline:
         base: lines
         texcoords: true
@@ -1154,7 +1163,7 @@ layers:
                     order: global.feature_order
                     color: [0.870,0.870,0.870]
         water-boundary-ocean-early:
-            filter: { boundary: yes, kind: ocean, $zoom: {min: 1, max: 17} }
+            filter: { boundary: true, kind: ocean, $zoom: {min: 1, max: 17} }
             draw:
                 line2:
                     style: lines
@@ -1166,14 +1175,14 @@ layers:
                     color: [[1,[0.698,0.800,0.820]],[11,[0.631,0.773,0.800]],[14,[0.543,0.740,0.780]]]
                     width: [[1,0.25px],[6,0.5px],[7,0.75px],[9,0.75px],[10,1px]]
         water-boundary-ocean-late:
-            filter: { boundary: yes, kind: ocean, $zoom: {min: 17} }
+            filter: { boundary: true, kind: ocean, $zoom: {min: 17} }
             draw:
                 water_border:
                     order: 240
                     color: [[0,[0.886,0.937,0.988]]]
                     width: 20px
         water_boundaries-not-ocean:
-            filter: { boundary: yes, not: { kind: ocean }, $zoom: { min: 8 } }
+            filter: { boundary: true, not: { kind: ocean }, $zoom: { min: 8 } }
             draw:
                 lines:
                     order: global.feature_order
@@ -1246,93 +1255,73 @@ layers:
                 text-blend-order:
                     visible: false
 
-    subway-light-rail:
+    transit-basemap:
         data: { source: mapzen, layer: transit }
-        filter: { not: { kind: [platform] }, $zoom: { min: 14 } }
-        draw:
-            lines:
-                interactive: true
-                order: function() { return feature.sort_key || 275; }
-        railway:
-            filter: { kind: [railway,train] }
-            draw:
-                lines:
-                    color: [0.588,0.671,0.698]
-                    width: [[14,0.4px],[15,0.75px],[16,1.1px],[18,2px],[19,1m]]
-        subway:
-            filter: { kind: subway }
-            draw:
-                lines:
-                    color: [0.588,0.671,0.698]
-                    width: [[14,0.4px],[15,0.75px],[16,1.3px],[17,1.5px],[18,2m]]
-        light_rail:
-            filter: { kind: [light_rail,tram], $zoom: { min: 15 } }
-            draw:
-                lines:
-                    order: 415
-                    color: [0.588,0.671,0.698]
-                    width: [[14,0px],[15,0.6px],[16,0.75px],[17,1.5px],[19,1m]]
-
-    railway-late:
-        data: { source: mapzen, layer: roads }
-        filter: { kind: rail, not: { railway: [subway,light_rail,tram] } }
-        draw:
-            lines:
-                interactive: true
-                order: global.feature_order
-                color: [0.588,0.671,0.698]
-                width: [[12,0px],[13,0.25px],[14,0.4px],[15,0.75px],[16,0.75px],[18,1m]]
-        service:
-            filter: { service: true }
-            draw:
-                lines:
-                    color: [0.588,0.671,0.698]
-                    width: [[14,0px],[15,0.3px],[16,0.5px],[18,0.75px],[19,0.5m]]
-        z-order:
-            #filter: { $zoom: {min: 12} }
+        subway-light-rail:
+            filter: { not: { kind: [platform] }, $zoom: { min: 14 } }
             draw:
                 lines:
-                    # let roads sort themselves past zoom 14
-                    order: global.feature_order
-                    # but give them all the same outline
-                    outline:
-                        order: 354
-
-            bridges-tunnels:
-                filter: { any: [is_bridge: yes, is_tunnel: yes] }
+                    interactive: true
+                    order: function() { return feature.sort_key || 275; }
+            railway:
+                filter: { kind: [railway,train] }
                 draw:
                     lines:
-                        outline:
-                            # except bridges and tunnels, their outlines should also self-sort
-                            order: function() { return feature.sort_key || 305; }
-
-    platforms:
-        data: { source: mapzen, layer: transit }
-        filter: { kind: platform }
-        draw:
-            lines_transparent:
-                color: [0.569,0.690,0.722,0.5]
-                width: 5m
-                visible: global.grey9_v
-        polygon_geom:
-            filter: { $geometry: polygon }
-            draw:
-                polygons_transparent:
-                    color: [0.592,0.671,0.694,0.5]
-                    visible: global.grey9_v
-                lines_transparent:
-                    visible: false
-                outline_transparent:
-                    color: global.grey9_o
-                    width: [[16,0px],[17,0.5px],[19,2px]]
-        z-order:
+                        color: [0.588,0.671,0.698]
+                        width: [[14,0.4px],[15,0.75px],[16,1.1px],[18,2px],[19,1m]]
+            subway:
+                filter: { kind: subway }
+                draw:
+                    lines:
+                        color: [0.588,0.671,0.698]
+                        width: [[14,0.4px],[15,0.75px],[16,1.3px],[17,1.5px],[18,2m]]
+            light_rail:
+                filter: { kind: [light_rail,tram], $zoom: { min: 15 } }
+                draw:
+                    lines:
+                        order: 415
+                        color: [0.588,0.671,0.698]
+                        width: [[14,0px],[15,0.6px],[16,0.75px],[17,1.5px],[19,1m]]
+        platforms:
+            filter: { kind: platform }
             draw:
                 lines_transparent:
-                    order: function() { if($zoom<17) { return feature.sort_key; } else { return 435; } }
-                polygons_transparent:
-                    order: function() { if($zoom<17) { return feature.sort_key; } else { return 435; } }
-                outline_transparent:
-                    order: function() { if($zoom<17) { return feature.sort_key; } else { return 436; } }
+                    color: [0.569,0.690,0.722,0.5]
+                    width: 5m
+                    visible: global.grey9_v
+            polygon_geom:
+                filter: { $geometry: polygon }
+                draw:
+                    polygons_transparent:
+                        color: [0.592,0.671,0.694,0.5]
+                        visible: global.grey9_v
+                    lines_transparent:
+                        visible: false
+                    outline_transparent:
+                        color: global.grey9_o
+                        width: [[16,0px],[17,0.5px],[19,2px]]
+            z-order:
+                draw:
+                    lines_transparent:
+                        order: function() { if($zoom<17) { return feature.sort_rank; } else { return 435; } }
+                        color: [0.569,0.690,0.722,0.5]
+                        width: 5m
+                        visible: global.grey9_v
+                    polygons_transparent:
+                        order: function() { if($zoom<17) { return feature.sort_rank; } else { return 435; } }
+                    outline_transparent:
+                        order: function() { if($zoom<17) { return feature.sort_rank; } else { return 436; } }
+                polygon_geom:
+                    filter: { $geometry: polygon }
+                    draw:
+                        polygons_transparent:
+                            color: [0.592,0.671,0.694,0.5]
+                            visible: global.grey9_v
+                        lines_transparent:
+                            visible: false
+                        outline_transparent:
+                            color: global.grey9_o
+                            width: [[16,0px],[17,0.5px],[19,2px]]
 
     roads:
         data: { source: mapzen, layer: roads }
@@ -1396,7 +1385,7 @@ layers:
                         outline:
                             order: 353
             link:
-                filter: { is_link: yes } # on- and off-ramps, etc
+                filter: { is_link: true } # on- and off-ramps, etc
                 draw:
                     lines:
                         color: [[9, global.highway_link1], [14, global.highway_link1], [15, [1.0,1.0,1.0]], [17, [1.0,1.0,1.0]]]
@@ -1412,14 +1401,14 @@ layers:
                         lines:
                             order: 352
                 tunnel-link:
-                    filter: {is_tunnel: yes, $zoom: {min: 13} }
+                    filter: {is_tunnel: true, $zoom: {min: 13} }
                     draw:
                         lines:
                             color: global.highway_tunnel1
                             outline:
                                 color: global.highway_tunnel_casing1
             tunnel:
-                filter: {is_tunnel: yes, $zoom: {min: 13} }
+                filter: {is_tunnel: true, $zoom: {min: 13} }
                 draw:
                     lines:
                         # color: [[16, [0.843,0.843,0.843]]]
@@ -1427,7 +1416,7 @@ layers:
                         outline:
                             color: [[13, [0.890,0.890,0.890]], [14, [0.870,0.870,0.870]], [16, [0.824,0.753,0.741]]]
             highway_bridge:
-                filter: {is_bridge: yes}
+                filter: {is_bridge: true}
                 draw:
                     lines:
                         cap: round
@@ -1551,7 +1540,7 @@ layers:
                     color: [[8, global.major_road4], [13, global.major_road2], [17, global.major_road1]]
                     width: [[13, 0px], [14, 2px], [16, 2.5px], [19, 8m]]
             trunk_primary:
-                filter: { highway: [trunk, primary] }
+                filter: { kind_detail: [trunk, primary] }
                 draw:
                     lines:
                         color: [1.0,1.0,1.0]
@@ -1566,19 +1555,19 @@ layers:
                         lines:
                             order: 352
                             outline:
-                                order: function() { return feature.sort_key + 2; }
+                                order: function() { return feature.sort_rank + 2; }
                     primary:
                         filter: { kind: [primary] }
                         draw:
                             lines:
                                 outline:
-                                    order: function() { return feature.sort_key + 1; }
+                                    order: function() { return feature.sort_rank + 1; }
                 routes:
                     filter: { ref: true }
                     draw:
                         lines:
                             color: [[9, global.major_route1], [14, global.major_route1], [15,[1.0,1.0,1.0]], [16,[1.0,1.0,1.0]]]
-                            #order: function() { return feature.sort_key + 1; }
+                            #order: function() { return feature.sort_rank + 1; }
                             # todo confirm widths
                             width: [[9, 1.0px], [10, 1.0px], [11, 1.2px], [12, 1.25px], [13, 1.5px], [14, 1.6px], [15, 0.15px], [16, 5.25px], [17, 12m]]
                             outline:
@@ -1588,12 +1577,12 @@ layers:
                         filter: { $zoom: { max: 16 } }
                         draw:
                             lines:
-                                order: function() { return feature.sort_key + 2; }
+                                order: function() { return feature.sort_rank + 2; }
                                 outline:
                                     order: 353
                     # no national-routes layer because it's not different than the basic style
                     tunnel:
-                        filter: {is_tunnel: yes, $zoom: {min: 13} }
+                        filter: {is_tunnel: true, $zoom: {min: 13} }
                         draw:
                             lines:
                                 color: global.major_tunnel1
@@ -1746,7 +1735,7 @@ layers:
                                 size: 17px
                                 stroke: { color: [1.00,1.00,1.00], width: 3 }
             link:
-                filter: { is_link: yes } # on- and off-ramps, etc
+                filter: { is_link: true } # on- and off-ramps, etc
                 draw:
                     lines:
                         width: [[9, 0px], [10, 0.5px], [14, 2px], [16, 4m], [17, 5m], [18, 6m]]
@@ -1754,14 +1743,14 @@ layers:
                             color: [[10, [0.827,0.827,0.827]], [13, [0.827,0.827,0.827]], [15, [1.000,0.739,0.710]]]
                             width: [[10, 0], [11, 1px], [14, 1px], [16, 1.5px], [17, 2px]]
             tunnel:
-                filter: {is_tunnel: yes, $zoom: {min: 13} }
+                filter: {is_tunnel: true, $zoom: {min: 13} }
                 draw:
                     lines:
                         color: global.major_tunnel1
                         outline:
                             color: global.major_tunnel_casing1
             secondary:
-                filter: { highway: secondary }
+                filter: { kind_detail: secondary }
                 draw:
                     lines:
                         color: [1.0,1.0,1.0]
@@ -1775,12 +1764,12 @@ layers:
                         lines:
                             order: 352
                             outline:
-                                order: 353 #function() { return feature.sort_key + 2; }
+                                order: 353 #function() { return feature.sort_rank + 2; }
                 routes:
                     filter: { ref: true, $zoom: { min: 12} }
                     draw:
                         lines:
-                            #order: function() { return feature.sort_key + 2; }
+                            #order: function() { return feature.sort_rank + 2; }
                             color: [1.0,1.0,1.0]
                             width: [[11, 0.65px], [12, 0.75px], [13, 1.25px], [14, 2px], [15, 5px], [16, 12m], [17, 12m]]
                             outline:
@@ -1790,11 +1779,11 @@ layers:
                         filter: { $zoom: { max: 15 } }
                         draw:
                             lines:
-                                order: function() { return feature.sort_key + 2; }
+                                order: function() { return feature.sort_rank + 2; }
                                 outline:
                                     order: 353
                     tunnel:
-                        filter: {is_tunnel: yes, $zoom: {min: 13} }
+                        filter: {is_tunnel: true, $zoom: {min: 13} }
                         draw:
                             lines:
                                 color: global.major_tunnel1
@@ -1924,7 +1913,7 @@ layers:
                                 size: 16px
                                 stroke: { color: [1.00,1.00,1.00], width: 3 }
             tertiary:
-                filter: { highway: [tertiary, tertiary_link] }
+                filter: { kind_detail: [tertiary, tertiary_link] }
                 draw:
                     lines:
                         color: [1.0,1.0,1.0]
@@ -1939,7 +1928,7 @@ layers:
                         lines:
                             order: 352
                             outline:
-                                order: function() { return feature.sort_key + 3; }
+                                order: function() { return feature.sort_rank + 3; }
                 routes:
                     filter: { ref: true, $zoom: { min: 12} }
                     draw:
@@ -1953,18 +1942,18 @@ layers:
                         filter: { $zoom: { max: 15 } }
                         draw:
                             lines:
-                                order: function() { return feature.sort_key + 3; }
+                                order: function() { return feature.sort_rank + 3; }
                                 outline:
                                     order: 353
                     tunnel:
-                        filter: {is_tunnel: yes, $zoom: {min: 13} }
+                        filter: {is_tunnel: true, $zoom: {min: 13} }
                         draw:
                             lines:
                                 color: global.major_tunnel1
                                 outline:
                                     color: global.major_tunnel_casing1
                 link:
-                    filter: { is_link: yes } # on- and off-ramps, etc
+                    filter: { is_link: true } # on- and off-ramps, etc
                     draw:
                         lines:
                             color: global.major_road1
@@ -2076,7 +2065,7 @@ layers:
                                 size: 15px
                                 stroke: { color: [1.00,1.00,1.00], width: 2 }
         minor_road:
-            filter: { kind: minor_road, not: { highway: service, aeroway: [runway, taxiway] } }
+            filter: { kind: minor_road, not: { kind_detail: service } }
             draw:
                 lines:
                     color: [[12, [0.9,0.9,0.9]], [13, [0.9,0.9,0.9]], [14, [1.0,1.0,1.0]]]
@@ -2161,14 +2150,14 @@ layers:
                             width: [[13, 0px], [14, 0.5px], [17, 2.0px], [18, 4.0px]]
 
             tunnel:
-                filter: {is_tunnel: yes, $zoom: {min: 13} }
+                filter: {is_tunnel: true, $zoom: {min: 13} }
                 draw:
                     lines:
                         color: [0.870,0.870,0.870]
                         outline:
                             color: [0.790,0.790,0.790]
             minor_road_bridge:
-                filter: { is_bridge: yes }
+                filter: { is_bridge: true }
                 draw:
                     lines:
                         cap: round
@@ -2220,7 +2209,7 @@ layers:
                             size: 15px
                             stroke: { color: [1.00,1.00,1.00], width: 2 }
         service_road:
-            filter: { kind: minor_road, highway: service }
+            filter: { kind: minor_road, kind_detail: service }
             draw:
                 lines:
                     color: [[12, [0.9,0.9,0.9]], [14, [0.9,0.9,0.9]], [15, [1.0,1.0,1.0]]]
@@ -2229,6 +2218,15 @@ layers:
                     outline:
                         color: [0.827,0.827,0.827]
                         width: [[15, 0px], [16, 0.5px], [17, 1.0px], [18, 1.75px]]
+
+            # Is this junk code?
+            round:
+                filter: { $zoom: { min: 17 } }
+                draw:
+                    lines:
+                        cap: round
+                        join: round
+
             in_park:
                 filter: { landuse_kind: [park,forest,nature_reserve,conservation,golf_course,garden] }
                 draw:
@@ -2317,8 +2315,7 @@ layers:
                 all:
                     - kind: [path, portage_way]
                 not:
-                    - highway: [steps, track]
-                    - man_made: [pier]
+                    - kind_detail: [steps, track, pier]
             draw:
                 lines:
                     color: [[14, [0.97,0.97,0.97]],[16,[0.96,0.96,0.96]]]
@@ -2327,7 +2324,7 @@ layers:
                         color: [0.799,0.799,0.799]
                         width: [[14, 0], [16, 0.5px], [18, 3px]]
             pedestrian:
-                filter: { highway: pedestrian }
+                filter: { kind_detail: pedestrian }
                 draw:
                     lines:
                         color: [[13, [0.97,0.97,0.97]], [16,[0.96,0.96,0.96]]]
@@ -2335,8 +2332,18 @@ layers:
                         outline:
                             color: [0.799,0.799,0.799]
                             width: [[17, 0.5], [18, 1]]
+            corridor:
+                filter: { kind_detail: corridor }
+                draw:
+                    lines:
+                        order: 1000
+                early:
+                    filter: { $zoom: { max: 17 } }
+                    draw:
+                        lines:
+                            visible: false
             bridge:
-                filter: { is_bridge: yes }
+                filter: { is_bridge: true }
                 draw:
                     lines:
                         color: [[15, [1.0,1.0,1.0]], [18, [1.0,1.0,1.0]]]
@@ -2418,7 +2425,7 @@ layers:
                             size: 12px
                             stroke: { color: [1.00,1.00,1.00], width: 1 }
         track:
-            filter: { kind: path, highway: track }
+            filter: { kind: path, kind_detail: track }
             draw:
                 lines:
                     color: [[13, global.minor_road4], [15, global.minor_road3]]
@@ -2432,7 +2439,7 @@ layers:
                         color: global.minor_casing1
                         width: [[15, 0px], [16, 0.5px], [17, 1.0px], [18, 2.0px]]
             bridge:
-                filter: { is_bridge: yes }
+                filter: { is_bridge: true }
                 draw:
                     lines:
                         width: [[15, 3.5], [17, 3m]]
@@ -2453,7 +2460,7 @@ layers:
             filter:
                 all:
                     - kind: path
-                    - highway: steps
+                    - kind_detail: steps
             draw:
                 dashedline:
                     order: global.feature_order
@@ -2547,7 +2554,7 @@ layers:
                     text-blend-order:
                         text_source: global.ux_language_text_source_piste_expert
         pier:
-            filter: { kind: path, man_made: pier }
+            filter: { kind: path, kind_detail: pier }
             draw:
                 lines:
                     color: [0.993,0.993,0.993]
@@ -2586,7 +2593,7 @@ layers:
                     lines:
                         cap: butt
             taxiway:
-                filter: { aeroway: taxiway }
+                filter: { kind_detail: taxiway }
                 draw:
                     lines:
                         color: [[13,[0.913,0.913,0.913]],[15,[0.923,0.923,0.923]],[16,[0.95,0.95,0.95]]]
@@ -2614,7 +2621,7 @@ layers:
                     color: '#444'
                     width: [[14, 0.5px], [15, 1.0px], [16, 2m]]
             gondola_cable_car:
-                filter: { aerialway: [gondola, cable_car] }
+                filter: { kind_detail: [gondola, cable_car] }
                 draw:
                     lines:
                         color: [0.498,0.302,0.243]
@@ -2623,7 +2630,7 @@ layers:
                         color: [0.498,0.302,0.243,0.15]
                         width: [[12, 0px], [13, 5px], [14, 8px], [15, 10px], [16, 12px]]
             chair_lift:
-                filter: { aerialway: chair_lift }
+                filter: { kind_detail: chair_lift }
                 draw:
                     lines:
                         color: [0.493,0.541,0.666]
@@ -2643,12 +2650,12 @@ layers:
                             size: 12px
                             stroke: { color: global.grey8, width: 4 }
                 minor:
-                    filter: { not: { aerialway: [gondola,cable_car,chair_lift] }, $zoom: { max: 17 } }
+                    filter: { not: { kind_detail: [gondola,cable_car,chair_lift] }, $zoom: { max: 17 } }
                     draw:
                         text-blend-order:
                             visible: false
                 early_gondola:
-                    filter: { $zoom: [14], aerialway: [gondola,cable_car] }
+                    filter: { $zoom: [14], kind_detail: [gondola,cable_car] }
                     draw:
                         text-blend-order:
                             font:
@@ -2660,13 +2667,45 @@ layers:
                             font:
                                 weight: 600
         bridges-tunnels:
-            filter: { any: [is_bridge: yes, is_tunnel: yes] }
+            filter: { any: [is_bridge: true, is_tunnel: true] }
             draw:
                 lines:
                     outline:
                         # except bridges and tunnels, their outlines should also self-sort
                         order: global.feature_order
 
+        railway-late:
+            filter: { kind: rail, not: { railway: [subway,light_rail,tram] } }
+            draw:
+                lines:
+                    interactive: true
+                    order: global.feature_order
+                    color: [0.588,0.671,0.698]
+                    width: [[12,0px],[13,0.25px],[14,0.4px],[15,0.75px],[16,0.75px],[18,1m]]
+            service:
+                filter: { service: true }
+                draw:
+                    lines:
+                        color: [0.588,0.671,0.698]
+                        width: [[14,0px],[15,0.3px],[16,0.5px],[18,0.75px],[19,0.5m]]
+            z-order:
+                #filter: { $zoom: {min: 12} }
+                draw:
+                    lines:
+                        # let roads sort themselves past zoom 14
+                        order: global.feature_order
+                        # but give them all the same outline
+                        outline:
+                            order: 354
+
+                bridges-tunnels:
+                    filter: { any: [is_bridge: true, is_tunnel: true] }
+                    draw:
+                        lines:
+                            outline:
+                                # except bridges and tunnels, their outlines should also self-sort
+                                order: function() { return feature.sort_key || 305; }
+
     buildings:
         data: { source: mapzen, layer: buildings }
         filter:
@@ -2677,12 +2716,42 @@ layers:
                 visible: false
                 order: 329
                 color: global.building2
+                #color: |
+#                   function() {
+#                       if( feature.id ) {
+#                           return [
+#                               0.7 * (parseInt(feature.id, 16) / 100 % 1),     // jshint ignore:line
+#                               0.7 * (parseInt(feature.id, 16) / 10000 % 1),   // jshint ignore:line
+#                               0.7 * (parseInt(feature.id, 16) / 1000000 % 1), // jshint ignore:line
+#                               1
+#                           ];
+#                       } else {
+#                           if( feature.scale_rank == 6 ) {
+#                               return [1.,0.,0.,1];
+#                           } else if( feature.scale_rank == 5 ) {
+#                               return [0.,1.,0.,1];
+#                           } else if( feature.scale_rank == 4 ) {
+#                               return [0.,0.,1.,1];
+#                           } else if( feature.scale_rank == 3 ) {
+#                               return [0.,0.,0.5,1];
+#                           } else if( feature.scale_rank == 2 ) {
+#                               return [0.,0.5,0.,1];
+#                           } else if( feature.scale_rank == 1 ) {
+#                               return [0.,0.5,0.,1];
+#                           } else if( feature.scale_rank == 0 ) {
+#                               return [0.5,0.,0.,1];
+#                           } else {
+#                               return [0.5,0.5,0.5,1];
+#                           }
+#                       }
+#                   }
+                interactive: true
             lines:
                 style: lines
                 order: 330
                 visible: false
-                color: [[14,[0.70,0.70,0.70]],[17,[0.65, 0.65, 0.65]]]
-                width: [[14, 0.6px], [15, 0.65px], [16,0.75px], [18, 1.25px]]
+                color: [[13,[0.70,0.70,0.70]],[17,[0.65, 0.65, 0.65]]]
+                width: [[13, 0.55px], [15, 0.65px], [16,0.75px], [18, 1.25px]]
 
         # turn interactive feature selection on for buildings with names
         interactive:
@@ -2693,12 +2762,8 @@ layers:
         footprints:
             filter:
                 # show footprints for buildings at least one zoom level before they will be extruded
-                - { $zoom: 13, height: { min: 250 } }
-                - { $zoom: 13, area: { min: 50000 } }
-                - { $zoom: 13, volume: { min: 200000 } }
-                - { $zoom: 14, height: { min: 190 } }
-                - { $zoom: 14, area: { min: 5000 } }
-                - { $zoom: 14, volume: { min: 150000 } }
+                - { $zoom: 13, scale_rank: [1,2] }
+                - { $zoom: 14, scale_rank: [1,2,3] }
                 - { $zoom: 15, height: { min: 100 } }
                 - { $zoom: 15, area: { min: 500 } }
                 - { $zoom: 15, volume: { min: 100000 } }
@@ -2788,86 +2853,102 @@ layers:
                 polygons:
                     color: [0.945, 0.898, 0.878]
 
-    buildings-labels:
-        data: { source: mapzen, layer: buildings }
-        filter:
-            all:
-                - { $zoom: { min: 17 } }
-                - $geometry: point
-                - not: { location: underground, kind: address }
-                - name: true
-#                - kind: [false, building, university, college, school, kindergarten]
-            any:
-                - { $zoom: [16], area: { min: 5000 } }
-                - { $zoom: [16], area: { min: 5000 } }
-                - { $zoom: [16], area: { min: 10000 }, landuse_kind: true }
-                - { $zoom: [16], area: { min: 7000 }, kind: [university, college, school, kindergarten] }
-                - { $zoom: [16], volume: { min: 50000 }, name: true }
-                - { $zoom: [17], area: { min: 3000 } }
-                - { $zoom: [17], area: { min: 2000 }, kind: [university, college, school, kindergarten] }
-                - { $zoom: [18], area: { min: 1000 } }
-                - { $zoom: [18], kind: [university, college, school, kindergarten] }
-                - { $zoom: [19], area: { min: 200 } }
-                - { $zoom: { min: 19 }, kind: [university, college, school, kindergarten] }
-                - { $zoom: { min: 20 }, area: true }
-        draw:
-            text-blend-order:
-                text_source: global.ux_language_text_source
-                interactive: true
-                move_into_tile: true
-                priority: 70
-                visible: global.text_visible_building
-                order: 7
-                font:
-                    fill: '#666'
-                    family: global.text_font_family
-                    style: italic
-                    size: 11px
-                    stroke: { color: global.text_stroke_address, width: 1 }
-        building_labels-z15-z16-z17:
-            filter: { $zoom: [15,16,17] }
-            draw: { text-blend-order: { font: { size: 12px, stroke: { width: 2 } } } }
-        building_labels-z18:
-            filter: { $zoom: [18,19] }
-            draw: { text-blend-order: { font: { size: 12px, weight: 600, stroke: { width: 3 } } } }
-        building_labels-z20-up:
-            filter: { $zoom: { min: 20 } }
-            draw: { text-blend-order: { font: { size: 14px, weight: 600, stroke: { width: 3 }  } } }
-        building-labels-z16:
-            filter: function() { if( $zoom == 16 && feature.name.length > 20 ) { return true; } else { return false; } }
+        transit-overlay-station-buildings:
+            filter:
+                any:
+                    - landuse_kind: [station]
             draw:
-                text-blend-order:
-                    visible: false
-        building-labels-z17:
-            filter: function() { if( $zoom == 17 && feature.name.length > 30 ) { return true; } else { return false; } }
+                polygons:
+                    visible: global.sdk_transit_overlay
+                    color: '#bdadbf'
+                    order: 500
+                    #extrude: function() { return feature.height || 20; }
+                outline:
+                    visible: global.sdk_transit_overlay
+                    style: lines
+                    order: 501
+                    color: '#d534df'
+                    width: [[14,0.1px],[15,0.5px],[17,0.5px],[18,0.75px],[19,0.25m]]
+                    #extrude: function() { return feature.height || 20; }
+
+        buildings-labels:
+            filter:
+                all:
+                    - { $zoom: { min: 17 } }
+                    - $geometry: point
+                    - not: { location: underground, kind: address }
+                    - name: true
+    #                - kind: [false, building, university, college, school, kindergarten]
+                any:
+                    - { $zoom: [16], area: { min: 5000 } }
+                    - { $zoom: [16], area: { min: 5000 } }
+                    - { $zoom: [16], area: { min: 10000 }, landuse_kind: true }
+                    - { $zoom: [16], area: { min: 7000 }, kind_detail: [university, college, school, kindergarten] }
+                    - { $zoom: [16], volume: { min: 50000 }, name: true }
+                    - { $zoom: [17], area: { min: 3000 } }
+                    - { $zoom: [17], area: { min: 2000 }, kind_detail: [university, college, school, kindergarten] }
+                    - { $zoom: [18], area: { min: 1000 } }
+                    - { $zoom: [18], kind_detail: [university, college, school, kindergarten] }
+                    - { $zoom: [19], area: { min: 200 } }
+                    - { $zoom: { min: 19 }, kind_detail: [university, college, school, kindergarten] }
+                    - { $zoom: { min: 20 }, area: true }
             draw:
                 text-blend-order:
-                    visible: false
-        building-labels-z20+:
-            filter: { $zoom: { min: 20 } }
+                    text_source: global.ux_language_text_source
+                    interactive: true
+                    move_into_tile: true
+                    priority: 70
+                    visible: global.text_visible_building
+                    order: 7
+                    font:
+                        fill: '#666'
+                        family: global.text_font_family
+                        style: italic
+                        size: 11px
+                        stroke: { color: global.text_stroke_address, width: 1 }
+            building_labels-z15-z16-z17:
+                filter: { $zoom: [15,16,17] }
+                draw: { text-blend-order: { font: { size: 12px, stroke: { width: 2 } } } }
+            building_labels-z18:
+                filter: { $zoom: [18,19] }
+                draw: { text-blend-order: { font: { size: 12px, weight: 600, stroke: { width: 3 } } } }
+            building_labels-z20-up:
+                filter: { $zoom: { min: 20 } }
+                draw: { text-blend-order: { font: { size: 14px, weight: 600, stroke: { width: 3 }  } } }
+            building-labels-z16:
+                filter: function() { if( $zoom == 16 && feature.name.length > 20 ) { return true; } else { return false; } }
+                draw:
+                    text-blend-order:
+                        visible: false
+            building-labels-z17:
+                filter: function() { if( $zoom == 17 && feature.name.length > 30 ) { return true; } else { return false; } }
+                draw:
+                    text-blend-order:
+                        visible: false
+            building-labels-z20+:
+                filter: { $zoom: { min: 20 } }
+                draw:
+                    text-blend-order:
+                        text_source: global.ux_language_text_source_building_and_address
+        address-labels:
+            filter:
+                $zoom: { min: 20 }
+                any:
+                    - kind: address
+                    - { label_position: true, addr_housenumber: true, name: false }
             draw:
                 text-blend-order:
-                    text_source: global.ux_language_text_source_building_and_address
-    address-labels:
-        data: { source: mapzen, layer: buildings }
-        filter:
-            $zoom: { min: 20 }
-            any:
-                - kind: address
-                - { label_position: yes, addr_housenumber: true, name: false }
-        draw:
-            text-blend-order:
-                text_source: global.ux_language_text_source
-                interactive: true
-                order: 7
-                visible: global.text_visible_address
-                text_source: addr_housenumber
-                font:
-                    fill: global.text_fill_address
-                    family: global.text_font_family
-                    style: italic
-                    size: 10px
-                    stroke: { color: global.text_stroke_address, width: 4 }
+                    text_source: global.ux_language_text_source
+                    interactive: true
+                    order: 7
+                    visible: global.text_visible_address
+                    text_source: addr_housenumber
+                    font:
+                        fill: global.text_fill_address
+                        family: global.text_font_family
+                        style: italic
+                        size: 10px
+                        stroke: { color: global.text_stroke_address, width: 4 }
 
     boundaries:
         data: { source: mapzen, layer: boundaries }
@@ -2881,41 +2962,40 @@ layers:
         country:
             filter:
                 any:
-                    - type: country
-                    - kind: nation
+                    - kind: country
                     - admin_level: 2
             draw:
                 lines:
-                    interactive: true
                     color: global.country_boundary
                     width: [[1, 0.5px], [2, 1.0px], [4, 1.5px], [9, 2.5px], [14, 3.5px], [16, 4.5px], [17, 14m]]
             water:
-                filter: { maritime_boundary: yes }
+                filter: { maritime_boundary: true }
                 draw:
                     lines:
                         visible: false
+        other_country_boundary_disputed_etc:
+            filter: { kind: [disputed, indefinite, indeterminate, lease_limit, line_of_control, overlay_limit] }
+            draw:
+                dashed:
+                    order: global.feature_order
+                    color: global.country_boundary
+                    width: [[1, 0.2px], [2, 0.5px], [4, 1.0px], [9, 1.5px], [14, 2.5px], [16, 3.5px], [17, 10m]]
         region:
             filter:
                 any:
-                    - type: state
-                    # territorial here is probably a hack
-                    - kind: [state, department, region, provincial, territorial, macroregion]
-                    - admin_level: 4
-                not:
-                    # deal with bogus Hungary data
-                    - scalerank: 0
+                    - kind: [region,macroregion]
+                    - kind_detail: [3,4]
             draw:
                 lines:
-                    interactive: true
                     color: global.region_boundary
                     width: [[0, 0.5px], [2, 1.0px], [5, 1.25px], [6, 1.5px], [7, 1.75px], [9, 3.5px], [14, 5.5px], [16, 6.5px], [17, 16m]]
             water:
-                filter: { maritime_boundary: yes }
+                filter: { maritime_boundary: true }
                 draw:
                     lines:
                         visible: false
             early:
-                filter: { scalerank: [0,3,4,5,6,7,8,9,10], $zoom: { max: 8 } }
+                filter: { not: { min_zoom: [1,2] }, $zoom: { max: 8 } }
                 draw:
                     lines:
                         visible: false
@@ -2946,7 +3026,6 @@ layers:
 
     places:
         data: { source: mapzen, layer: places }
-        filter: { not: { kind: [ocean, sea] } }
         draw:
             icons:
                 text:
@@ -3105,7 +3184,7 @@ layers:
                         visible: false
 
         region-z4:
-            filter: { name: true, kind: [state], $zoom: [4], not: { name: ["Western Cape","Eastern Cape","Northern Cape","North West","Limpopo","KwaZulu-Natal","Hamburg","Freie und Hansestadt Hamburg","Neuchâtel","Nordrhein-Westfalen","Haute-Normandie","Baden-Württemberg","Bayern","Sachsen-Anhalt","Berlin","Mecklenburg-Vorpommern","Schleswig-Holstein","Brandenburg","Niedersachsen","Saarland","Thüringen","Hessen","Sachsen"] } }
+            filter: { name: true, kind: [region], $zoom: [4], not: { name: ["Western Cape","Eastern Cape","Northern Cape","North West","Limpopo","KwaZulu-Natal","Hamburg","Freie und Hansestadt Hamburg","Neuchâtel","Nordrhein-Westfalen","Haute-Normandie","Baden-Württemberg","Bayern","Sachsen-Anhalt","Berlin","Mecklenburg-Vorpommern","Schleswig-Holstein","Brandenburg","Niedersachsen","Saarland","Thüringen","Hessen","Sachsen"] } }
             draw:
                 text-blend-order:
                     priority: 14
@@ -3117,7 +3196,7 @@ layers:
                         fill: [0.3,0.3,0.3]
 
         region-z5:
-            filter: { name: true, kind: [state], $zoom: [5], not: { name: ["Western Cape","Eastern Cape","Northern Cape","North West","Limpopo","KwaZulu-Natal","Hamburg","Freie und Hansestadt Hamburg","Neuchâtel","Nordrhein-Westfalen","Haute-Normandie","Baden-Württemberg","Bayern","Sachsen-Anhalt","Berlin","Mecklenburg-Vorpommern","Schleswig-Holstein","Brandenburg","Niedersachsen","Saarland","Thüringen","Hessen","Sachsen"] } }
+            filter: { name: true, kind: [region], $zoom: [5], not: { name: ["Western Cape","Eastern Cape","Northern Cape","North West","Limpopo","KwaZulu-Natal","Hamburg","Freie und Hansestadt Hamburg","Neuchâtel","Nordrhein-Westfalen","Haute-Normandie","Baden-Württemberg","Bayern","Sachsen-Anhalt","Berlin","Mecklenburg-Vorpommern","Schleswig-Holstein","Brandenburg","Niedersachsen","Saarland","Thüringen","Hessen","Sachsen"] } }
             draw:
                 text-blend-order:
                     priority: 14
@@ -3129,7 +3208,7 @@ layers:
                         fill: [0.3,0.3,0.3]
 
         region-z6:
-            filter: { name: true, kind: [state], $zoom: [6], not: { name: ["Western Cape","Eastern Cape","Northern Cape","North West","Limpopo","KwaZulu-Natal","Hamburg","Freie und Hansestadt Hamburg","Neuchâtel","Nordrhein-Westfalen","Haute-Normandie","Baden-Württemberg","Bayern","Sachsen-Anhalt","Berlin","Mecklenburg-Vorpommern","Schleswig-Holstein","Brandenburg","Niedersachsen","Saarland","Thüringen","Hessen","Sachsen"] } }
+            filter: { name: true, kind: [region], $zoom: [6], not: { name: ["Western Cape","Eastern Cape","Northern Cape","North West","Limpopo","KwaZulu-Natal","Hamburg","Freie und Hansestadt Hamburg","Neuchâtel","Nordrhein-Westfalen","Haute-Normandie","Baden-Württemberg","Bayern","Sachsen-Anhalt","Berlin","Mecklenburg-Vorpommern","Schleswig-Holstein","Brandenburg","Niedersachsen","Saarland","Thüringen","Hessen","Sachsen"] } }
             draw:
                 text-blend-order:
                     priority: 14
@@ -3141,7 +3220,7 @@ layers:
                         fill: [0.4,0.4,0.4]
 
         region:
-            filter: { name: true, kind: [state], $zoom: [7,8] }  # someday: province
+            filter: { name: true, kind: [region], $zoom: [7,8] }  # someday: province
             draw:
                 text-blend-order:
                     priority: 14
@@ -3175,15 +3254,20 @@ layers:
                         font: { transform: uppercase }
 
         populated-places:
+            filter: { kind: locality }
             draw:
                 icons:
                     interactive: true
                     priority: 5
+                    # debug testing
+                    #collide: false
                     text:
                         interactive: true
+                        # debug testing
+                        #collide: false
 
             populated-places-natural-earth-z2:
-                filter: { name: true, source: naturalearthdata.com, $zoom: [2], scalerank: 0 }
+                filter: { $zoom: [2] }
                 draw:
                     icons:
                         size: 5px
@@ -3197,9 +3281,9 @@ layers:
                                 # stroke: { color: global.text_stroke, width: 4 }
 
             populated-places-natural-earth-z3:
-                filter: { name: true, source: naturalearthdata.com, $zoom: [3] }
+                filter: { $zoom: [3] }
                 z3places-1:
-                    filter: { scalerank: [0] }
+                    filter: { min_zoom: [2] }
                     draw:
                         icons:
                             size: 5px
@@ -3212,7 +3296,7 @@ layers:
                                     fill: global.text_fill
                                     # stroke: { color: global.text_stroke, width: 4 }
                 z3places-2:
-                    filter: { scalerank: [1] }
+                    filter: { min_zoom: [3] }
                     draw:
                         icons:
                             priority: 7
@@ -3226,9 +3310,9 @@ layers:
                                     # stroke: { color: global.text_stroke, width: 4 }
 
             populated-places-natural-earth-z4:
-                filter: { name: true, source: naturalearthdata.com, $zoom: [4] }
+                filter: { $zoom: [4] }
                 z4places-1:
-                    filter: { scalerank: [0] }
+                    filter: { min_zoom: [2] }
                     draw:
                         icons:
                             size: 5px
@@ -3242,7 +3326,7 @@ layers:
                                     # stroke: { color: global.text_stroke, width: 4 }
 
                 z4places-2:
-                    filter: { scalerank: [1,2] }
+                    filter: { min_zoom: [3,4] }
                     draw:
                         icons:
                             priority: 7
@@ -3257,9 +3341,9 @@ layers:
                                     # stroke: { color: global.text_stroke, width: 4 }
 
             populated-places-natural-earth-z5:
-                filter: { name: true, source: naturalearthdata.com, $zoom: [5] }
+                filter: { $zoom: [5] }
                 z5places-1:
-                    filter: { scalerank: [0,1] }
+                    filter: { min_zoom: [2,3] }
                     draw:
                         icons:
                             priority: 7
@@ -3271,7 +3355,7 @@ layers:
                                 font:
                                     size: 13px
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             icons:
                                 priority: 5
@@ -3279,7 +3363,7 @@ layers:
                                 sprite: capital-l
 
                 z5places-2:
-                    filter: { scalerank: [2] }
+                    filter: { min_zoom: [4] }
                     draw:
                         icons:
                             priority: 11
@@ -3291,7 +3375,7 @@ layers:
                                 font:
                                     size: 11px
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             icons:
                                 priority: 9
@@ -3299,7 +3383,7 @@ layers:
                                 sprite: capital-m
 
                 z5places-3:
-                    filter: { scalerank: [3,4] }
+                    filter: { min_zoom: [5] }
                     draw:
                         icons:
                             priority: 17
@@ -3311,7 +3395,7 @@ layers:
                                     fill: [0.25,0.25,0.25]
                                     size: 10px
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             icons:
                                 priority: 15
@@ -3321,7 +3405,7 @@ layers:
             populated-places-natural-earth-z6:
                 filter: { name: true, source: naturalearthdata.com, $zoom: [6] }
                 z6places-1:
-                    filter: { scalerank: [0,1] }
+                    filter: { min_zoom: [2,3] }
                     draw:
                         icons:
                             priority: 7
@@ -3334,7 +3418,7 @@ layers:
                                     fill: global.text_fill
                                     size: 15px
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             icons:
                                 sprite: capital-l
@@ -3342,7 +3426,7 @@ layers:
                                 priority: 5
 
                 z6places-2:
-                    filter: { scalerank: [2,3,4] }
+                    filter: { min_zoom: [4,5] }
                     draw:
                         icons:
                             priority: 11
@@ -3355,7 +3439,7 @@ layers:
                                     fill: global.text_fill
                                     size: 12px
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             icons:
                                 size: 6px
@@ -3363,7 +3447,7 @@ layers:
                                 priority: 9
 
                 z6places-3:
-                    filter: { scalerank: [5,6] }
+                    filter: { min_zoom: [6] }
                     draw:
                         icons:
                             size: 5px
@@ -3376,7 +3460,7 @@ layers:
                                     fill: [0.25,0.25,0.25]
                                     size: 10px
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             icons:
                                 size: 6px
@@ -3386,7 +3470,7 @@ layers:
             populated-places-natural-earth-z7:
                 filter: { name: true, source: naturalearthdata.com, $zoom: [7] }
                 z7places-1:
-                    filter: { scalerank: [0,1] }
+                    filter: { min_zoom: [2,3] }
                     draw:
                         icons:
                             size: 8px
@@ -3399,7 +3483,7 @@ layers:
                                     fill: global.text_fill
                                     size: 16px
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             icons:
                                 size: 8px
@@ -3407,7 +3491,7 @@ layers:
                                 priority: 5
 
                 z7places-2:
-                    filter: { scalerank: [2,3,4,5] }
+                    filter: { min_zoom: [4,5,6] }
                     draw:
                         icons:
                             size: 6px
@@ -3420,7 +3504,7 @@ layers:
                                     fill: global.text_fill
                                     size: 13px
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             icons:
                                 size: 8px
@@ -3428,7 +3512,7 @@ layers:
                                 priority: 11
 
                 z7places-3:
-                    filter: { scalerank: [6,7] }
+                    filter: { min_zoom: [6,7] }
                     draw:
                         icons:
                             size: 5px
@@ -3441,7 +3525,7 @@ layers:
                                     fill: [0.25,0.25,0.25]
                                     size: 11px
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             icons:
                                 size: 6px
@@ -3451,12 +3535,8 @@ layers:
             populated-places-osm-z8:
                 filter:
                     all:
-                        - source: [openstreetmap, openstreetmap.org]
-                        - name: true
-                        - population: true
-                        - not: { kind: [country, county, state, island, neighbourhood, suburb, quarter] }
+                        - source: openstreetmap.org
                         - $zoom: [8]
-
                 z8places-1:
                     filter:
                         any:
@@ -3472,7 +3552,7 @@ layers:
                                 font:
                                     size: 16px
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             icons:
                                 size: 8px
@@ -3493,7 +3573,7 @@ layers:
                                 font:
                                     size: 13px
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             icons:
                                 size: 6px
@@ -3516,7 +3596,7 @@ layers:
                                     fill: [0.25,0.25,0.25]
                                     size: 11px
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             icons:
                                 size: 6px
@@ -3539,7 +3619,7 @@ layers:
                                     fill: [0.30,0.30,0.30]
                                     size: 10px
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             icons:
                                 size: 5px
@@ -3550,8 +3630,8 @@ layers:
                         all:
                             - { population: { max: 50000 } }
                         any:
-                            - { capital: yes }
-                            - { state_capital: yes }
+                            - country_capital: true
+                            - region_capital: true
                     draw:
                         icons:
                             size: 5px
@@ -3564,7 +3644,7 @@ layers:
                                     fill: [0.30,0.30,0.30]
                                     size: 10px
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             icons:
                                 size: 5px
@@ -3572,10 +3652,10 @@ layers:
                                 priority: 17
 
             populated-places-natural-earth-z8-backfill:
-                filter: { name: true, source: naturalearthdata.com, $zoom: [8], population: { max: 50000 } }
+                filter: { source: naturalearthdata.com, $zoom: [8], population: { max: 50000 } }
                 draw: { icons: { text: { font: { fill: global.text_fill } } } }
                 z8places-1-ne:
-                    filter: { scalerank: [0,1] }
+                    filter: { min_zoom: [2,3] }
                     draw:
                         icons:
                             size: 8px
@@ -3587,7 +3667,7 @@ layers:
                                 font:
                                     size: 16px
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             icons:
                                 size: 8px
@@ -3595,7 +3675,7 @@ layers:
                                 priority: 21
 
                 z8places-2-ne:
-                    filter: { scalerank: [2,3,4,5] }
+                    filter: { min_zoom: [4,5,6] }
                     draw:
                         icons:
                             size: 6px
@@ -3606,13 +3686,13 @@ layers:
                                 font:
                                     size: 13px
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             icons:
                                 sprite: capital-m
 
                 z8places-3-ne:
-                    filter: { scalerank: [6,7] }
+                    filter: { min_zoom: [6,7] }
                     draw:
                         icons:
                             size: 5px
@@ -3624,7 +3704,7 @@ layers:
                                 font:
                                     size: 11px
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             icons:
                                 sprite: capital-s
@@ -3633,10 +3713,7 @@ layers:
             populated-places-osm-z9:
                 filter:
                     all:
-                        - source: [openstreetmap, openstreetmap.org]
-                        - name: true
-                        - population: true
-                        - not: { kind: [country, county, state, island, neighbourhood, suburb, quarter] }
+                        - source: openstreetmap.org
                         - $zoom: [9]
 
                 z9places-1:
@@ -3681,7 +3758,7 @@ layers:
                                 font:
                                     size: 13px
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             icons:
                                 sprite: capital-m
@@ -3703,7 +3780,7 @@ layers:
                                     fill: [0.25,0.25,0.25]
                                     size: 11px
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             icons:
                                 sprite: capital-m
@@ -3728,7 +3805,7 @@ layers:
                                     fill: [0.30,0.30,0.30]
                                     size: 9px
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             icons:
                                 sprite: capital-s
@@ -3738,8 +3815,8 @@ layers:
                         all:
                             - { population: { max: 50000 } }
                         any:
-                            - { capital: yes }
-                            - { state_capital: yes }
+                            - country_capital: true
+                            - region_capital: true
                     draw:
                         icons:
                             size: 5px
@@ -3752,7 +3829,7 @@ layers:
                                     fill: [0.30,0.30,0.30]
                                     size: 9px
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             icons:
                                 sprite: capital-s
@@ -3761,10 +3838,7 @@ layers:
             populated-places-osm-z9-no-population:
                 filter:
                     all:
-                        - source: [openstreetmap, openstreetmap.org]
-                        - name: true
-                        - population: false
-                        - not: { kind: [country, county, state, island, neighbourhood, suburb, quarter] }
+                        - source: openstreetmap.org
                         - $zoom: [9]
                         - kind: [city,town]
                 draw:
@@ -3794,7 +3868,7 @@ layers:
                                 font:
                                     size: 16px
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             icons:
                                 sprite: capital-l
@@ -3813,7 +3887,7 @@ layers:
                                 font:
                                     size: 13px
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             icons:
                                 sprite: capital-m
@@ -3832,7 +3906,7 @@ layers:
                                 font:
                                     size: 11px
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             icons:
                                 sprite: capital-m
@@ -3841,10 +3915,7 @@ layers:
             populated-places-osm-z10:
                 filter:
                     all:
-                        - source: [openstreetmap, openstreetmap.org]
-                        - name: true
-                        - population: true
-                        - not: { kind: [country, county, state, island, neighbourhood, suburb, quarter] }
+                        - source: openstreetmap.org
                         - $zoom: [10]
 
                 z10places-1:
@@ -3924,10 +3995,7 @@ layers:
             populated-places-osm-z10-no-population:
                 filter:
                     all:
-                        - source: [openstreetmap, openstreetmap.org]
-                        - name: true
-                        - population: false
-                        - not: { kind: [country, county, state, island, neighbourhood, suburb, quarter] }
+                        - source: openstreetmap.org
                         - $zoom: [10]
                         - kind: [city,town]
                 draw:
@@ -3966,7 +4034,7 @@ layers:
                                 font:
                                     size: 13px
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             icons:
                                 sprite: capital-m
@@ -3985,111 +4053,200 @@ layers:
                                 font:
                                     size: 12px
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             icons:
                                 size: 7px
                                 sprite: capital-m
                                 priority: 23
 
+
             populated-places-osm-z11:
                 filter:
                     all:
-                        - source: [openstreetmap, openstreetmap.org]
-                        - name: true
-                        - population: true
-                        - not: { kind: [country, county, state, island, neighbourhood, suburb, quarter] }
+                        - source: openstreetmap.org
                         - $zoom: [11]
-                        - kind: [city,town]
-                draw:
-                    text-blend-order:
-                        anchor: center
-
-                z11places-1:
-                    filter:
-                        any:
-                            - { population: { min: 1000000 } }
-                    draw:
-                        text-blend-order:
-                            visible: global.text_visible_populated_places
-                            priority: 5
-                            font:
-                                size: 18px
-#                                fill: global.text_fill
-#                                stroke: { color: global.text_stroke, width: 4 }
-
-                z11places-2:
-                    filter:
-                        any:
-                            - { population: { min: 50000, max: 999999 } }
-                    draw:
-                        text-blend-order:
-                            visible: global.text_visible_populated_places
-                            priority: 6
-                            font:
-                                size: 14px
-#                                fill: global.text_fill
-#                                stroke: { color: global.text_stroke, width: 4 }
-
-                z11places-3:
-                    filter:
-                        any:
-                        - { population: { min: 5000, max: 49999 } }
-                    draw:
-                        text-blend-order:
-                            visible: global.text_visible_populated_places
-                            priority: 7
-                            font:
-                                size: 12px
-#                                fill: global.text_fill
-#                                stroke: { color: global.text_stroke, width: 4 }
+                        - population: true
+                no-townspots:
+                    filter: { kind_detail: [city,town] }
 
-            populated-places-osm-z11-no-population:
-                filter:
-                    all:
-                        - source: [openstreetmap, openstreetmap.org]
-                        - name: true
-                        - population: false
-                        - not: { kind: [country, county, state, island, neighbourhood, suburb, quarter] }
-                        - $zoom: [11]
-                        - kind: [city,town]
-                draw:
-                    text-blend-order:
-                        anchor: center
-                        visible: global.text_visible_populated_places
-                        priority: 8
-                        font:
-                            size: 11px
-                            #fill: global.text_fill
-#                            stroke: { color: global.text_stroke, width: 4 }
+                    z11places-1:
+                        filter:
+                            any:
+                                - { population: { min: 1000000 } }
+                        draw:
+                            text-blend-order:
+                                anchor: center
+                                visible: global.text_visible_populated_places
+                                priority: 5
+                                font:
+                                    size: 18px
+    #                                fill: global.text_fill
+    #                                stroke: { color: global.text_stroke, width: 4 }
 
-            populated-places-natural-earth-z11-backfill:
-                filter: { name: true, source: naturalearthdata.com, $zoom: [11], population: { max: 5000 } }
-                draw:
-                    text-blend-order:
-                        anchor: center
-                        font:
-                            fill: global.text_fill
-                z11places-1-ne:
-                    filter: { scalerank: [0,1] }
-                    draw:
-                        text-blend-order:
-                            visible: global.text_visible_populated_places
-                            priority: 10
-                            font:
-                                size: 16px
-                                #stroke: { color: global.text_stroke, width: 4 }
-                    capital:
-                        filter: { capital: yes }
+                    z11places-2:
+                        filter:
+                            any:
+                                - { population: { min: 50000, max: 999999 } }
                         draw:
                             text-blend-order:
-                                priority: 9
+                                anchor: center
+                                visible: global.text_visible_populated_places
+                                priority: 6
                                 font:
-                                    size: 16px
-                                    #stroke: { color: global.text_stroke, width: 4 }
+                                    size: 14px
+    #                                fill: global.text_fill
+    #                                stroke: { color: global.text_stroke, width: 4 }
 
-                z11places-2-ne:
-                    filter: { scalerank: [2,3,4,5] }
+                    z11places-3:
+                        filter:
+                            any:
+                            - { population: { min: 5000, max: 49999 } }
+                        draw:
+                            text-blend-order:
+                                anchor: center
+                                visible: global.text_visible_populated_places
+                                priority: 7
+                                font:
+                                    size: 12px
+    #                                fill: global.text_fill
+    #                                stroke: { color: global.text_stroke, width: 4 }
+
+                some-townspots:
+                    filter: { not: { kind_detail: [city,town] } }
+
+                    z11places-1:
+                        filter:
+                            any:
+                                - { population: { min: 1000000 } }
+                        draw:
+                            text-blend-order:
+                                anchor: center
+                                visible: global.text_visible_populated_places
+                                # TODO: Why is this here?
+                                priority: 5
+                                font:
+                                    size: 17px
+
+                    z11places-2a:
+                        filter:
+                            any:
+                                - { population: { min: 350000, max: 1000000 } }
+                        draw:
+                            text-blend-order:
+                                anchor: center
+                                visible: global.text_visible_populated_places
+                                # TODO: Why is this here?
+                                priority: 6
+                                font:
+                                    size: 13px
+    #                                fill: global.text_fill
+    #                                stroke: { color: global.text_stroke, width: 4 }
+
+                    z11places-2b:
+                        filter:
+                            any:
+                                - { population: { min: 150000, max: 350000 } }
+                        draw:
+                            text-blend-order:
+                                anchor: center
+                                priority: 7
+                                visible: global.text_visible_populated_places
+                                font:
+                                    size: 13px
+
+                    z11places-3:
+                        filter:
+                            any:
+                                - { population: { min: 50000, max: 149999 } }
+                        draw:
+                            text-blend-order:
+                                anchor: center
+                                size: 6px
+                                priority: 11
+                                visible: global.text_visible_populated_places
+                                font:
+                                    fill: [0.25,0.25,0.25]
+                                    size: 11px
+
+                    z11places-4:
+                        filter:
+                            any:
+                                - { population: { min: 20000, max: 49999 } }
+                        draw:
+                            text-blend-order:
+                                anchor: center
+                                size: 5px
+                                priority: 13
+                                visible: global.text_visible_populated_places
+                                font:
+                                    fill: [0.35,0.35,0.35]
+                                    size: 9px
+
+                    z11places-6:
+                        filter:
+                            any:
+                                - { population: { max: 20000 } }
+                        draw:
+                            text-blend-order:
+                                anchor: center
+                                size: 5px
+                                priority: 14
+                                visible: global.text_visible_populated_places
+                                font:
+                                    fill: [0.35,0.35,0.35]
+                                    size: 8px
+
+            populated-places-osm-z11-no-population:
+                filter:
+                    all:
+                        - source: openstreetmap.org
+                        - $zoom: [11]
+                        - population: false
+                draw:
+                    text-blend-order:
+                        anchor: center
+                        visible: global.text_visible_populated_places
+                        priority: 8
+                        font:
+                            size: 11px
+                            #fill: global.text_fill
+#                            stroke: { color: global.text_stroke, width: 4 }
+                village:
+                    filter: { kind_detail: [village] }
+                    draw:
+                        text-blend-order:
+                            font:
+                                #fill: green
+                                size: 9px
+
+            populated-places-natural-earth-z11-backfill:
+                filter: { source: naturalearthdata.com, $zoom: [11], population: { max: 5000 } }
+                draw:
+                    text-blend-order:
+                        anchor: center
+                        font:
+                            fill: global.text_fill
+                z11places-1-ne:
+                    filter: { min_zoom: [2,3] }
+                    draw:
+                        text-blend-order:
+                            visible: global.text_visible_populated_places
+                            priority: 10
+                            font:
+                                size: 16px
+                                #stroke: { color: global.text_stroke, width: 4 }
+                    capital:
+                        filter: { country_capital: true }
+                        draw:
+                            text-blend-order:
+                                priority: 9
+                                font:
+                                    size: 16px
+                                    #stroke: { color: global.text_stroke, width: 4 }
+
+                z11places-2-ne:
+                    filter: { min_zoom: [4,5,6] }
                     draw:
                         text-blend-order:
                             visible: global.text_visible_populated_places
@@ -4098,15 +4255,15 @@ layers:
                                 size: 13px
                                 #stroke: { color: global.text_stroke, width: 4 }
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             text-blend-order:
                                 priority: 11
                                 font:
                                     size: 16px
                                     #stroke: { color: global.text_stroke, width: 4 }
-                    state_capital:
-                        filter: { state_capital: yes }
+                    region_capital:
+                        filter: { region_capital: true }
                         draw:
                             text-blend-order:
                                 priority: 12
@@ -4115,7 +4272,7 @@ layers:
                                     #stroke: { color: global.text_stroke, width: 4 }
 
                 z11places-3-ne:
-                    filter: { scalerank: [6,7,8,9,10,11] }
+                    filter: { min_zoom: [6,7,8,9,10] }
                     draw:
                         text-blend-order:
                             visible: global.text_visible_populated_places
@@ -4124,7 +4281,7 @@ layers:
                                 size: 11px
                                 #stroke: { color: global.text_stroke, width: 4 }
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             text-blend-order:
                                 priority: 14
@@ -4132,81 +4289,199 @@ layers:
                                     size: 14px
                                     #stroke: { color: global.text_stroke, width: 4 }
 
+#            populated-places-osm-z12-debug:
+#                filter:
+#                    all:
+#                        - source: openstreetmap.org
+#                        - population: true
+#                        - kind_detail: [hamlet]
+#                        - $zoom: [12]
+#                draw:
+#                    icons:
+#                        size: 6px
+#                        sprite: townspot-m-rev
+#                        priority: 7
+#                        text:
+#                            visible: global.text_visible_populated_places
+#                            font:
+#                                size: 10px
+#                                fill: red
+#                village:
+#                    filter: { kind_detail: [village] }
+#                    draw:
+#                        icons:
+#                            text:
+#                                font:
+#                                    fill: green
+
             populated-places-osm-z12:
                 filter:
                     all:
-                        - source: [openstreetmap, openstreetmap.org]
-                        - name: true
-                        - population: true
-                        - not: { kind: [country, county, state, island, neighbourhood, suburb, quarter] }
                         - $zoom: [12]
-                        - kind: [city,town]
-                draw:
-                    text-blend-order:
-                        anchor: center
-
-                z12places-1:
-                    filter:
-                        any:
-                            - { population: { min: 1000000 } }
+                        - source: openstreetmap.org
+                        - population: true
+                no-townspots:
+                    filter: { kind_detail: [city,town] }
 
                     draw:
                         text-blend-order:
-                            visible: global.text_visible_populated_places
-                            priority: 5
-                            font:
-                                size: 18px
-                                #fill: global.text_fill
-#                                stroke: { color: global.text_stroke, width: 4 }
+                            anchor: center
 
-                z12places-2:
-                    filter:
-                        any:
-                            - { population: { min: 50000, max: 999999 } }
-                    draw:
-                        text-blend-order:
-                            visible: global.text_visible_populated_places
-                            priority: 6
-                            font:
-                                size: 14px
-                                #fill: global.text_fill
-#                                stroke: { color: global.text_stroke, width: 4 }
+                    z12places-1:
+                        filter:
+                            any:
+                                - { population: { min: 1000000 } }
 
-                z12places-3:
-                    filter:
-                        any:
-                        - { population: { min: 5000, max: 49999 } }
-                    draw:
-                        text-blend-order:
-                            visible: global.text_visible_populated_places
-                            priority: 7
-                            font:
-                                size: 11px
-                                #fill: global.text_fill
-#                                stroke: { color: global.text_stroke, width: 4 }
+                        draw:
+                            text-blend-order:
+                                visible: global.text_visible_populated_places
+                                priority: 5
+                                font:
+                                    size: 18px
+                                    #fill: global.text_fill
+   #                                 stroke: { color: global.text_stroke, width: 4 }
 
-                z12places-4:
-                    filter:
-                        any:
-                        - { population: { max: 5000 } }
-                    draw:
-                        text-blend-order:
-                            visible: global.text_visible_populated_places
-                            priority: 8
-                            font:
-                                size: 10px
-                                #fill: global.text_fill
-#                                stroke: { color: global.text_stroke, width: 4 }
+                    z12places-2:
+                        filter:
+                            any:
+                                - { population: { min: 50000, max: 999999 } }
+                        draw:
+                            text-blend-order:
+                                visible: global.text_visible_populated_places
+                                priority: 6
+                                font:
+                                    size: 14px
+                                    #fill: global.text_fill
+   #                                 stroke: { color: global.text_stroke, width: 4 }
+
+                    z12places-3:
+                        filter:
+                            any:
+                            - { population: { min: 5000, max: 49999 } }
+                        draw:
+                            text-blend-order:
+                                visible: global.text_visible_populated_places
+                                priority: 7
+                                font:
+                                    size: 11px
+                                    #fill: global.text_fill
+   #                                 stroke: { color: global.text_stroke, width: 4 }
+
+                    z12places-4:
+                        filter:
+                            any:
+                            - { population: { max: 5000 } }
+                        draw:
+                            text-blend-order:
+                                visible: global.text_visible_populated_places
+                                priority: 8
+                                font:
+                                    size: 10px
+                                    #fill: global.text_fill
+   #                                 stroke: { color: global.text_stroke, width: 4 }
+
+                some-townspots:
+                    filter: { not: { kind_detail: [city,town] } }
+
+                    z12places-1:
+                        filter:
+                            any:
+                                - { population: { min: 1000000 } }
+                        draw:
+                            text-blend-order:
+                                anchor: center
+                                visible: global.text_visible_populated_places
+                                # TODO: Why is this here?
+                                priority: 5
+                                font:
+                                    size: 17px
+
+                    z12places-2a:
+                        filter:
+                            any:
+                                - { population: { min: 350000, max: 1000000 } }
+                        draw:
+                            text-blend-order:
+                                anchor: center
+                                visible: global.text_visible_populated_places
+                                # TODO: Why is this here?
+                                priority: 6
+                                font:
+                                    size: 13px
+    #                                 fill: global.text_fill
+    #                                 stroke: { color: global.text_stroke, width: 4 }
+
+                    z12places-2b:
+                        filter:
+                            any:
+                                - { population: { min: 150000, max: 350000 } }
+                        draw:
+                            text-blend-order:
+                                anchor: center
+                                size: 6px
+                                priority: 7
+                                visible: global.text_visible_populated_places
+                                font:
+                                    size: 13px
+
+                    z12places-3:
+                        filter:
+                            any:
+                                - { population: { min: 50000, max: 149999 } }
+                        draw:
+                            text-blend-order:
+                                anchor: center
+                                size: 6px
+                                priority: 11
+                                visible: global.text_visible_populated_places
+                                font:
+                                    fill: [0.25,0.25,0.25]
+                                    size: 12px
+
+                    z12places-4:
+                        filter:
+                            any:
+                                - { population: { min: 20000, max: 49999 } }
+                        draw:
+                            text-blend-order:
+                                anchor: center
+                                size: 5px
+                                priority: 13
+                                visible: global.text_visible_populated_places
+                                font:
+                                    fill: [0.35,0.35,0.35]
+                                    size: 11px
+
+                    z12places-6:
+                        filter:
+                            any:
+                                - { population: { max: 20000 } }
+                        draw:
+                            text-blend-order:
+                                anchor: center
+                                size: 5px
+                                priority: 14
+                                visible: global.text_visible_populated_places
+                                font:
+                                    fill: [0.35,0.35,0.35]
+                                    size: 10px
+
+                    hamlet:
+                        filter: { kind_detail: [hamlet] }
+                        draw:
+                            text-blend-order:
+                                #visible: false
+                                font:
+                                    #fill: magenta
+                                    size: 9px
 
             populated-places-osm-z12-no-population:
                 filter:
                     all:
-                        - source: [openstreetmap, openstreetmap.org]
-                        - name: true
-                        - population: false
-                        - not: { kind: [country, county, state, island, neighbourhood, suburb, quarter] }
                         - $zoom: [12]
-                        - kind: [city,town]
+                        - source: openstreetmap.org
+                        - population: false
+                        #- kind_detail: [city,town,village,hamlet]
                 draw:
                     text-blend-order:
                         anchor: center
@@ -4214,11 +4489,27 @@ layers:
                         priority: 9
                         font:
                             size: 11px
+                            #fill: cyan
                             #fill: global.text_fill
-#                            stroke: { color: global.text_stroke, width: 4 }
+                            #stroke: { color: global.text_stroke, width: 4 }
+                hamlet:
+                    filter: { kind_detail: [hamlet] }
+                    draw:
+                        text-blend-order:
+                            visible: false
+                            font:
+                                #fill: magenta
+                                size: 9px
+                village:
+                    filter: { kind_detail: [village] }
+                    draw:
+                        text-blend-order:
+                            font:
+                                #fill: green
+                                size: 9px
 
             populated-places-natural-earth-z12-backfill:
-                filter: { name: true, source: naturalearthdata.com, $zoom: [12], population: { max: 5000 } }
+                filter: { source: naturalearthdata.com, $zoom: [12], population: { max: 5000 } }
                 draw:
                     text-blend-order:
                         anchor: center
@@ -4236,7 +4527,7 @@ layers:
                                 size: 16px
                                 #stroke: { color: global.text_stroke, width: 4 }
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             text-blend-order:
                                 priority: 11
@@ -4254,7 +4545,7 @@ layers:
                                 size: 13px
                                 #stroke: { color: global.text_stroke, width: 4 }
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             text-blend-order:
                                 priority: 13
@@ -4272,7 +4563,7 @@ layers:
                                 size: 11px
                                 #stroke: { color: global.text_stroke, width: 4 }
                     capital:
-                        filter: { capital: yes }
+                        filter: { country_capital: true }
                         draw:
                             text-blend-order:
                                 priority: 15
@@ -4283,12 +4574,9 @@ layers:
             populated-places-osm-z13-z14:
                 filter:
                     all:
-                        - source: [openstreetmap, openstreetmap.org]
-                        - name: true
+                        - source: openstreetmap.org
                         - population: true
-                        - not: { kind: [country, county, state, island, neighbourhood, suburb, quarter] }
                         - $zoom: [13,14]
-                        - kind: [city,town]
                 draw:
                     text-blend-order:
                         anchor: center
@@ -4338,11 +4626,7 @@ layers:
 
                 z13places-4:
                     filter:
-                        any:
-                            - population: false
-                            - population: true
-                              all:
-                                - population: { max: 5000 }
+                        - population: { max: 5000 }
                     draw:
                         text-blend-order:
                             font:
@@ -4352,12 +4636,10 @@ layers:
             populated-places-osm-z13-z14-no-population:
                 filter:
                     all:
-                        - source: [openstreetmap, openstreetmap.org]
-                        - name: true
+                        - source: openstreetmap.org
                         - population: false
-                        - not: { kind: [country, county, state, island, neighbourhood, suburb, quarter] }
                         - $zoom: [13, 14]
-                        - kind: [city,town]
+                        #- kind_detail: [city,town]
                 draw:
                     text-blend-order:
                         anchor: center
@@ -4365,10 +4647,53 @@ layers:
                         priority: 7
                         font:
                             size: 11px
+                            #fill: orange
                             #stroke: { color: global.text_stroke, width: 4 }
 
+#                city_town:
+#                    filter:
+#                        all:
+#                            - kind_detail: [city,town]
+#                    draw:
+#                        text-blend-order:
+#                            font:
+#                                fill: yellow
+#
+#                hamlet:
+#                    filter: { kind_detail: [hamlet] }
+#                    draw:
+#                        icons:
+#                            text:
+#                                font:
+#                                    fill: brown
+#
+#                village:
+#                    filter: { kind_detail: [village] }
+#                    draw:
+#                        icons:
+#                            text:
+#                                font:
+#                                    fill: green
+#
+#                locality:
+#                    filter: { kind_detail: [locality] }
+#                    draw:
+#                        icons:
+#                            text:
+#                                font:
+#                                    fill: purple
+#
+#                isolated_dwelling_farm:
+#                    filter: { kind_detail: [isolated_dwelling,farm] }
+#                    draw:
+#                        icons:
+#                            text:
+#                                font:
+#                                    fill: pink
+
+
             populated-places-natural-earth-z13-z14-backfill:
-                filter: { name: true, source: naturalearthdata.com, $zoom: [13,14], population: { max: 5000 } }
+                filter: { source: naturalearthdata.com, $zoom: [13,14], population: { max: 5000 } }
                 draw:
                     text-blend-order:
                         anchor: center
@@ -4377,7 +4702,7 @@ layers:
                             weight: 400
 
                 z13places-1-ne:
-                    filter: { scalerank: [0,1] }
+                    filter: { min_zoom: [2,3] }
                     draw:
                         text-blend-order:
                             priority: 8
@@ -4385,7 +4710,7 @@ layers:
                             visible: false
 
                 z13places-2-ne:
-                    filter: { scalerank: [2,3,4,5] }
+                    filter: { min_zoom: [4,5,6] }
                     draw:
                         text-blend-order:
                             priority: 9
@@ -4395,7 +4720,7 @@ layers:
                                 #stroke: { color: global.text_stroke, width: 4 }
 
                 z13places-3-ne:
-                    filter: { scalerank: [6,7,8,9,10,11,12] }
+                    filter: { min_zoom: [7,8,9,10] }
                     draw:
                         text-blend-order:
                             visible: global.text_visible_populated_places
@@ -4404,15 +4729,13 @@ layers:
                                 size: 12px
                                 #stroke: { color: global.text_stroke, width: 4 }
 
+        neighborhoods:
+            filter: { kind: [macrohood, neighbourhood, borough] }
+
             neighborhood-z11:
                 filter:
                     all:
-                        - name: true
-                        - kind: [macrohood, neighbourhood]
                         - $zoom: [11]
-                    any:
-                        - source: [openstreetmap, openstreetmap.org]
-                        - source: [whosonfirst, whosonfirst.mapzen.com]
                           all:
                             - min_zoom: [11]
                             - max_zoom: { min: 12 }
@@ -4432,12 +4755,7 @@ layers:
             neighborhood-z12:
                 filter:
                     all:
-                        - name: true
-                        - kind: [macrohood, neighbourhood]
                         - $zoom: [12]
-                    any:
-                        - source: [openstreetmap, openstreetmap.org]
-                        - source: [whosonfirst, whosonfirst.mapzen.com]
                           all:
                             - min_zoom: [11,12]
                             - max_zoom: { min: 13 }
@@ -4457,12 +4775,7 @@ layers:
             neighborhood-z13:
                 filter:
                     all:
-                        - name: true
-                        - kind: [macrohood, neighbourhood]
                         - $zoom: [13]
-                    any:
-                        - source: [openstreetmap, openstreetmap.org]
-                        - source: [whosonfirst, whosonfirst.mapzen.com]
                           all:
                             - min_zoom: [11,12,13]
                             - max_zoom: { min: 14 }
@@ -4482,12 +4795,7 @@ layers:
             neighborhood-z14:
                 filter:
                     all:
-                        - name: true
-                        - kind: [macrohood, neighbourhood]
                         - $zoom: [14]
-                    any:
-                        - source: [openstreetmap, openstreetmap.org]
-                        - source: [whosonfirst, whosonfirst.mapzen.com]
                           all:
                             - min_zoom: [11,12,13,14]
                             - max_zoom: { min: 15 }
@@ -4507,12 +4815,7 @@ layers:
             neighborhood-z15:
                 filter:
                     all:
-                        - name: true
-                        - kind: [macrohood, neighbourhood]
                         - $zoom: [15]
-                    any:
-                        - source: [openstreetmap, openstreetmap.org]
-                        - source: [whosonfirst, whosonfirst.mapzen.com]
                           all:
                             - min_zoom: [11,12,13,14,15]
                             - max_zoom: { min: 16 }
@@ -4541,12 +4844,7 @@ layers:
             neighborhood-z16:
                 filter:
                     all:
-                        - name: true
-                        - kind: [macrohood, neighbourhood]
                         - $zoom: [16]
-                    any:
-                        - source: [openstreetmap, openstreetmap.org]
-                        - source: [whosonfirst, whosonfirst.mapzen.com]
                           all:
                             - min_zoom: [11,12,13,14,15,16]
                             - max_zoom: { min: 17 }
@@ -4563,8 +4861,26 @@ layers:
                             transform: uppercase
                             # stroke: { color: global.text_stroke, width: 3 }
 
+#    landuse_labels_debug:
+#        data: { source: mapzen, layer: [landuse] }
+#        #filter: { label_placement: true }
+#        draw:
+#            icons:
+#                size: [[13, 12px], [16, 16px], [18, 19px]]
+#                interactive: true
+#                repeat_group: abc
+#                text:
+#                    interactive: true
+#                    priority: 99
+#                    font:
+#                        family: global.text_font_family
+#                        weight: 800
+#                        fill: red #[0.20,0.20,0.20]
+#                        size: 12px
+#                        style: italic
+
     pois_and_landuse_labels:
-        data: { source: mapzen, layer: [pois,landuse] }
+        data: { source: mapzen, layer: [pois] }
         visible: global.label_visible_poi_landuse
         filter:
             all:
@@ -4585,7 +4901,7 @@ layers:
                 size: [[13, 12px], [16, 16px], [18, 19px]]
                 interactive: true
                 visible: false
-                priority: 65
+                priority: 65  #function() { return (feature.min_zoom && Math.floor(feature.min_zoom * 1000)) || 65; }
                 repeat_group: abc
                 text:
                     text_source: global.ux_language_text_source
@@ -4630,23 +4946,23 @@ layers:
                 filter: { kind: [grass, pitch], $geometry: point, area: true, $zoom: { min: 17 } }
                 draw:
                     icons:
-                        sprite: function() { return feature.sport; }
+                        sprite: function() { return feature.kind_detail; }
                         visible: global.icon_visible_poi_landuse_e
                         priority: 69
                 baseball:
-                    filter: { sport: baseball }
+                    filter: { kind_detail: baseball }
                     draw: { icons: { sprite: baseball-field } }
                 basketball:
-                    filter: { sport: basketball }
+                    filter: { kind_detail: basketball }
                     draw: { icons: { sprite: basketball-court } }
                 football:
-                    filter: { sport: football }
+                    filter: { kind_detail: football }
                     draw: { icons: { sprite: football-stadium } }
                 hockey:
-                    filter: { sport: hockey-field }
+                    filter: { kind_detail: hockey-field }
                     draw: { icons: { sprite: hockey-field } }
                 soccer:
-                    filter: { sport: soccer }
+                    filter: { kind_detail: soccer }
                     draw: { icons: { sprite: soccer-field } }
                 tennis:
                     filter: { sport: tennis }
@@ -4711,23 +5027,23 @@ layers:
                     all:
                         - area: true
                         - $geometry: point
-                        - kind: [national_park, "park or protected land"]
-                    any:
-                        # show labels for smaller landuse areas at higher zooms
-                        - { $zoom: [4],  area: { min: 3000000000 } }
-                        - { $zoom: [5],  area: { min: 3000000000 } }
-                        - { $zoom: [6],  area: { min: 500000000 } }
-                        - { $zoom: [7,8,9],  area: { min: 100000000 } }
-                        - { $zoom: [10], area: { min: 50000000 } }
-                        - { $zoom: [11], area: { min: 25000000 } }
-                        - { $zoom: [12], area: { min: 5000000 } }
-                        - { $zoom: [13], area: { min: 200000 } }
-                        - { $zoom: [14], area: { min: 50000 } }
-                        - { $zoom: { min: 15 } }
+                        - kind: [national_park, battlefield, protected_area]
+                    #any:
+#                        # show labels for smaller landuse areas at higher zooms
+#                        - { $zoom: [4],  area: { min: 3000000000 } }
+#                        - { $zoom: [5],  area: { min: 3000000000 } }
+#                        - { $zoom: [6],  area: { min: 500000000 } }
+#                        - { $zoom: [7,8,9],  area: { min: 100000000 } }
+#                        - { $zoom: [10], area: { min: 50000000 } }
+#                        - { $zoom: [11], area: { min: 25000000 } }
+#                        - { $zoom: [12], area: { min: 5000000 } }
+#                        - { $zoom: [13], area: { min: 200000 } }
+#                        - { $zoom: [14], area: { min: 50000 } }
+#                        - { $zoom: { min: 15 } }
                 national-park:
                     # yosemite national park, joshua tree national park
-                    filter: function() { return feature.name && ((feature.name.indexOf("National Park") > -1) || feature.name.indexOf("National Monument") > -1); }
-                    visible: global.label_visible_landuse_green
+                    filter: function() { return feature.name && ((feature.name.indexOf("National Park") > -1) || feature.name.indexOf("National Monument") > -1 || feature.protect_class == '2' || feature.protect_class == '3' || feature.protect_class == '5'); }
+#                    visible: global.label_visible_landuse_green
                     draw:
                         icons:
                             visible: global.icon_visible_landuse_green
@@ -4741,10 +5057,10 @@ layers:
                                     style: italic
                                     # stroke: { color: [0.870,0.870,0.870], width: 3px }
                     natl-park-labels-z4-z6:
-                        filter: { $zoom: [4,5,6] }
+                        filter: { $zoom: [4,5] }
                         draw:
                             icons:
-                                visible: false
+#                                visible: false
                                 text: { font: { size: 10px, stroke: { width: 2px } } }
                     natl-park-labels-z7:
                         filter: { $zoom: [7] }
@@ -4767,7 +5083,7 @@ layers:
                     all:
                         - area: true
                         - $geometry: point
-                        - kind: [park, national_park, "park or protected land", conservation, protected_area, nature_reserve, forest, grass]
+                        - kind: [park, conservation, protected_area, nature_reserve, forest, grass]
                     any:
                         # show labels for smaller landuse areas at higher zooms
                         - { $zoom: [5],    area: { min: 10000000000 } }
@@ -4803,13 +5119,13 @@ layers:
                         filter: { $zoom: [6] }
                         draw:
                             icons:
-                                visible: false
+                                #visible: false
                                 text: { font: { size: 10px, stroke: { width: 2px } } }
                     green-areas-z7:
                         filter: { $zoom: [7] }
                         draw:
                             icons:
-                                visible: false
+                                #visible: false
                                 text: { font: { size: 10px } }
                     green-areas-z8-z9:
                         filter: { $zoom: { min: 8, max: 14 } }
@@ -4817,7 +5133,7 @@ layers:
                             icons:
                                 text: { font: { size: 11px } }
                     wilderness-areas-early:
-                        filter: function() { return $zoom < 10 && feature.name && (feature.name.indexOf("Wilderness") > -1 || feature.name.indexOf("BLM") > -1) }
+                        filter: function() { return $zoom < 9 && feature.name && (feature.name.indexOf("Wilderness") > -1 || feature.name.indexOf("BLM") > -1 || feature.protect_class == '1' || feature.protect_class == '1a' || feature.protect_class == '1b' ); }
                         draw:
                             icons:
                                 visible: false
@@ -4863,18 +5179,18 @@ layers:
                         - area: true
                         - $geometry: point
                         - kind: [battlefield]
-                    any:
-                        # show labels for smaller landuse areas at higher zooms
-                        - { $zoom: [4],  area: { min: 3000000000 } }
-                        - { $zoom: [5],  area: { min: 3000000000 } }
-                        - { $zoom: [6],  area: { min: 500000000 } }
-                        - { $zoom: [7,8,9],  area: { min: 10000000 } }
-                        - { $zoom: [10], area: { min: 5000000 } }
-                        - { $zoom: [11], area: { min: 5000000 } }
-                        - { $zoom: [12], area: { min: 5000000 } }
-                        - { $zoom: [13], area: { min: 200000 } }
-                        - { $zoom: [14], area: { min: 50000 } }
-                        - { $zoom: { min: 15 }, area: true }
+#                    any:
+#                        # show labels for smaller landuse areas at higher zooms
+#                        - { $zoom: [4],  area: { min: 3000000000 } }
+#                        - { $zoom: [5],  area: { min: 3000000000 } }
+#                        - { $zoom: [6],  area: { min: 500000000 } }
+#                        - { $zoom: [7,8,9],  area: { min: 10000000 } }
+#                        - { $zoom: [10], area: { min: 5000000 } }
+#                        - { $zoom: [11], area: { min: 5000000 } }
+#                        - { $zoom: [12], area: { min: 5000000 } }
+#                        - { $zoom: [13], area: { min: 200000 } }
+#                        - { $zoom: [14], area: { min: 50000 } }
+#                        - { $zoom: { min: 15 }, area: true }
                 draw:
                     icons:
                         visible: global.icon_visible_landuse_green
@@ -4894,16 +5210,16 @@ layers:
                         - area: true
                         - $geometry: point
                         - kind: [beach]
-                    any:
-                        # show labels for smaller landuse areas at higher zooms
-                        - { $zoom: [10],   area: { min: 300000 } }
-                        - { $zoom: [11],   area: { min: 100000 } }
-                        - { $zoom: [12],   area: { min: 50000 } }
-                        - { $zoom: [13],   area: { min: 50000 } }
-                        - { $zoom: [14],   area: { min: 20000 } }
-                        - { $zoom: [15],   area: { min: 10000 } }
-                        - { $zoom: [16],   area: { min: 1000 } }
-                        - { $zoom: { min: 17 } }
+#                    any:
+#                        # show labels for smaller landuse areas at higher zooms
+#                        - { $zoom: [10],   area: { min: 300000 } }
+#                        - { $zoom: [11],   area: { min: 100000 } }
+#                        - { $zoom: [12],   area: { min: 50000 } }
+#                        - { $zoom: [13],   area: { min: 50000 } }
+#                        - { $zoom: [14],   area: { min: 20000 } }
+#                        - { $zoom: [15],   area: { min: 10000 } }
+#                        - { $zoom: [16],   area: { min: 1000 } }
+#                        - { $zoom: { min: 17 } }
                 draw:
                     icons:
                         visible: global.icon_visible_landuse_green
@@ -4922,19 +5238,19 @@ layers:
                         - kind: [airport, aerodrome]
                         - area: true
                         - $geometry: point
-                    any:
-                        # show labels for smaller landuse areas at higher zooms
-                        - { $zoom: [9],  area: { min: 10000000 } }
-                        - { $zoom: [10], area: { min: 10000000 } }
-                        - { $zoom: [11], area: { min: 5000000 } }
-                        - { $zoom: [12], area: { min: 5000000 } }
-                        - { $zoom: [13], area: { min: 500000 } }
-                        - { $zoom: [14], area: { min: 20000 } }
-                        # show labels for smaller landuse areas at higher zooms
-                        - { $zoom: [15], area: { min: 10000 } }
-                        - { $zoom: [16], area: { min: 5000 } }
-                        - { $zoom: [17], area: { min: 2000 } }
-                        - { $zoom: { min: 18 } }
+#                    any:
+#                        # show labels for smaller landuse areas at higher zooms
+#                        - { $zoom: [9],  area: { min: 10000000 } }
+#                        - { $zoom: [10], area: { min: 10000000 } }
+#                        - { $zoom: [11], area: { min: 5000000 } }
+#                        - { $zoom: [12], area: { min: 5000000 } }
+#                        - { $zoom: [13], area: { min: 500000 } }
+#                        - { $zoom: [14], area: { min: 20000 } }
+#                        # show labels for smaller landuse areas at higher zooms
+#                        - { $zoom: [15], area: { min: 10000 } }
+#                        - { $zoom: [16], area: { min: 5000 } }
+#                        - { $zoom: [17], area: { min: 2000 } }
+#                        - { $zoom: { min: 18 } }
                 draw:
                     icons:
                         sprite: airport
@@ -4961,19 +5277,19 @@ layers:
                         - area: true
                         - $geometry: point
                         - not: { $layer: buildings }
-                    any:
-                        # show labels for smaller landuse areas at higher zooms
-                        - { $zoom: [9],   area: { min: 10000000 } }
-                        - { $zoom: [10], area: { min: 5000000 } }
-                        - { $zoom: [11], area: { min: 2000000 } }
-                        - { $zoom: [12], area: { min: 500000 } }
-                        - { $zoom: [13], area: { min: 100000 } }
-                        - { $zoom: [14], area: { min: 100000 } }
-                        # show labels for smaller landuse areas at higher zooms
-                        - { $zoom: [15], area: { min: 40000 } }
-                        - { $zoom: [16], area: { min: 5000 } }
-                        - { $zoom: [17], area: { min: 2000 } }
-                        - { $zoom: { min: 18 } }
+#                    any:
+#                        # show labels for smaller landuse areas at higher zooms
+#                        - { $zoom: [9],   area: { min: 10000000 } }
+#                        - { $zoom: [10], area: { min: 5000000 } }
+#                        - { $zoom: [11], area: { min: 2000000 } }
+#                        - { $zoom: [12], area: { min: 500000 } }
+#                        - { $zoom: [13], area: { min: 100000 } }
+#                        - { $zoom: [14], area: { min: 100000 } }
+#                        # show labels for smaller landuse areas at higher zooms
+#                        - { $zoom: [15], area: { min: 40000 } }
+#                        - { $zoom: [16], area: { min: 5000 } }
+#                        - { $zoom: [17], area: { min: 2000 } }
+#                        - { $zoom: { min: 18 } }
                 visible: global.label_visible_landuse_green
                 draw:
                     icons:
@@ -5029,18 +5345,18 @@ layers:
                         - kind: winter_sports
                         - area: true
                         - $geometry: point
-                    any:
-                        # show labels for smaller landuse areas at higher zooms
-                        - { $zoom: [10], area: { min: 5000000 } }
-                        - { $zoom: [11], area: { min: 2000000 } }
-                        - { $zoom: [12], area: { min: 500000 } }
-                        - { $zoom: [13], area: { min: 100000 } }
-                        - { $zoom: [14], area: { min: 100000 } }
-                        # show labels for smaller landuse areas at higher zooms
-                        - { $zoom: [15], area: { min: 40000 } }
-                        - { $zoom: [16], area: { min: 5000 } }
-                        - { $zoom: [17], area: { min: 2000 } }
-                        - { $zoom: { min: 18 } }
+#                    any:
+#                        # show labels for smaller landuse areas at higher zooms
+#                        - { $zoom: [10], area: { min: 5000000 } }
+#                        - { $zoom: [11], area: { min: 2000000 } }
+#                        - { $zoom: [12], area: { min: 500000 } }
+#                        - { $zoom: [13], area: { min: 100000 } }
+#                        - { $zoom: [14], area: { min: 100000 } }
+#                        # show labels for smaller landuse areas at higher zooms
+#                        - { $zoom: [15], area: { min: 40000 } }
+#                        - { $zoom: [16], area: { min: 5000 } }
+#                        - { $zoom: [17], area: { min: 2000 } }
+#                        - { $zoom: { min: 18 } }
                 draw:
                     icons:
                         sprite: ski-area
@@ -5061,15 +5377,15 @@ layers:
                         - kind: [zoo, theme_park, resort, aquarium, winery, maze, stadium, enclosure, animal]
                         - area: true
                         - $geometry: point
-                    any:
-                        # show labels for smaller landuse areas at higher zooms
-                        - { $zoom: { min: 11 }, area: { min: 400000 } }
-                        - { $zoom: { min: 12 }, area: { min: 200000 } }
-                        - { $zoom: { min: 13 }, area: { min: 50000 } }
-                        - { $zoom: { min: 14 }, area: { min: 20000 } }
-                        - { $zoom: { min: 15 }, area: { min: 10000 } }
-                        - { $zoom: { min: 15 }, area: { min: 2000 } }
-                        - { $zoom: { min: 16 }, area: true }
+#                    any:
+#                        # show labels for smaller landuse areas at higher zooms
+#                        - { $zoom: { min: 11 }, area: { min: 400000 } }
+#                        - { $zoom: { min: 12 }, area: { min: 200000 } }
+#                        - { $zoom: { min: 13 }, area: { min: 50000 } }
+#                        - { $zoom: { min: 14 }, area: { min: 20000 } }
+#                        - { $zoom: { min: 15 }, area: { min: 10000 } }
+#                        - { $zoom: { min: 15 }, area: { min: 2000 } }
+#                        - { $zoom: { min: 16 }, area: true }
                 draw:
                     icons:
                         sprite: function() { return feature.kind; }
@@ -5103,10 +5419,10 @@ layers:
                         - kind: [playground, allotments, attraction, landmark, supermarket]
                         - area: true
                         - $geometry: point
-                    any:
-                        - { $zoom: [15], area: { min: 600 } }
-                        - { $zoom: [16], area: { min: 300 } }
-                        - { $zoom: { min: 17 } }
+#                    any:
+#                        - { $zoom: [15], area: { min: 600 } }
+#                        - { $zoom: [16], area: { min: 300 } }
+#                        - { $zoom: { min: 17 } }
                 draw:
                     icons:
                         visible: global.icon_visible_landuse_green
@@ -5126,20 +5442,83 @@ layers:
                     draw:
                         icons:
                             sprite: landmark
+            rest-area:
+                filter:
+                    all:
+                        - kind: [rest_area, service_area, rest-area]
+                        - area: true
+                        - $geometry: point
+#                    any:
+#                        - { $zoom: [12], area: { min: 30000 } }
+#                        - { $zoom: [13], area: { min: 10000 } }
+#                        - { $zoom: [14], area: { min: 5000 } }
+#                        - { $zoom: [15], area: { min: 2000 } }
+#                        - { $zoom: [16], area: { min: 1000 } }
+#                        - { $zoom: { min: 17, area: true } }
+                draw:
+                    icons:
+                        visible: global.icon_visible_landuse_green
+                        priority: 41
+                        sprite: generic
+                        text:
+                            visible: global.text_visible_landuse_green
+                            font:
+                                stroke: { color: global.text_stroke, width: 4 }
+            windmill:
+                filter:
+                    all:
+                        - kind: [windmill]
+                        - area: true
+                        - $geometry: point
+#                    any:
+#                        - { $zoom: [14], area: { min: 500 } }
+#                        - { $zoom: [15], area: { min: 200 } }
+#                        - { $zoom: [16], area: { min: 100 } }
+#                        - { $zoom: { min: 17, area: true } }
+                draw:
+                    icons:
+                        visible: global.icon_visible_landuse_green
+                        priority: 41
+                        sprite: generic
+                        text:
+                            visible: global.text_visible_landuse_green
+                            font:
+                                stroke: { color: global.text_stroke, width: 4 }
+            campground:
+                filter:
+                    all:
+                        - kind: [campground, camp_site, caravan_site]
+                        - area: true
+                        - $geometry: point
+#                    any:
+#                        - { $zoom: [13], area: { min: 10000 } }
+#                        - { $zoom: [14], area: { min: 5000 } }
+#                        - { $zoom: [15], area: { min: 2000 } }
+#                        - { $zoom: [16], area: { min: 1000 } }
+#                        - { $zoom: { min: 17, area: true } }
+                draw:
+                    icons:
+                        visible: global.icon_visible_landuse_green
+                        priority: 41
+                        sprite: campground
+                        text:
+                            visible: global.text_visible_landuse_green
+                            font:
+                                stroke: { color: global.text_stroke, width: 4 }
             glacier:
                 filter:
                     all:
                         - kind: glacier
                         - area: true
                         - $geometry: point
-                    any:
-                        # show labels for smaller landuse areas at higher zooms
-                        - { $zoom: [10],    area: { min: 20000000 } }
-                        - { $zoom: [11],    area: { min: 5000000 } }
-                        - { $zoom: [12],    area: { min: 2000000 } }
-                        - { $zoom: [13],    area: { min: 500000 } }
-                        # show labels for smaller landuse areas at higher zooms
-                        - { $zoom: { min: 14 } }
+#                    any:
+#                        # show labels for smaller landuse areas at higher zooms
+#                        - { $zoom: [10],    area: { min: 20000000 } }
+#                        - { $zoom: [11],    area: { min: 5000000 } }
+#                        - { $zoom: [12],    area: { min: 2000000 } }
+#                        - { $zoom: [13],    area: { min: 500000 } }
+#                        # show labels for smaller landuse areas at higher zooms
+#                        - { $zoom: { min: 14 } }
                 draw:
                     icons:
                         visible: false
@@ -5197,21 +5576,21 @@ layers:
                         - $zoom: { min: 6 }
                         - area: true
                         - $geometry: point
-                        - not: { kind: [park, national_park, "park or protected land", battlefield, conservation, protected_area, nature_reserve, forest, grass, beach, airport, aerodrome, university, college, school, kindergarten, winter_sports, zoo, theme_park, resort, aquarium, winery, maze, stadium, playground, allotments, attraction, landmark, glacier, station] }
-                    any:
-                        # show labels for smaller landuse areas at higher zooms
-                        - { $zoom: [5,6,7], area: { min: 5000000000 } }
-                        - { $zoom: [8],     area: { min: 1600000000 } }
-                        - { $zoom: [9],     area: { min: 400000000 } }
-                        - { $zoom: [10],    area: { min: 100000000 } }
-                        - { $zoom: [11],    area: { min: 25000000 } }
-                        - { $zoom: [12],    area: { min: 5000000 } }
-                        - { $zoom: [13],    area: { min: 1000000 } }
-                        - { $zoom: [14],    area: { min: 100000 } }
-                        # show labels for smaller landuse areas at higher zooms
-                        - { $zoom: [15],    area: { min: 5000 } }
-                        - { $zoom: [16],    area: { min: 2000 } }
-                        - { $zoom: { min: 17 }, area: true }
+                        - not: { kind: [park, national_park, battlefield, conservation, protected_area, nature_reserve, forest, grass, beach, airport, aerodrome, university, college, school, kindergarten, winter_sports, zoo, theme_park, resort, aquarium, winery, maze, stadium, playground, allotments, attraction, landmark, glacier, station] }
+#                    any:
+#                        # show labels for smaller landuse areas at higher zooms
+#                        - { $zoom: [5,6,7], area: { min: 5000000000 } }
+#                        - { $zoom: [8],     area: { min: 1600000000 } }
+#                        - { $zoom: [9],     area: { min: 400000000 } }
+#                        - { $zoom: [10],    area: { min: 100000000 } }
+#                        - { $zoom: [11],    area: { min: 25000000 } }
+#                        - { $zoom: [12],    area: { min: 5000000 } }
+#                        - { $zoom: [13],    area: { min: 1000000 } }
+#                        - { $zoom: [14],    area: { min: 100000 } }
+#                        # show labels for smaller landuse areas at higher zooms
+#                        - { $zoom: [15],    area: { min: 5000 } }
+#                        - { $zoom: [16],    area: { min: 2000 } }
+#                        - { $zoom: { min: 17 }, area: true }
                 draw:
                     icons:
                         sprite: function() { return feature.kind; }
@@ -5246,7 +5625,7 @@ layers:
                             visible: false
                             text: { visible: false }
                 only-text-later:
-                    filter: { kind: [pedestrian,common,railway,ship,houseboat,common,grass,wetland,pitch], $zoom: { min: 17 } }
+                    filter: { kind: [pedestrian,common,railway,ship,houseboat,common,grass,wetland], $zoom: { min: 17 } }
                     draw:
                         icons:
                             visible: false
@@ -5257,6 +5636,39 @@ layers:
                         icons:
                             visible: false
                             text:  { visible: false }
+                hide-early:
+                   filter: { kind: [cafe, restaurant, nursing_home], $zoom: { max: 15 } }
+                   draw:
+                       icons:
+                           visible: false
+                garden-area-early:
+                   filter:
+                       all:
+                           - kind: [garden, allotments]
+                       any:
+                           # limit show smaller landuse areas to higher zooms
+                           - { $zoom: [12], area: { max: 500000 } }
+                           - { $zoom: [13], area: { max: 100000 } }
+                           - { $zoom: [14], area: { max: 10000 } }
+                           - { $zoom: [15], area: { max: 5000 } }
+                   draw:
+                       icons:
+                           visible: false
+#                z-other-tier6-early:
+#                    filter:
+#                        all:
+#                            - kind: [garden, allotments, parking, pedestrian, common, pitch, place_of_worship, playground, school, nursing_home]
+#                        any:
+#                            # limit show smaller landuse areas to higher zooms
+#                            - { $zoom: { max: 12 } }
+#                            - { $zoom: [12], area: { max: 500000 } }
+#                            - { $zoom: [13], area: { max: 10000 } }
+#                            - { $zoom: [14], area: { max: 4000 } }
+#                            - { $zoom: [15], area: { max: 2000 } }
+#                    draw:
+#                        icons:
+#                            visible: false
+
             university-poi:
                 filter: { kind: [university, college], area: false, $zoom: { max: 16 } }
                 draw:
@@ -5278,6 +5690,25 @@ layers:
                     icons:
                         visible: false
                         text:  { visible: false }
+            garden-no-area-early2:
+                filter: { kind: [garden, allotments], $zoom: { max: 16 }, area: false }
+                draw:
+                    icons:
+                        visible: false
+            garden-no-area-early:
+                filter: { kind: [garden, allotments], $zoom: [16], area: false }
+                draw:
+                    icons:
+                        priority: 45
+                        size: 14px
+                        text:  { font: { size: 10px, style: italic } }
+            garden-no-area-later:
+                filter: { kind: [garden, allotments], $zoom: { min: 17 }, area: false }
+                draw:
+                    icons:
+                        priority: 45
+                        size: 16px
+                        text:  { font: { size: 11px, style: italic } }
             post-office-early:
                 filter: { kind: [post_office], $zoom: { max: 14 } }
                 draw:
@@ -5296,6 +5727,9 @@ layers:
                     icons:
                         visible: false
                         text:  { visible: false }
+            gate:
+                filter: { kind: gate, name: true  }
+                draw: { icons: { sprite: generic } }
             yes-early:
                 filter: { kind: [yes], $zoom: { max: 18 } }
                 draw:
@@ -5373,7 +5807,7 @@ layers:
                             text:
                                 visible: false
             tower:
-                filter: { kind: [tower], label_placement: yes }
+                filter: { kind: [tower], label_placement: true }
                 draw:
                     icons:
                         visible: false
@@ -5747,6 +6181,29 @@ layers:
                 pet-store:
                     filter: { kind: [pet, pet-store, pet-service, pet_store] }
                     draw:   { icons: { sprite: pet-store } }
+                sports-pitch:
+                    filter: { kind: [grass, pitch] }
+                    draw:
+                        icons:
+                            sprite: function() { return feature.kind_detail; }
+                    baseball:
+                        filter: { kind_detail: baseball }
+                        draw: { icons: { sprite: baseball-field } }
+                    basketball:
+                        filter: { kind_detail: basketball }
+                        draw: { icons: { sprite: basketball-court } }
+                    football:
+                        filter: { kind_detail: football }
+                        draw: { icons: { sprite: football-stadium } }
+                    hockey:
+                        filter: { kind_detail: hockey-field }
+                        draw: { icons: { sprite: hockey-field } }
+                    soccer:
+                        filter: { kind_detail: soccer }
+                        draw: { icons: { sprite: soccer-field } }
+                    tennis:
+                        filter: { kind_detail: tennis }
+                        draw: { icons: { sprite: tennis } }
                 pharmacy:
                     filter: { kind: [pharmacy, chemist] }
                     draw:   { icons: { sprite: pharmacy } }
@@ -6152,344 +6609,423 @@ layers:
     landuse:
         data: { source: mapzen }
         draw:
-            dots2:
-                order: global.feature_order
-                visible: false
-            dots-rev:
-                order: global.feature_order
-                visible: false
-            polygons:
-                order: global.feature_order
-        tier1:
-            filter:
-                any:
-                    # limit show smaller landuse areas to higher zooms
-                    - { $zoom: { min: 3 },  area: { min: 300000000 } }
-                    - { $zoom: { min: 4 },  area: { min: 300000000 } }
-                    - { $zoom: { min: 5 },  area: { min: 150000000 } }
-                    - { $zoom: { min: 6 },  area: { min: 150000000 } }
-                    - { $zoom: { min: 7 },  area: { min: 100000000 } }
-                    - { $zoom: { min: 8 },  area: { min: 10000000 } }
-                    - { $zoom: { min: 9 },  area: { min: 5000000 } }
-                    - { $zoom: { min: 10 }, area: { min: 1000000 } }
-                    - { $zoom: { min: 11 }, area: { min: 500000 } }
-                    - { $zoom: { min: 12 }, area: { min: 500000 } }
-                    - { $zoom: { min: 13 }, area: { min: 100000 } }
-                    - { $zoom: { min: 14 }, area: { min: 50000 } }
-                    - { $zoom: { min: 15 }, area: { min: 20000 } }
-                    - { $zoom: { min: 15 }, area: { min: 2000 } }
-                    - { $zoom: { min: 16 }, area: true }
-            national_park:
-                filter: { kind: [national_park, "park or protected land", battlefield], not: { operator: [ "United States Forest Service", "US Forest Service", "U.S. Forest Service", "USDA Forest Service" ] } }
-                draw:
-                    dots2:
-                        color: [[4,[0.655,0.800,0.796]],[8,[0.588,0.780,0.773]]]
-                        # todo: what is this?
-                        order: 18
-                        visible: true
-                us_national_park:
-                    # yosemite national park, death valley national park, grand canyon national park
-                    filter: { operator: [ "United States National Park Service", "US National Park Service" ] }
-                    draw:
-                        dots2:
-                            color: [[4,[0.525,0.765,0.686]],[9,[0.416,0.737,0.631]]]
-                            order: 19
-                            visible: true
-                            # color: [[4,[0.242,0.737,0.712]],[12,[0.224,0.682,0.659]]]
-        tier2:
-            filter:
-                any:
-                    # limit show smaller landuse areas to higher zooms
-                    - { $zoom: { min: 4 },  area: { min: 1000000000 } }
-                    - { $zoom: { min: 5 },  area: { min: 1000000000 } }
-                    - { $zoom: { min: 6 },  area: { min: 150000000 } }
-                    - { $zoom: { min: 7 },  area: { min: 100000000 } }
-                    - { $zoom: { min: 8 },  area: { min: 10000000 } }
-                    - { $zoom: { min: 9 },  area: { min: 5000000 } }
-                    - { $zoom: { min: 10 }, area: { min: 1000000 } }
-                    - { $zoom: { min: 11 }, area: { min: 500000 } }
-                    - { $zoom: { min: 12 }, area: { min: 250000 } }
-                    - { $zoom: { min: 13 }, area: { min: 100000 } }
-                    - { $zoom: { min: 14 }, area: { min: 50000 } }
-                    - { $zoom: { min: 15 }, area: { min: 20000 } }
-                    - { $zoom: { min: 15 }, area: { min: 2000 } }
-                    - { $zoom: { min: 16 }, area: true }
-            conservation:
-                filter:
-                    kind: [conservation, protected_area, nature_reserve]
-                    $zoom: { min: 4 }
-                draw:
-                    dots2:
-                        color: [0.420,0.808,0.698]
-                        visible: true
-                wilderness-areas:
-                    filter: function() { return feature.name && feature.name.indexOf("Wilderness") > -1 }
-                    draw:
-                        dots2:
-                            order: 25
-                            color: [0.027,0.804,0.494]
-                            visible: true
-
-                national_forest_level_6:
-                    filter: { protect_class: ["6",6] }
-                    draw:
-                        dots2:
-                            color: [0.442,0.960,0.865] #*green7
-                            visible: true
-
-            # gotta be a protected area to draw green, not just a landcover type
-            farm:
-                filter:
-                    kind: [farm, farmland]
-                    $zoom: { min: 10}
-                draw:
-                    dots2:
-                        color: [0.600,0.790,0.714]
-                        visible: global.green4_v
-            forest:
-                filter: { kind: [forest,wood], $zoom: { min: 6 } }
-                national-forest:
-                    filter:
-                        operator: [ "United States Forest Service", "US Forest Service", "U.S. Forest Service", "USDA Forest Service" ]
-                    draw:
-                        dots2:
-                            color: global.green7
-                            visible: true
-
-                landuse-forest:
-                    filter:
-                        not: { operator: [ "United States Forest Service", "US Forest Service", "U.S. Forest Service", "USDA Forest Service" ] }
-                        $zoom: { min: 10 }
-                    draw:
-                        dots2:
-                            color: [0.486,0.839,0.722]
-                            visible: true
-
-            nature_reserve:
-                filter: { kind: nature_reserve, $zoom: { min: 7 } }
-                draw:
-                    dots2:
-                        color: [0.596,0.788,0.624]
-                        visible: true
-                wilderness-areas:
-                    filter: function() { return feature.name && feature.name.indexOf("Wilderness") > -1 }
-                    draw:
-                        dots2:
-                            color: global.green7
-                            visible: true
+            dots2:
+                order: global.feature_order
+                visible: false
+            dots-rev:
+                order: global.feature_order
+                visible: false
+            polygons:
+                order: global.feature_order
+                #debug for polygon merging
+                #order: |
+#                   function() {
+#                       if( feature.id ) {
+#                           return 1001;
+#                       } else {
+#                           return 1000;
+#                       }
+#                   }
+                interactive: true
+                #debug for polygon merging
+                #color: |
+#                   function() {
+#                       if( feature.id ) {
+#                           return [
+#                               0.7 * (parseInt(feature.id, 16) / 100 % 1),     // jshint ignore:line
+#                               0.7 * (parseInt(feature.id, 16) / 10000 % 1),   // jshint ignore:line
+#                               0.7 * (parseInt(feature.id, 16) / 1000000 % 1), // jshint ignore:line
+#                               1
+#                           ];
+#                       } else {
+#                           if( feature.scale_rank == 6 ) {
+#                               return [1.,0.,0.,1];
+#                           } else if( feature.scale_rank == 5 ) {
+#                               return [0.,1.,0.,1];
+#                           } else if( feature.scale_rank == 4 ) {
+#                               return [0.,0.,1.,1];
+#                           } else if( feature.scale_rank == 3 ) {
+#                               return [0.,0.,0.5,1];
+#                           } else if( feature.scale_rank == 2 ) {
+#                               return [0.,0.5,0.,1];
+#                           } else if( feature.scale_rank == 1 ) {
+#                               return [0.,0.5,0.,1];
+#                           } else if( feature.scale_rank == 0 ) {
+#                               return [0.5,0.,0.,1];
+#                           } else {
+#                               return [0.5,0.5,0.5,1];
+#                           }
+#                       }
+#                   }
+            lines:
+                order: global.feature_order
 
-            parks-and-national-forests-not-national-park:
-                filter: { $zoom: { min: 4 }, kind: [park, national_park, "park or protected land"], not: { operator: [ "United States National Park Service", "US National Park Service" ] } }
-                # default for national forests and more?
-                draw:
-                    dots2:
-                        # color: [[4,[0.655,0.800,0.796]],[11,[0.588,0.780,0.773]],[12,[0.242,0.737,0.712]],[14,[0.412,0.733,0.718]],[15,[0.635,0.792,0.788]]]
-                        color: [[4,[0.655,0.800,0.796]],[11,[0.588,0.780,0.773]],[12,[0.635,0.792,0.788]]]
-                        visible: true
-            urban:
-                filter: { kind: [urban, rural, residential] }
-                visible: global.earth2_v
-                draw:
-                    dots2:
-                        color: [[0, global.earth2],[9, global.earth2]]
-                        visible: global.earth2_v
-        tier3:
+        landuse-labels:
             filter:
-                any:
-                    # limit show smaller landuse areas to higher zooms
-                    - { $zoom: { min: 8 },  area: { min: 10000000 } }
-                    - { $zoom: { min: 9 },  area: { min: 5000000 } }
-                    - { $zoom: { min: 10 }, area: { min: 1000000 } }
-                    - { $zoom: { min: 11 }, area: { min: 500000 } }
-                    - { $zoom: { min: 12 }, area: { min: 500000 } }
-                    - { $zoom: { min: 13 }, area: { min: 100000 } }
-                    - { $zoom: { min: 14 }, area: { min: 50000 } }
-                    - { $zoom: { min: 15 }, area: { min: 20000 } }
-                    - { $zoom: { min: 15 }, area: { min: 2000 } }
-                    - { $zoom: { min: 16 }, area: true }
-            airport:
-                filter:
-                    kind: aerodrome
-                draw:
-                    dots2:
-                        color: [0.805,0.805,0.825]
-                        visible: global.purple_v
-            military:
-                filter:
-                    kind: military
-                draw:
-                    dots2:
-                        color: [0.722,0.769,0.827]
-                        visible: true
-            university:
-                filter:
-                    kind: [university, college]
-                draw:
-                    dots2:
-                        color: [0.827,0.753,0.682]
-                        visible: true
-        tier4:
+                all:
+                    - label_placement: true
+                    - name: true
+            draw:
+                text-blend-order:
+                    text_source: global.ux_language_text_source
+                    interactive: true
+                    move_into_tile: true
+                    priority: 100
+                    visible: global.text_visible_landuse_generic
+                    font:
+                        fill: '#666'
+                        family: global.text_font_family
+                        style: italic
+                        size: 11px
+                        stroke: { color: global.text_stroke_address, width: 1 }
+
+#        tier1:
+#            filter:
+#                any:
+#                    # limit show smaller landuse areas to higher zooms
+#                    - { $zoom: { min: 3 },  area: { min: 300000000 } }
+#                    - { $zoom: { min: 4 },  area: { min: 300000000 } }
+#                    - { $zoom: { min: 5 },  area: { min: 150000000 } }
+#                    - { $zoom: { min: 6 },  area: { min: 150000000 } }
+#                    - { $zoom: { min: 7 },  area: { min: 100000000 } }
+#                    - { $zoom: { min: 8 },  area: { min: 10000000 } }
+#                    - { $zoom: { min: 9 },  area: { min: 5000000 } }
+#                    - { $zoom: { min: 10 }, area: { min: 1000000 } }
+#                    - { $zoom: { min: 11 }, area: { min: 500000 } }
+#                    - { $zoom: { min: 12 }, area: { min: 500000 } }
+#                    - { $zoom: { min: 13 }, area: { min: 100000 } }
+#                    - { $zoom: { min: 14 }, area: { min: 50000 } }
+#                    - { $zoom: { min: 15 }, area: { min: 20000 } }
+#                    - { $zoom: { min: 15 }, area: { min: 2000 } }
+#                    - { $zoom: { min: 16 }, area: true }
+        national_park:
             filter:
+                all:
+                    - kind: [national_park, battlefield, protected_area]
                 any:
-                    # limit show smaller landuse areas to higher zooms
-                    - { $zoom: { min: 10 }, area: { min: 1000000 } }
-                    - { $zoom: { min: 11 }, area: { min: 500000 } }
-                    - { $zoom: { min: 12 }, area: { min: 500000 } }
-                    - { $zoom: { min: 13 }, area: { min: 100000 } }
-                    - { $zoom: { min: 14 }, area: { min: 50000 } }
-                    - { $zoom: { min: 15 }, area: { min: 20000 } }
-                    - { $zoom: { min: 15 }, area: { min: 2000 } }
-                    - { $zoom: { min: 16 }, area: true }
-            cemetery:
-                filter:
-                    kind: cemetery
-                draw:
-                    dots2:
-                        color: global.green2
-                        visible: true
-            commercial:
-                filter:
-                    kind: commercial
-                draw:
-                    dots2:
-                        color: [0.855,0.748,0.667]
-                        visible: global.grey1_v
-            golf_course:
-                filter:
-                    kind: golf_course
-                draw:
-                    dots2:
-                        color: [0.353,0.812,0.545]
-                        visible: true
-            hospital:
-                filter:
-                    kind: hospital
-                draw:
-                    dots2:
-                        color: [0.843,0.624,0.647]
-                        visible: true
-            industrial:
-                filter:
-                    kind: industrial
-                draw:
-                    dots-rev:
-                        color: [[8,[0.845,0.845,0.845]],[14,[0.835,0.835,0.835]],[15,[0.780,0.780,0.780]]]
-                        visible: true
-            power:
-                filter: { kind: [plant, generator, substation] }
-                draw:
-                    dots2:
-                        color: [0.679,0.679,0.679]
-                        visible: true
-            railway:
-                filter:
-                    kind: railway
-                draw:
-                    dots-rev:
-                        color: [0.898,0.910,0.918]
-                        visible: true
-            sports_centre:
-                filter:
-                    kind: sports_centre
-                draw:
-                    dots2:
-                        color: global.green10
-            recreation_ground:
-                filter:
-                    kind: recreation_ground
-                draw:
-                    dots2:
-                        color: global.green1
-                        visible: true
-            retail:
-                filter:
-                    kind: retail
-                draw:
-                    dots2:
-                        color: [0.955,0.752,0.650]
-                        visible: global.grey1_v
-            stadium:
-                filter:
-                    kind: stadium
-                draw:
-                    dots2:
-                        color: [0.624,0.690,0.761]
-                        visible: true
-            zoo:
-                filter:
-                    kind: [zoo, wildlife_park]
-                draw:
-                    dots2:
-                        color: [0.498,1.000,0.851]
-                        visible: true
-            winter_sports:
+                    - not: { operator: [ "United States Forest Service" ] }
+                    - protect_class: ['2','3','5']
+            draw:
+                dots2:
+                    color: [[4,[0.655,0.800,0.796]],[8,[0.588,0.780,0.773]]]
+                    # todo: what is this?
+                    order: 18
+                    visible: true
+            us_national_park:
+                # yosemite national park, death valley national park, grand canyon national park
                 filter:
-                    kind: winter_sports
-                draw:
-                    dots2:
-                        color: global.grey8
-                        visible: global.grey8_v
-            man-made:
-                filter: { kind: [pier,wastewater_plant,works,bridge,tower,breakwater,water_works,groyne,dike,cutline] }
+                    any:
+                        - operator: [ "United States National Park Service" ]
+                        - protect_class: ['2','3','5']
                 draw:
                     dots2:
-                        color: [0.690,0.690,0.690]
+                        color: [[4,[0.525,0.765,0.686]],[9,[0.416,0.737,0.631]]]
+                        order: 19
                         visible: true
-                pier:
-                    filter: { kind: [pier,bridge,breakwater,groyne,dike,cutline] }
-                    draw:
-                        dots2:
-                            color: [0.679,0.679,0.679]
-                            visible: true
-        tier5:
+                        # color: [[4,[0.242,0.737,0.712]],[12,[0.224,0.682,0.659]]]
+#        tier2:
+#            filter:
+#                any:
+#                    # limit show smaller landuse areas to higher zooms
+#                    - { $zoom: { min: 4 },  area: { min: 1000000000 } }
+#                    - { $zoom: { min: 5 },  area: { min: 1000000000 } }
+#                    - { $zoom: { min: 6 },  area: { min: 150000000 } }
+#                    - { $zoom: { min: 7 },  area: { min: 100000000 } }
+#                    - { $zoom: { min: 8 },  area: { min: 10000000 } }
+#                    - { $zoom: { min: 9 },  area: { min: 5000000 } }
+#                    - { $zoom: { min: 10 }, area: { min: 1000000 } }
+#                    - { $zoom: { min: 11 }, area: { min: 500000 } }
+#                    - { $zoom: { min: 12 }, area: { min: 250000 } }
+#                    - { $zoom: { min: 13 }, area: { min: 100000 } }
+#                    - { $zoom: { min: 14 }, area: { min: 50000 } }
+#                    - { $zoom: { min: 15 }, area: { min: 20000 } }
+#                    - { $zoom: { min: 15 }, area: { min: 2000 } }
+#                    - { $zoom: { min: 16 }, area: true }
+        conservation:
+            filter:
+                all:
+                    - $zoom: { min: 4 }
+                    - kind: [protected_area, nature_reserve, national_park]
+                    - not: { protect_class: ['2','3','5'] }
+            draw:
+                dots2:
+                    # effectively the wilderness color
+                    color: [[0,[0.442,0.960,0.865]],[11,[0.2,0.850,0.765]]] #red #[0.420,0.808,0.698]
+                    visible: true
+                    order: 33
+        national_forest_level_6:
             filter:
+                all:
+                    - kind: forest
                 any:
-                    # limit show smaller landuse areas to higher zooms
-                    - { $zoom: { min: 10 }, area: { min: 1000000 } }
-                    - { $zoom: { min: 11 }, area: { min: 400000 } }
-                    - { $zoom: { min: 12 }, area: { min: 200000 } }
-                    - { $zoom: { min: 13 }, area: { min: 50000 } }
-                    - { $zoom: { min: 14 }, area: { min: 20000 } }
-                    - { $zoom: { min: 15 }, area: { min: 10000 } }
-                    - { $zoom: { min: 15 }, area: { min: 2000 } }
-                    - { $zoom: { min: 16 } }
+                    - protect_class: ['6']
+                    - operator: ['United States Forest Service']
+            draw:
+                dots2:
+                    color: [0.442,0.960,0.865] #*green7
+                    visible: true
+
+        # gotta be a protected area to draw green, not just a landcover type
+        farm:
+            filter:
+                kind: [farm, farmland]
+                $zoom: { min: 10}
+            draw:
+                dots2:
+                    color: [0.600,0.790,0.714]
+                    visible: global.green4_v
+        forest-landcover:
+            filter: { kind: [forest, natural_forest, wood, natural_wood, natural_park], $zoom: { min: 10 }, not: { operator: "United States Forest Service" } }
+            draw:
+                dots2:
+                    color: [0.70,0.990,0.92] #[0.486,0.839,0.722]
+                    visible: true
+
+        parks-and-national-forests-not-national-park:
+            filter:
                 all:
-                    - kind:
-                        - theme_park
-                        - resort
-                        - aquarium
-                        - winery
-                        - maze
-                        - beach
-            tourism-related:
+                    - $zoom: { min: 4 }
+                    - kind: [park, national_park]
+                any:
+                    - not: { operator: [ "United States National Park Service", "United States Forest Service" ] }
+                    - not: { protect_class: ['2','3','5','6'] }
+            # default for national forests and more?
+            draw:
+                dots2:
+                    # color: [[4,[0.655,0.800,0.796]],[11,[0.588,0.780,0.773]],[12,[0.242,0.737,0.712]],[14,[0.412,0.733,0.718]],[15,[0.635,0.792,0.788]]]
+                    color: [[4,[0.655,0.800,0.796]],[11,[0.588,0.780,0.773]],[12,[0.635,0.792,0.788]]]
+                    visible: true
+            #forest:
+#                    filter: { kind: forest }
+#                    draw:
+#                        dots2:
+#                            color: green
+            national_park:
+                #filter: function() { return feature.name && (feature.name.indexOf('National Park') > -1); }
                 filter:
-                    kind:
-                        - theme_park
-                        - resort
-                        - aquarium
-                        - winery
-                        - maze
+                    all:
+                        - kind: national_park
+                        - not: [ protect_class: ['2','3','5','6'], operator: [ "United States National Park Service"] ]
                 draw:
                     dots2:
-                        color: global.grey10
-                        visible: true
-            beach:
-                filter:
-                    kind: beach
+                        color: [[4,[0.525,0.765,0.686]],[9,[0.416,0.737,0.631]]]
+        urban:
+            filter: { kind: [urban, rural, residential] }
+            visible: global.earth2_v
+            draw:
+                dots2:
+                    color: [[0, global.earth2],[9, global.earth2]]
+                    visible: global.earth2_v
+#        tier3:
+#            filter:
+#                any:
+#                    # limit show smaller landuse areas to higher zooms
+#                    - { $zoom: { min: 8 },  area: { min: 10000000 } }
+#                    - { $zoom: { min: 9 },  area: { min: 5000000 } }
+#                    - { $zoom: { min: 10 }, area: { min: 1000000 } }
+#                    - { $zoom: { min: 11 }, area: { min: 500000 } }
+#                    - { $zoom: { min: 12 }, area: { min: 500000 } }
+#                    - { $zoom: { min: 13 }, area: { min: 100000 } }
+#                    - { $zoom: { min: 14 }, area: { min: 50000 } }
+#                    - { $zoom: { min: 15 }, area: { min: 20000 } }
+#                    - { $zoom: { min: 15 }, area: { min: 2000 } }
+#                    - { $zoom: { min: 16 }, area: true }
+        airport:
+            filter:
+                kind: aerodrome
+            draw:
+                dots2:
+                    color: [0.805,0.805,0.825]
+                    visible: true
+        military:
+            filter:
+                kind: military
+            draw:
+                dots2:
+                    color: [0.722,0.769,0.827]
+                    visible: true
+        university:
+            filter:
+                kind: [university, college]
+            draw:
+                dots2:
+                    color: [0.827,0.753,0.682]
+                    visible: true
+#        tier4:
+#            filter:
+#                any:
+#                    # limit show smaller landuse areas to higher zooms
+#                    - { $zoom: { min: 10 }, area: { min: 1000000 } }
+#                    - { $zoom: { min: 11 }, area: { min: 500000 } }
+#                    - { $zoom: { min: 12 }, area: { min: 500000 } }
+#                    - { $zoom: { min: 13 }, area: { min: 100000 } }
+#                    - { $zoom: { min: 14 }, area: { min: 50000 } }
+#                    - { $zoom: { min: 15 }, area: { min: 20000 } }
+#                    - { $zoom: { min: 15 }, area: { min: 2000 } }
+#                    - { $zoom: { min: 16 }, area: true }
+        cemetery:
+            filter:
+                kind: cemetery
+            draw:
+                dots2:
+                    color: global.green2
+                    visible: true
+        commercial:
+            filter:
+                kind: commercial
+            draw:
+                dots2:
+                    color: [0.855,0.748,0.667]
+                    visible: global.grey1_v
+        golf_course:
+            filter:
+                kind: golf_course
+            draw:
+                dots2:
+                    color: [0.353,0.812,0.545]
+                    visible: true
+        hospital:
+            filter:
+                kind: hospital
+            draw:
+                dots2:
+                    color: [0.843,0.624,0.647]
+                    visible: true
+        industrial:
+            filter:
+                kind: industrial
+            draw:
+                dots-rev:
+                    color: [[8,[0.845,0.845,0.845]],[14,[0.835,0.835,0.835]],[15,[0.780,0.780,0.780]]]
+                    visible: true
+        power:
+            filter: { kind: [plant, generator, substation] }
+            draw:
+                dots2:
+                    color: [0.679,0.679,0.679]
+                    visible: true
+        railway:
+            filter:
+                kind: railway
+            draw:
+                dots-rev:
+                    color: [0.898,0.910,0.918]
+                    visible: true
+        sports_centre:
+            filter:
+                kind: sports_centre
+            draw:
+                dots2:
+                    color: global.green10
+        recreation_ground:
+            filter:
+                kind: recreation_ground
+            draw:
+                dots2:
+                    color: global.green1
+                    visible: true
+        retail:
+            filter:
+                kind: retail
+            draw:
+                dots2:
+                    color: [0.955,0.752,0.650]
+                    visible: global.grey1_v
+        stadium:
+            filter:
+                kind: stadium
+            draw:
+                dots2:
+                    color: [0.624,0.690,0.761]
+                    visible: true
+        zoo:
+            filter:
+                kind: [zoo, wildlife_park]
+            draw:
+                dots2:
+                    color: [0.498,1.000,0.851]
+                    visible: true
+        winter_sports:
+            filter:
+                kind: winter_sports
+            draw:
+                dots2:
+                    color: global.grey8
+                    visible: global.grey8_v
+        man-made:
+            filter: { kind: [pier,wastewater_plant,works,bridge,tower,breakwater,water_works,groyne,dike,cutline] }
+            draw:
+                dots2:
+                    color: [0.690,0.690,0.690]
+                    visible: true
+            pier:
+                filter: { kind: [pier,bridge,breakwater,groyne,dike,cutline] }
                 draw:
                     dots2:
-                        color: [0.780,0.740,0.538]
+                        color: [0.679,0.679,0.679]
                         visible: true
+#        tier5:
+#            filter:
+#                any:
+#                    # limit show smaller landuse areas to higher zooms
+#                    - { $zoom: { min: 10 }, area: { min: 1000000 } }
+#                    - { $zoom: { min: 11 }, area: { min: 400000 } }
+#                    - { $zoom: { min: 12 }, area: { min: 200000 } }
+#                    - { $zoom: { min: 13 }, area: { min: 50000 } }
+#                    - { $zoom: { min: 14 }, area: { min: 20000 } }
+#                    - { $zoom: { min: 15 }, area: { min: 10000 } }
+#                    - { $zoom: { min: 15 }, area: { min: 2000 } }
+#                    - { $zoom: { min: 16 } }
+#            all:
+#                - kind:
+#                    - theme_park
+#                    - resort
+#                    - aquarium
+#                    - winery
+#                    - maze
+#                    - beach
+        tourism-related:
+            filter:
+                kind:
+                    - theme_park
+                    - resort
+                    - aquarium
+                    - winery
+                    - maze
+            draw:
+                dots2:
+                    color: global.grey10
+                    visible: true
+        beach:
+           filter:
+               kind: beach
+           draw:
+               dots2:
+                   color: [0.780,0.740,0.538]
+                   visible: true
+        #tier6-early:
+#            filter:
+#                all:
+#                    - kind: [garden, allotments, parking, pedestrian, common, pitch, place_of_worship, playground, school]
+#                any:
+#                    # limit show smaller landuse areas to higher zooms
+#                    - { $zoom: { max: 13 } }
+##                    - { $zoom: [12], area: { max: 50000 } }
+#            draw:
+#                dots2:
+#                    visible: false
         tier6:
             filter:
-                any:
-                    # limit show smaller landuse areas to higher zooms
-                    - { $zoom: { min: 12 }, area: { min: 500000 } }
-                    - { $zoom: { min: 13 }, area: { min: 100000 } }
-                    - { $zoom: { min: 14 }, area: { min: 50000 } }
-                    - { $zoom: { min: 15 }, area: { min: 20000 } }
-                    - { $zoom: { min: 15 }, area: { min: 2000 } }
-                    - { $zoom: { min: 16 }, area: true }
+                all:
+                    - kind: [garden, allotments, parking, pedestrian, common, pitch, place_of_worship, playground, school]
+                #any:
+#                    # limit show smaller landuse areas to higher zooms
+#                    #- { $zoom: { min: 12 }, area: { min: 500000 } }
+#                    - { $zoom: { min: 13 }, area: { min: 100000 } }
+#                    - { $zoom: { min: 14 }, area: { min: 50000 } }
+#                    - { $zoom: { min: 15 }, area: { min: 20000 } }
+#                    - { $zoom: { min: 15 }, area: { min: 2000 } }
+#                    - { $zoom: { min: 16 }, area: true }
             garden:
                 filter:
                     kind: [garden, allotments]
@@ -6564,41 +7100,39 @@ layers:
                     dots2:
                         color: [0.749,0.722,0.694]
                         visible: true
-            minor-landuse:
-                filter:
-                    kind:
-                        - attraction
-                        - artwork
-                        - wilderness_hut
-                        - hanami
-                draw:
-                    dots2:
-                        color: [0.765,0.765,0.765]
-                        visible: true
+        minor-landuse:
+            filter:
+                kind:
+                    - attraction
+                    - artwork
+                    - wilderness_hut
+                    - hanami
+            draw:
+                dots2:
+                    color: [0.765,0.765,0.765]
+                    visible: true
 
-            # GO MELLOW
-            # 18/41.19776/-8.68722
-            tree_row:
-                filter:
-                    kind: tree_row
-                draw:
-                    lines:
-                        order: 501 # function() { return feature.sort_key; }
-                        color: [0.602,0.860,0.722]
-                        width: [[16,1px],[17,2px],[19,1.5m]]
-                        visible: true
-            # GO MELLOW
-            # 20/37.76779/-122.40096
-            hedge:
-                filter:
-                    kind: hedge
-                draw:
-                    lines:
-                        order: 500 # function() { return feature.sort_key; }
-                        color: [0.602,0.860,0.722]
-                        width: [[16,0.5px],[17,1px],[19,1m]]
-                        visible: true
+        # GO MELLOW
+        # 18/41.19776/-8.68722
+        tree_row:
+            filter:
+                kind: tree_row
+            draw:
+                lines:
+                    order: 501 # function() { return feature.sort_rank; }
+                    color: [0.602,0.860,0.722]
+                    width: [[16,1px],[17,2px],[19,1.5m]]
 
+        # GO MELLOW
+        # 20/37.76779/-122.40096
+        hedge:
+            filter:
+                kind: hedge
+            draw:
+                lines:
+                    order: 500 # function() { return feature.sort_rank; }
+                    color: [0.602,0.860,0.722]
+                    width: [[16,0.5px],[17,1px],[19,1m]]
 
     landuse-not-filtered:
         data: { source: mapzen, layer: landuse }
@@ -6679,7 +7213,7 @@ layers:
                 order: global.feature_order
                 color: [[4,[0.965,0.600,0.882]],[6,[0.965,0.600,0.882]],[7,[0.882,0.639,0.827]],[8,[0.757,0.729,0.753]]]
 
-    transit-rail-lines:
+    transit-overlay-rail-lines:
         data: { source: mapzen, layer: transit }
         filter:
             not: { kind: [platform, railway] }
@@ -6816,8 +7350,8 @@ layers:
 #                outline:
 #                    order: 487
 
-    transit-station-labels:
-        data: { source: mapzen, layer: [pois,landuse] }
+    transit-overlay-station-labels:
+        data: { source: mapzen, layer: [pois] }
         filter:
             kind: [station, tram_stop, bus_station, subway_entrance, halt, stop, platform, bus_stop, stop_position ]
             any:
@@ -6952,7 +7486,7 @@ layers:
                 icons:
                     size: [[16, 12px], [17, 14px], [18, 18px]]
                     sprite: light-rail
-                    text:
+                    #text:
                         #offset: [[13, [0, 6px]], [16, [0, 9px]]]
         bus-like-labels:
             filter:
@@ -7010,24 +7544,6 @@ layers:
                             size: 12px
                             stroke: { color: white, width: 4 }
 
-    transit-station-buildings:
-        data: { source: mapzen, layer: [buildings] }
-        filter:
-            any:
-                - landuse_kind: [station]
-        draw:
-            polygons:
-                visible: global.sdk_transit_overlay
-                color: '#bdadbf'
-                order: 500
-                #extrude: function() { return feature.height || 20; }
-            outline:
-                visible: global.sdk_transit_overlay
-                style: lines
-                order: 501
-                color: '#d534df'
-                width: [[14,0.1px],[15,0.5px],[17,0.5px],[18,0.75px],[19,0.25m]]
-                #extrude: function() { return feature.height || 20; }
 
 #    transit-platforms:
 #        data: { source: mapzen, layer: transit }
@@ -7054,27 +7570,6 @@ layers:
 #                lines:
 #                    visible: false
 
-    transit-basemap-railway-late:
-        data: { source: mapzen, layer: roads }
-        filter: { kind: rail, $zoom: { min: 16 }, not: { railway: [subway,light_rail,tram] } }
-        draw:
-            lines:
-                visible: global.sdk_transit_overlay
-                interactive: true
-                color: black
-                width: [[15,0.5px],[16,0.75px],[18,1m]]
-                # let roads sort themselves past zoom 14
-                order: 491
-                # but give them all the same outline
-                outline:
-                    order: 490
-        service:
-            filter: { service: true }
-            draw:
-                lines:
-                    color: black
-                    width: [[14,0px],[15,0.4px],[16,0.6px],[18,0.7m]]
-
     debug:
         data: { source: mapzen }
         draw: