Giter Site home page Giter Site logo

Comments (3)

krawaller avatar krawaller commented on May 21, 2024

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.

from leaflet.

mourner avatar mourner commented on May 21, 2024

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!

from leaflet.

mourner avatar mourner commented on May 21, 2024

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

from leaflet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.