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

Fixed mapbox-fl rendering when panning the map when the container is in percent #155

Merged
merged 1 commit into from
Jun 5, 2023

Conversation

denisones
Copy link
Contributor

Fix this issues #145
Example https://codepen.io/oranoran/pen/MWvWNmM
The bug occurs when the map container is set as a percent.
https://github.com/mapbox/mapbox-gl-leaflet/blob/master/leaflet-mapbox-gl.js#L176 - the values have different precision after the decimal point when compared, and resize is called incorrectly, not update

@croxton
Copy link

croxton commented May 14, 2023

Ran into this too and I can confirm this PR resolves the issue completely.

@weca-theo
Copy link

I also encountered this issue using Leaflet (1.9.4) + leaflet-mapbox-gl.js (latest CDN). The issue was most visible when panning in a diagonal direction. I then found this fix, downloaded the js manually from https://github.com/denisones/mapbox-gl-leaflet/blob/c228579c21e4d8a6504c6f4ab767764bd57e61a6/leaflet-mapbox-gl.js
and linked my html to this. It now seems to be working fine, thanks to @denisones . What is needed next to close this issue and accept this PR?

Note: to use the example posted above in OP, you'll need to try a new basemap in the js, as the current one is 404 not found. Remember to pan diagonally if you're struggling to replicate the bug in there. I also found it helped to re-size the code pane at the top- drag it up to make it smaller, then start panning on the map. You should see the issue.

@jgravois
Copy link
Collaborator

jgravois commented Jun 5, 2023

thanks all. i'll try and find time to release this on npm in the next few days.

@weca-theo
Copy link

weca-theo commented Jun 5, 2023

thanks all. i'll try and find time to release this on npm in the next few days.

awesome. Can we get the unpkg CDN file updated too? It currently points to v0.0.15
Thanks.

@jgravois
Copy link
Collaborator

jgravois commented Jun 6, 2023

Can we get the unpkg CDN file updated too?

that will happen automatically. unpkg is an npm mirror.

vcoppe added a commit to gpxstudio/gpxstudio.github.io that referenced this pull request Jan 25, 2024
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

Successfully merging this pull request may close these issues.

4 participants