From 5a48dc4d2f0bdfa84d94958ae7ec84d04941edfd Mon Sep 17 00:00:00 2001 From: kdeterme Date: Mon, 12 Oct 2026 13:16:24 +0200 Subject: [PATCH] style(nature): adapter la taille des cercles d'arbres selon le niveau de zoom MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Réduction de l'échelle des cercles d'arbres sur la carte unifiée (diamètre de ~2px à ~18px) - Suppression des chevauchements d'arbres alignés aux zooms de rue (z15-z17) - Centrage des cercles sur leurs coordonnées GPS (anchor: center, offset: [0, 0]) - Harmonisation des rayons sur les vues détails et index nature --- .../static/assets/nature_location_detail.js | 10 +++++++--- .../assets/static/assets/unified_map_layers.js | 18 +++++++++--------- loko/assets/templates/assets/nature_index.html | 11 +++++++---- .../assets/nature_locations_detail.html | 2 +- .../assets/templates/assets/unified_index.html | 6 +++--- 5 files changed, 27 insertions(+), 20 deletions(-) diff --git a/loko/assets/static/assets/nature_location_detail.js b/loko/assets/static/assets/nature_location_detail.js index 7cda78d..03ccd04 100644 --- a/loko/assets/static/assets/nature_location_detail.js +++ b/loko/assets/static/assets/nature_location_detail.js @@ -197,9 +197,13 @@ document.addEventListener('DOMContentLoaded', function () { paint: { 'circle-radius': [ 'interpolate', ['linear'], ['zoom'], - 13, 4, - 16, 7, - 19, 12 + 8, 1.5, + 11, 2.5, + 13, 3.5, + 15, 5, + 17, 6.5, + 19, 8.5, + 22, 11 ], 'circle-color': [ 'case', diff --git a/loko/assets/static/assets/unified_map_layers.js b/loko/assets/static/assets/unified_map_layers.js index 0127bdf..612d778 100644 --- a/loko/assets/static/assets/unified_map_layers.js +++ b/loko/assets/static/assets/unified_map_layers.js @@ -693,7 +693,7 @@ const _unified_assets_symbol = { ['==', ['slice', ['get', 'code'], 0, 7], 'CSE-BAC'], ['==', ['slice', ['get', 'code'], 0, 7], 'CSE-BNC'] ], 0.07, - ['==', ['get', 'asset_type'], 'naturetree'], 0.08, + ['any', ['==', ['get', 'asset_type'], 'naturetree'], ['==', ['get', 'asset_type'], 'natureshrub'], ['==', ['get', 'thematic'], 'nature']], 0.04, 0.28 ], 11, [ @@ -729,7 +729,7 @@ const _unified_assets_symbol = { ['==', ['slice', ['get', 'code'], 0, 7], 'CSE-BAC'], ['==', ['slice', ['get', 'code'], 0, 7], 'CSE-BNC'] ], 0.12, - ['==', ['get', 'asset_type'], 'naturetree'], 0.14, + ['any', ['==', ['get', 'asset_type'], 'naturetree'], ['==', ['get', 'asset_type'], 'natureshrub'], ['==', ['get', 'thematic'], 'nature']], 0.07, 0.40 ], 13, [ @@ -765,7 +765,7 @@ const _unified_assets_symbol = { ['==', ['slice', ['get', 'code'], 0, 7], 'CSE-BAC'], ['==', ['slice', ['get', 'code'], 0, 7], 'CSE-BNC'] ], 0.19, - ['==', ['get', 'asset_type'], 'naturetree'], 0.22, + ['any', ['==', ['get', 'asset_type'], 'naturetree'], ['==', ['get', 'asset_type'], 'natureshrub'], ['==', ['get', 'thematic'], 'nature']], 0.10, 0.52 ], 15, [ @@ -801,7 +801,7 @@ const _unified_assets_symbol = { ['==', ['slice', ['get', 'code'], 0, 7], 'CSE-BAC'], ['==', ['slice', ['get', 'code'], 0, 7], 'CSE-BNC'] ], 0.34, - ['==', ['get', 'asset_type'], 'naturetree'], 0.38, + ['any', ['==', ['get', 'asset_type'], 'naturetree'], ['==', ['get', 'asset_type'], 'natureshrub'], ['==', ['get', 'thematic'], 'nature']], 0.15, 0.66 ], 17, [ @@ -837,7 +837,7 @@ const _unified_assets_symbol = { ['==', ['slice', ['get', 'code'], 0, 7], 'CSE-BAC'], ['==', ['slice', ['get', 'code'], 0, 7], 'CSE-BNC'] ], 0.55, - ['==', ['get', 'asset_type'], 'naturetree'], 0.62, + ['any', ['==', ['get', 'asset_type'], 'naturetree'], ['==', ['get', 'asset_type'], 'natureshrub'], ['==', ['get', 'thematic'], 'nature']], 0.22, 0.82 ], 19, [ @@ -873,7 +873,7 @@ const _unified_assets_symbol = { ['==', ['slice', ['get', 'code'], 0, 7], 'CSE-BAC'], ['==', ['slice', ['get', 'code'], 0, 7], 'CSE-BNC'] ], 0.80, - ['==', ['get', 'asset_type'], 'naturetree'], 0.85, + ['any', ['==', ['get', 'asset_type'], 'naturetree'], ['==', ['get', 'asset_type'], 'natureshrub'], ['==', ['get', 'thematic'], 'nature']], 0.28, 0.98 ], 22, [ @@ -909,27 +909,27 @@ const _unified_assets_symbol = { ['==', ['slice', ['get', 'code'], 0, 7], 'CSE-BAC'], ['==', ['slice', ['get', 'code'], 0, 7], 'CSE-BNC'] ], 1.05, - ['==', ['get', 'asset_type'], 'naturetree'], 1.10, + ['any', ['==', ['get', 'asset_type'], 'naturetree'], ['==', ['get', 'asset_type'], 'natureshrub'], ['==', ['get', 'thematic'], 'nature']], 0.36, 1.15 ] ], 'icon-anchor': [ 'case', + ['any', ['==', ['get', 'asset_type'], 'naturetree'], ['==', ['get', 'asset_type'], 'natureshrub'], ['==', ['get', 'thematic'], 'nature']], 'center', ['==', ['get', 'thematic'], 'publiclighting'], 'bottom', ['==', ['get', 'thematic'], 'trafficlights'], 'bottom', - ['==', ['get', 'thematic'], 'nature'], 'bottom', ['==', ['get', 'asset_type'], 'itsbollardplot'], 'bottom', 'center' ], 'icon-offset': [ 'case', + ['any', ['==', ['get', 'asset_type'], 'naturetree'], ['==', ['get', 'asset_type'], 'natureshrub'], ['==', ['get', 'thematic'], 'nature']], ['literal', [0, 0]], ['==', ['get', 'thematic'], 'publiclighting'], ['literal', [0, -2]], ['==', ['get', 'thematic'], 'trafficlights'], [ 'case', ['all', ['==', ['get', 'asset_type'], 'trafficlightradar'], ['coalesce', ['get', 'has_support'], false]], ['literal', [0, -25]], ['literal', [0, 0]] ], - ['==', ['get', 'thematic'], 'nature'], ['literal', [0, 5]], ['literal', [0, 0]] ], 'icon-allow-overlap': true, diff --git a/loko/assets/templates/assets/nature_index.html b/loko/assets/templates/assets/nature_index.html index 02257db..6bb0efb 100644 --- a/loko/assets/templates/assets/nature_index.html +++ b/loko/assets/templates/assets/nature_index.html @@ -169,10 +169,13 @@ paint: { 'circle-radius': [ 'interpolate', ['linear'], ['zoom'], - 8, 2, - 12, 3, - 16, 5, - 20, 8 + 8, 1.5, + 11, 2.5, + 13, 3.5, + 15, 5, + 17, 6.5, + 19, 8.5, + 22, 11 ], 'circle-color': [ 'case', diff --git a/loko/assets/templates/assets/nature_locations_detail.html b/loko/assets/templates/assets/nature_locations_detail.html index 795e9ca..1778b04 100644 --- a/loko/assets/templates/assets/nature_locations_detail.html +++ b/loko/assets/templates/assets/nature_locations_detail.html @@ -701,5 +701,5 @@ - + {% endblock script %} diff --git a/loko/assets/templates/assets/unified_index.html b/loko/assets/templates/assets/unified_index.html index 51bcf5f..1547545 100644 --- a/loko/assets/templates/assets/unified_index.html +++ b/loko/assets/templates/assets/unified_index.html @@ -1526,7 +1526,7 @@ - - - + + + {% endblock script %} \ No newline at end of file