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

Flickering of vector layers on drag end under mobile WebKit #18

Closed
mourner opened this issue Apr 8, 2011 · 3 comments
Closed

Flickering of vector layers on drag end under mobile WebKit #18

mourner opened this issue Apr 8, 2011 · 3 comments
Assignees
Milestone

Comments

@mourner
Copy link
Member

mourner commented Apr 8, 2011

No description provided.

@ghost ghost assigned mourner Apr 10, 2011
@krawaller
Copy link

I noticed that this still happens on iOS 5.0 and 5.1, for example in the Quick Start example

From what I can tell, it happens whenever the longest side of the SVG element is larger than 1280px. Since the standard clip padding for paths is 0.5, this happens as soon as any side of the map is larger than 640px. To alleviate this in my fullscreen iPad map, I now set the following before creating the map:

L.Path.CLIP_PADDING = Math.max(0, Math.min(0.5, (1280 / Math.max(innerWidth, innerHeight) - 1) / 2));

This sets the clip padding to 0.125 on the iPad, meaning that the largest SVG we'll get is 1024*1.25 = 1280.

Not sure what the best way to handle this is for Leaflet, but for now I hope this information and quick fix can be of help for people stumbling on the same flickering as I did.

@mourner
Copy link
Member Author

mourner commented Mar 29, 2012

Wow, that's a really smart observation, I had no idea that the bug depends on the SVG element size! I'll test it out myself, and will be really glad if it's confirmed. Thanks a lot!

@mourner
Copy link
Member Author

mourner commented Jul 16, 2012

Sorry for being slow on this, incorporated your fix into master. :)

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

No branches or pull requests

2 participants