Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GeoJSON layers not behaving as expected when using ["geometry-type"] #5103

Open
dschep opened this issue Nov 24, 2024 · 1 comment
Open

GeoJSON layers not behaving as expected when using ["geometry-type"] #5103

dschep opened this issue Nov 24, 2024 · 1 comment
Labels
need more info Further information is requested

Comments

@dschep
Copy link
Contributor

dschep commented Nov 24, 2024

When looking into the impact of maplibre/maplibre-style-spec#519 on Ultra which makes heavy use of GeoJSON sources, I discovered that geojson-vt transforms all single geometry types into multis. This manifests as a bug in MapLibre GL JS.

maplibre-gl-js version: v5 & v4, probably all?

browser: All

Steps to Trigger Behavior

  1. Make a GeoJSON source containing MultiPoints and Points (applicable to [Multi]LineString and [Multi]Polygon geometries too)
  2. Add a layer using ["geometry-type"] to style Points and MultiPoints differently
  3. In v4 all [Multi]Points are rendered as points and in v5 all re rendered as MultiPoints

Link to Demonstration

Expected Behavior

Image

Actual Behavior

v4

Image

v5

Image

@HarelM
Copy link
Collaborator

HarelM commented Nov 24, 2024

I've checked this locally, I'm still struggling with multipolygon, but otherwise the rest of the stuff looks good.
Note that it looks like geojson-vt is flattening the multi stuff in case they are not needed (probably to improve performance).
If your multi point is more than one point, it should work, I don't know how to categorize this honestly...
See here:
https://jsbin.com/vuguyuvili/2/edit?html,output

@HarelM HarelM added the need more info Further information is requested label Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need more info Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants