only render addr point markers when there are addr tags

closes #11092

and also skip rendering of "placement ellipse" for address points
This commit is contained in:
Martin Raifer
2025-06-05 14:34:11 +02:00
parent c277bd0b76
commit e07dcddfee
2 changed files with 11 additions and 6 deletions

View File

@@ -792,11 +792,12 @@ const nonPrimaryKeys = new Set([
]);
const nonPrimaryKeysRegex = /^(ref|survey|note):/;
export function isAddressPoint(tags) {
const keys = Object.keys(tags);
const keys = Object.keys(tags).filter(key =>
osmIsInterestingTag(key) &&
!nonPrimaryKeys.has(key) &&
!nonPrimaryKeysRegex.test(key)
);
return keys.length > 0 && keys.every(key =>
key.startsWith('addr:') ||
!osmIsInterestingTag(key) ||
nonPrimaryKeys.has(key) ||
nonPrimaryKeysRegex.test(key)
key.startsWith('addr:')
);
}

View File

@@ -1,5 +1,6 @@
import deepEqual from 'fast-deep-equal';
import { clamp } from 'lodash-es';
import { select as d3_select } from 'd3';
import { geoScaleToZoom } from '../geo';
import { osmEntity } from '../osm';
@@ -121,13 +122,16 @@ export function svgPoints(projection, context) {
.append('path')
.call(markerPath, 'shadow');
enter
enter.each(function(d) {
if (isAddressPoint(d.tags)) return;
d3_select(this)
.append('ellipse')
.attr('cx', 0.5)
.attr('cy', 1)
.attr('rx', 6.5)
.attr('ry', 3)
.attr('class', 'stroke');
});
enter
.append('path')