-
-
Notifications
You must be signed in to change notification settings - Fork 93
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
According to the spec, a filter like `["==", "$type", "Polygon"] should match both "MultiPolygon" and "Polygon" geometries. However when using featureFilter() api, this is not the case.
To Reproduce
Jest test case:
import { featureFilter, LegacyFilterSpecification } from '@maplibre/maplibre-gl-style-spec';
test('$type == "Polygon" should match Polygon and MultiPolygon features', () => {
const typeFilterPoly: LegacyFilterSpecification = ['==', '$type', 'Polygon'];
const { filter: matchesPolygon } = featureFilter(typeFilterPoly);
expect(matchesPolygon({ zoom: 14 }, { type: 'Polygon', properties: {} })).toBe(true);
expect(matchesPolygon({ zoom: 14 }, { type: 'LineString', properties: {} })).toBe(false);
// This one fails currently:
expect(matchesPolygon({ zoom: 14 }, { type: 'MultiPolygon', properties: {} })).toBe(true);
});Expected behavior
Tests should pass, including the last one.
Desktop (please complete the following information):
tested with version 24.3.0
Additional context
Discussed briefly with Harel Mazor in slack.
AbelVM
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working