maplibre-gl-js
maplibre-gl-js copied to clipboard
fill-extrusion breaking change between v1 and v2
Interleaving with deck.gl custom layers (depth occlusion) broke between 1.15.3 and 2.0.0. For reference the feature works with mapbox-gl v1 and v2.
Expected:
Actual:
See demo at: https://codepen.io/Pessimistress/pen/ExEoQXL
maplibre-gl-js version: 1.15.3, 2.0.0, latest
Question
The custom layer example works so the change either happened to near/far plane calculation (deck.gl calculates its own matrices) or depth-buffer related GL parameters.
I am unable to find any documentation about this change. The breaking commit is 20k lines so would appreciate some pointers :)
The typescript migration is mainly cosmetic and there shouldn't be major changes there, but it was a big change and this does issue is basically saying there was a breaking change. If you know how this extrusion works I would advise to try and look there as I have little knowledge in that aspect unfortunately. Your help in knowledge in deck.gl might also help here. If you could create a simpler example maybe it will be easier to debug the changes in the code flow.
Ok so this turns out to be something unrelated to the painter.
deck.gl relies on map.version to handle differences in matrix calculation between mapbox versions: https://github.com/visgl/deck.gl/blob/993613c74347f9da419b58c80030576e73919eed/modules/mapbox/src/deck-utils.js#L145-L151
This property is removed in 2.0.0. https://github.com/maplibre/maplibre-gl-js/blob/v1.15.3/src/ui/map.js#L2748
While I can handle this on our side, since my libs support both mapbox v1, mapbox v2 and maplibre, I frequently find myself in the position where I need to detect the library in use. Mapbox exposes the version number at root (import {version} from 'mapbox-gl') as well as on the Map instance (map.version). Both seem to be gone in maplibre 2.0.
Ahh, yes, I removed it since there was a problem referencing the package.json file in the typescript migration. I think I noted that in the release notes... Not sure what the solution my be for this issue though.
I understand that the removal is intended. If you can agree that exposing the version identifier is still useful, I can open a PR to inject the version number via rollup config.
I have no objection to bring back the version if it doesn't break anything. Feel free to create a PR :-)
We can make typescript behave like this #1471
I believe 2.3.0 have the necessary changes to move forward with this.
@birkskyum Thank you!