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
+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] ||