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

Implemented overlay padding #97

Merged
merged 1 commit into from
Aug 7, 2019
Merged

Implemented overlay padding #97

merged 1 commit into from
Aug 7, 2019

Conversation

w8r
Copy link
Collaborator

@w8r w8r commented Aug 7, 2019

As you can see in this example, panning or zooming the map can produce very unpleasant flickering on around the canvas edges, something that is avoided in leaflet by using buffer tiles:
Screenshot 2019-08-07 00 59 05

This PR addresses that issue by introducing a relative padding around the overlay containing the mapbox canvas. The arbitrary value of the padding is 0.15, somewhat close to the value used in the leaflet vector renderers for the same purpose.

You can see the result comparison here https://bl.ocks.org/w8r/26b4f1a6ff0785a71c290d798337689a (map on the left has the padding, map on the right doesn't)

It also bumps the libraries in the examples (there was a maximum call stack exception in the basic example, rooted somewhere in the transformation update in mapbox-gl-js@0.35.x)

I also took the liberty to remove the throttle function implementation, as it has been the part of leaflet API since v1.0.0 for about 3 years now.

@w8r w8r requested a review from jgravois August 7, 2019 09:27
Copy link
Collaborator

@jgravois jgravois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work!

@w8r
Copy link
Collaborator Author

w8r commented Aug 7, 2019

@mourner @jgravois Thanks a lot guys! Then I'll release it in v0.0.8

@w8r w8r added the enhancement label Aug 7, 2019
@w8r w8r merged commit 01ea2c1 into mapbox:master Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants