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

MapLibre GL JS v5.0.0 does not work with MapLibre GL Leaflet #64

Open
olivier3lanc opened this issue Jan 2, 2025 · 4 comments
Open

Comments

@olivier3lanc
Copy link

MapLibre GL JS v5.0.0 does not work with MapLibre GL Leaflet
https://plnkr.co/plunk/4iSagBIN38qRjpRT

Expected behavior
Dragging the map runs smoothly

Observed behavior
Impossible to drag

Kapture.2025-01-02.at.08.55.05.mp4

Quick fix rolling back to previous stable version
MapLibre GL JS v4.7.1 works fine with Leaflet
https://plnkr.co/plunk/aUOgRVH7nc248m1d

@gavinr-maps
Copy link

gavinr-maps commented Jan 2, 2025

Here is a simpler, front-end only replication case:

@ianthetechie
Copy link
Contributor

Can confirm the same behavior (tested on 5.0.1 rather than 5.0.0). Here's a similar (mostly minimal) reproducible example in JSFiddle: https://jsfiddle.net/fzr8dtsp/1/

@gavinr-maps
Copy link

I've looked into this, and I think the issue is happening on pan where the code in this Leaflet plugin is calling .resize() after setting the transform here:

this._transformGL(gl);
if (gl.transform.width !== size.x || gl.transform.height !== size.y) {
container.style.width = size.x + 'px';
container.style.height = size.y + 'px';
if (gl._resize !== null && gl._resize !== undefined){
gl._resize();
} else {
gl.resize();

I have logged an issue with Maplibre GL JS here: maplibre/maplibre-gl-js#5344.

@gavinr-maps
Copy link

Proposal to fix this is here: #66

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants