diff --git a/admin.mss b/admin.mss index 49472fb2a7..9b96cc58f0 100644 --- a/admin.mss +++ b/admin.mss @@ -204,20 +204,30 @@ overlapping borders correctly. comp-op: darken; } -#admin-text[zoom >= 16] { - text-name: "[name]"; - text-face-name: @book-fonts; - text-fill: @admin-boundaries; - text-halo-radius: @standard-halo-radius; - text-halo-fill: @standard-halo-fill; - text-largest-bbox-only: false; - text-placement: line; - text-spacing: 750; - text-repeat-distance: 250; - text-margin: 10; - text-clip: true; - text-vertical-alignment: middle; - text-dy: -10; +#admin-text[zoom >= 11][way_pixels >= 48000] { + [admin_level = '1'][way_pixels >= 360000], + [admin_level = '2'][way_pixels >= 360000], + [admin_level = '3'][way_pixels >= 196000], + [admin_level = '4'][way_pixels >= 196000], + [zoom >= 12][admin_level = '5'], + [zoom >= 13][admin_level = '6'], + [zoom >= 14][admin_level = '7'], + [zoom >= 15][admin_level = '8'], + [zoom >= 16] { + text-name: "[name]"; + text-face-name: @book-fonts; + text-fill: @admin-boundaries; + text-halo-radius: @standard-halo-radius; + text-halo-fill: @standard-halo-fill; + text-largest-bbox-only: false; + text-placement: line; + text-spacing: 750; + text-repeat-distance: 250; + text-margin: 10; + text-clip: true; + text-vertical-alignment: middle; + text-dy: -10; + } } #protected-areas-text[zoom >= 13][way_pixels > 192000] { diff --git a/project.mml b/project.mml index ab5a064701..286569d2bf 100644 --- a/project.mml +++ b/project.mml @@ -2549,15 +2549,16 @@ Layer: (SELECT way, name, - admin_level + admin_level, + way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels FROM planet_osm_polygon WHERE boundary = 'administrative' - AND admin_level IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10') + AND admin_level IN ('1', '2', '3', '4', '5', '6', '7', '8', '9', '10') AND name IS NOT NULL ORDER BY admin_level::integer ASC, way_area DESC ) AS admin_text properties: - minzoom: 16 + minzoom: 11 - id: protected-areas-text geometry: linestring <<: *extents