diff --git a/CHANGELOG.md b/CHANGELOG.md index a329b99096..25a88a5f73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - ⚠️ Change drag rotate behavior to be less abrupt around the center ([#5104](https://github.com/maplibre/maplibre-gl-js/pull/5104)) - Fix regression in render world copies ([#5101](https://github.com/maplibre/maplibre-gl-js/pull/5101)) - Fix unwanted roll when motion is interrupted ([#5083](https://github.com/maplibre/maplibre-gl-js/pull/5083)) +- Fix `geometry-type` filter expression results ([#5132](https://github.com/maplibre/maplibre-gl-js/pull/5132)) - _...Add new stuff here..._ ## 5.0.0-pre.8 diff --git a/package-lock.json b/package-lock.json index 47f2328d87..103018e48d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "@mapbox/unitbezier": "^0.0.1", "@mapbox/vector-tile": "^1.3.1", "@mapbox/whoots-js": "^3.1.0", - "@maplibre/maplibre-gl-style-spec": "^22.0.0", + "@maplibre/maplibre-gl-style-spec": "^22.0.1", "@types/geojson": "^7946.0.14", "@types/geojson-vt": "3.2.5", "@types/mapbox__point-geometry": "^0.1.4", @@ -2181,9 +2181,9 @@ } }, "node_modules/@maplibre/maplibre-gl-style-spec": { - "version": "22.0.0", - "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-22.0.0.tgz", - "integrity": "sha512-kD8TxV6CdgHIEeam4xODVJNAT3hcvRhRl5RcNiu+FPR/JoMsExAQTruBGtv+jLppj4xt9V56pG/SHK8z6fv6xA==", + "version": "22.0.1", + "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-22.0.1.tgz", + "integrity": "sha512-V7bSw7Ui6+NhpeeuYqGoqamvKuy+3+uCvQ/t4ZJkwN8cx527CAlQQQ2kp+w5R9q+Tw6bUAH+fsq+mPEkicgT8g==", "dependencies": { "@mapbox/jsonlint-lines-primitives": "~2.0.2", "@mapbox/unitbezier": "^0.0.1", diff --git a/package.json b/package.json index 65cbe7dae3..1136be6a87 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "@mapbox/unitbezier": "^0.0.1", "@mapbox/vector-tile": "^1.3.1", "@mapbox/whoots-js": "^3.1.0", - "@maplibre/maplibre-gl-style-spec": "^22.0.0", + "@maplibre/maplibre-gl-style-spec": "^22.0.1", "@types/geojson": "^7946.0.14", "@types/geojson-vt": "3.2.5", "@types/mapbox__point-geometry": "^0.1.4", diff --git a/test/integration/render/tests/geometry-type/all-geomteries/expected.png b/test/integration/render/tests/geometry-type/all-geomteries/expected.png new file mode 100644 index 0000000000..44a92c7408 Binary files /dev/null and b/test/integration/render/tests/geometry-type/all-geomteries/expected.png differ diff --git a/test/integration/render/tests/geometry-type/all-geomteries/style.json b/test/integration/render/tests/geometry-type/all-geomteries/style.json new file mode 100644 index 0000000000..d67ced8412 --- /dev/null +++ b/test/integration/render/tests/geometry-type/all-geomteries/style.json @@ -0,0 +1,286 @@ +{ + "version": 8, + "center": [-100, 45], + "zoom": 4, + "name": "OpenStreetMap", + "glyphs": "https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf", + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "coordinates": [ + -100, + 40 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "coordinates": [ + [ + -100, + 41 + ], + [ + -99, + 41 + ] + ], + "type": "MultiPoint" + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "coordinates": [ + [ + -100, + 42 + ], + [ + -100, + 43 + ] + ], + "type": "LineString" + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "coordinates": [ + [ + [ + -100, + 44 + ], + [ + -100, + 45 + ] + ], + [ + [ + -99, + 44 + ], + [ + -99, + 45 + ] + ] + ], + "type": "MultiLineString" + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "coordinates": [ + [ + [ + -100, + 46 + ], + [ + -100, + 47 + ], + [ + -99, + 47 + ], + [ + -99, + 46 + ], + [ + -100, + 46 + ] + ] + ], + "type": "Polygon" + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "coordinates": [ + [ + [ + [ + -100, + 48 + ], + [ + -100, + 49 + ], + [ + -99, + 49 + ], + [ + -99, + 48 + ], + [ + -100, + 48 + ] + ] + ], + [ + [ + [ + -100, + 50 + ], + [ + -100, + 51 + ], + [ + -99, + 51 + ], + [ + -99, + 50 + ], + [ + -100, + 50 + ] + ] + ] + ], + "type": "MultiPolygon" + } + } + ] + } + } + }, + "layers": [ + { + "id": "all", + "type": "symbol", + "source": "geojson", + "layout": { + "text-field": [ + "geometry-type" + ] + } + }, + { + "id": "all-lines", + "type": "line", + "source": "geojson" + }, + { + "id": "circle1", + "type": "circle", + "source": "geojson", + "filter": [ + "==", + [ + "geometry-type" + ], + "Point" + ], + "paint": { + "circle-color": "black" + } + }, + { + "id": "circle2", + "type": "circle", + "source": "geojson", + "filter": [ + "==", + [ + "geometry-type" + ], + "MultiPoint" + ], + "paint": { + "circle-color": "red" + } + }, + { + "id": "circle3", + "type": "circle", + "source": "geojson", + "filter": [ + "==", + [ + "geometry-type" + ], + "LineString" + ], + "paint": { + "circle-color": "green" + } + }, + { + "id": "circle4", + "type": "circle", + "source": "geojson", + "filter": [ + "==", + [ + "geometry-type" + ], + "MultiLineString" + ], + "paint": { + "circle-color": "blue" + } + }, + { + "id": "circle5", + "type": "circle", + "source": "geojson", + "filter": [ + "==", + [ + "geometry-type" + ], + "Polygon" + ], + "paint": { + "circle-color": "yellow" + } + }, + { + "id": "circle6", + "type": "circle", + "source": "geojson", + "filter": [ + "==", + [ + "geometry-type" + ], + "MultiPolygon" + ], + "paint": { + "circle-color": "orange" + } + } + ] + } \ No newline at end of file