From 5eeda20ee682118faf95ec556d42d591a66909f5 Mon Sep 17 00:00:00 2001 From: kdeterme Date: Mon, 7 Sep 2026 12:00:30 +0200 Subject: [PATCH] fix: prevent round markers from appearing on polygon and line assets by checking geometry type --- .../inspections/components/asset_fields/_naturerwiz.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/loko/inspections/templates/inspections/components/asset_fields/_naturerwiz.html b/loko/inspections/templates/inspections/components/asset_fields/_naturerwiz.html index 87e057b..047411c 100644 --- a/loko/inspections/templates/inspections/components/asset_fields/_naturerwiz.html +++ b/loko/inspections/templates/inspections/components/asset_fields/_naturerwiz.html @@ -592,10 +592,11 @@ hasCoords = true; } - // Marqueurs ronds pour les assets ayant des coordonnées valides + // Marqueurs ronds uniquement pour les géométries ponctuelles ou sans géométrie surfacique/linéaire (évite d'afficher le centroïde des polygones) + const isPolyOrLine = geom && ['polygon', 'multipolygon', 'linestring', 'multilinestring'].includes(geom.type.toLowerCase()); const lon = asset.lon; const lat = asset.lat; - if (lon !== null && lat !== null && !isNaN(lon) && !isNaN(lat)) { + if (!isPolyOrLine && lon !== null && lat !== null && !isNaN(lon) && !isNaN(lat)) { if (!geom) { bounds.extend([lon, lat]); hasCoords = true;