fix some boundaries not hidden by the filter, closes #9171

This commit is contained in:
Martin Raifer
2022-07-12 18:14:40 +02:00
parent 7c9b47edb5
commit 03d6bb0f55
2 changed files with 14 additions and 3 deletions
+3 -1
View File
@@ -55,6 +55,7 @@ _Breaking developer changes, which may affect downstream projects or sites that
* Fix leaking of localized tag values into raw tags by multiCombo fields ([#9164], thanks [@1ec5])
* Fix localizable labels in multiCombo fields ("chips") being rendered multiple times ([#9169])
* Fix missing styling when rendering of proposed footway/cycleway/path bridges ([#9172], thanks [@k-yle])
* Fix some boundary lines (and preset) not hidden by the map features filter ([#9171], thanks [@k-yle])
#### :rocket: Presets
* Disable taginfo suggestions for the `via` field ([#9140], thanks [@k-yle])
* Treat `surface=chipseal` as a paved surface ([#9139], thanks [@k-yle])
@@ -77,7 +78,8 @@ _Breaking developer changes, which may affect downstream projects or sites that
[#9157]: https://github.com/openstreetmap/iD/issues/9157
[#9164]: https://github.com/openstreetmap/iD/issues/9164
[#9169]: https://github.com/openstreetmap/iD/issues/9169
[#9172]: https://github.com/openstreetmap/iD/issues/9172
[#9171]: https://github.com/openstreetmap/iD/pull/9171
[#9172]: https://github.com/openstreetmap/iD/pull/9172
[@furkanmutlu]: https://github.com/furkanmutlu
[@JackNUMBER]: https://github.com/JackNUMBER
[@aaditya0000]: https://github.com/aaditya0000
+11 -2
View File
@@ -69,6 +69,11 @@ export function rendererFeatures(context) {
}
/**
* @param {string} k
* @param {(tags: Record<string, string>, geometry: string) => boolean} filter
* @param {?number} max
*/
function defineRule(k, filter, max) {
var isEnabled = true;
@@ -133,9 +138,13 @@ export function rendererFeatures(context) {
!_rules.pistes.filter(tags);
});
defineRule('boundaries', function isBoundary(tags) {
defineRule('boundaries', function isBoundary(tags, geometry) {
// This rule applies if the object has no interesting tags, and if either:
// (a) is a way having a `boundary=*` tag, or
// (b) is a relation of `type=boundary`.
return (
!!tags.boundary
(geometry === 'line' && !!tags.boundary) ||
(geometry === 'relation' && tags.type === 'boundary')
) && !(
traffic_roads[tags.highway] ||
service_roads[tags.highway] ||