fix: prevent round markers from appearing on polygon and line assets by checking geometry type
This commit is contained in:
parent
584df99605
commit
5eeda20ee6
1 changed files with 3 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue