From 03a65f20639440b2b4cb81d2d1dd07a6c6774694 Mon Sep 17 00:00:00 2001 From: Navneet Date: Sun, 22 Feb 2026 19:07:24 +0530 Subject: [PATCH] Fix: prevent boundary relation members from rendering as areas --- modules/svg/areas.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/modules/svg/areas.js b/modules/svg/areas.js index 49a7b309f42..1fd0cbeddf3 100644 --- a/modules/svg/areas.js +++ b/modules/svg/areas.js @@ -1,8 +1,8 @@ import deepEqual from 'fast-deep-equal'; import { bisector as d3_bisector } from 'd3-array'; +import { svgPath, svgSegmentWay, svgRelationMemberTags } from './helpers'; import { osmEntity } from '../osm'; -import { svgPath, svgSegmentWay } from './helpers'; import { svgTagClasses } from './tag_classes'; import { svgTagPattern } from './tag_pattern'; @@ -94,7 +94,19 @@ export function svgAreas(projection, context) { for (var i = 0; i < entities.length; i++) { var entity = entities[i]; - if (entity.geometry(graph) !== 'area') continue; + // Skip non-area geometries + if (entity.geometry(graph) !== 'area') continue; + + // Boundary relation members should render as lines + var parents = graph.parentRelations(entity); + var isBoundaryMember = parents.some(function(relation) { + return relation.tags && ( + relation.tags.type === 'boundary' || + relation.tags.boundary + ); + }); + + if (isBoundaryMember) continue; if (!areas[entity.id]) { areas[entity.id] = { entity: entity, @@ -192,7 +204,7 @@ export function svgAreas(projection, context) { base.entities[d.id] && !deepEqual(graph.entities[d.id].tags, base.entities[d.id].tags); }) - .call(svgTagClasses()) + .call(svgTagClasses().tags(svgRelationMemberTags(graph))) .attr('d', path);