Giter Site home page Giter Site logo

Comments (4)

ahocevar avatar ahocevar commented on June 3, 2024

The flat styles you're using in that examples are not yet optimized for a lot of data. Try using ol-mapbox-style. It has the advantage of supporting the same Mapbox Style JSONs that MapLibre uses. If that's not what you want, use classic styles (ol/style/Style) with style functions.

from openlayers.

fabienwnklr avatar fabienwnklr commented on June 3, 2024

thanks for answer, but i need to use conditionnal logic for style , so i try to use function (or style expressions) and if i do something like this, lag again .. codesandbox

note : if i use flat style in OL v7.5.2 no lag..

My final code using style expression is like this

from openlayers.

ahocevar avatar ahocevar commented on June 3, 2024

Your second example (with classic styles) creates a new Circle style for every call of the style function. You should cache that Circle style, or pre-create one with each color you want.

Did you also try ol-mapbox-style? That's the most convenient option, especially when you have a Mapbox/MapLibre style already, because you can use it without any changes. It also does all necessary performance optimisations.

from openlayers.

fabienwnklr avatar fabienwnklr commented on June 3, 2024

yup, i try ol-mapbox-style and it's clearly more efficiant, the only negative point that i don't have any json style, so i need to create it.

Thank's for you'r answer !

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.