mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-12 16:52:50 +00:00
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:
@@ -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:')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user