Git Product home page Git Product logo

Comments (4)

ahocevar avatar ahocevar commented on May 27, 2024 1

I also don't do a source.on('change') in my project.

That's triggered internally to notify the layer of the changes.

from openlayers.

ahocevar avatar ahocevar commented on May 27, 2024

If you have a vector source with a lot of changes, you might want to consider using the useSpatialIndex: false option on the source.

The demo in your code pen does not replicate the actual behavior, because when the source change event is triggered, a requestAnimationFrame is triggered to re-render, but not every change event will cause a re-render. These changes are usually grouped into a single re-render.

from openlayers.

ger-benjamin avatar ger-benjamin commented on May 27, 2024

Hi @ahocevar ,

My demo don't represent the complexity of my project, it just tries to demonstrate a problem. Still I have added useSpatialIndex: false, but that's not really relevant for this demo.

I also don't do a source.on('change') in my project. Still, if I remove 3000 features at once, it took me more than 2s. Using the same override as in the demo allows me to avoid this issue. I'll try to dig further in my project to find why I've this issue. But even if I fix it, I probably will keep this silent option. Having it directly in Ol would be appreciated. Calling N times source.changed for N features is probably not a nice thing to do. And in my dummy demo, we effectively have 5000 changes.

from openlayers.

ger-benjamin avatar ger-benjamin commented on May 27, 2024

Closed and done with #15643

from openlayers.

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.