Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

[Snyk] Upgrade ol from 10.2.1 to 10.4.0#5

Open
iAziz786 wants to merge 1 commit intofeature/react-pdffrom
snyk-upgrade-6cd73a4ebad5250943a2438112345bdf
Open

[Snyk] Upgrade ol from 10.2.1 to 10.4.0#5
iAziz786 wants to merge 1 commit intofeature/react-pdffrom
snyk-upgrade-6cd73a4ebad5250943a2438112345bdf

Conversation

@iAziz786
Copy link
Copy Markdown

snyk-top-banner

Snyk has created this PR to upgrade ol from 10.2.1 to 10.4.0.

ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


  • The recommended version is 207 versions ahead of your current version.

  • The recommended version was released 2 months ago.

Release notes
Package name: ol
  • 10.4.0 - 2025-01-29

    With more than 40 pull requests, the 10.4 release brings performance improvements, bug fixes, better TypeScript generics and new features. New features include a convenience Image layer loader for debugging MapServer map files using the MapServer CGI API, and an experimental WebGLVectorTile layer.

    Upgrade notes

    Deprecation of ol/layer/WebGLPoints

    Use ol/layer/WebGLVector instead. Besides rendering points it will also render lines and polygons.
    In most cases this is a drop-in replacement. To use filtering the style and filter have to be in a nested object.

    // Before
    new WebGLPointsLayer({
    filter: ['between', ['get', 'year'], ['var', 'minYear'], ['var', 'maxYear']],
    style: {
    'circle-radius': 8,
    'circle-fill-color': 'blue',
    },
    source: vectorSource,
    })

    // After
    new WebGLVectorLayer({
    style: [{
    filter: ['between', ['get', 'year'], ['var', 'minYear'], ['var', 'maxYear']],
    style: {
    'circle-radius': 8,
    'circle-fill-color': 'blue',
    },
    }],
    source: vectorSource,
    })

    ol/style/webgl module removal

    WebGL renderers used to rely on the WebGLStyle type in the ol/style/webgl module. This is not the case anymore, all renderers now rely on FlatStyle from ol/style/flat.

    -import type { WebGLStyle } from 'ol/style/webgl';
    +import type { FlatStyle } from 'ol/style/flat';

    ol-mapbox-style compatibility

    This version of OpenLayers is only compatible with ol-mapbox-style@12.4.0 or higher.

    Returning false from a one-time listener added with once

    Returning false from the listener function will now stop propagation, when the listener is added with once.
    Previously this only worked with the on method.

    The filter option for WebGLPointsLayer has changed

    The filter option for the WebGLPointsLayer must now be specified alongside other options instead of being part of the style object. Note that the WebGLPointsLayer is not part of the stable API and is subject to breaking changes between major releases.

    // Before
    new WebGLPointsLayer({
    style: {
    filter: ['between', ['get', 'year'], ['var', 'minYear'], ['var', 'maxYear']],
    'circle-radius': 8,
    'circle-fill-color': 'blue',
    },
    source: vectorSource,
    })

    // Now
    new WebGLPointsLayer({
    filter: ['between', ['get', 'year'], ['var', 'minYear'], ['var', 'maxYear']],
    style: {
    'circle-radius': 8,
    'circle-fill-color': 'blue',
    },
    source: vectorSource,
    })

    Get ready for future changes

    We're planning to stop providing barrel files, which will impact how you import modules from OpenLayers. See #16461 for details. To get your code ready for that upcoming change, you can already help us test the replace-barrel-imports codemod from the @ openlayers/codemod package.

    List of all changes

Snyk has created this PR to upgrade ol from 10.2.1 to 10.4.0.

See this package in npm:
ol

See this project in Snyk:
https://app.snyk.io/org/vijay-sok/project/9f82fabb-f3b8-4d89-8942-766ed318361a?utm_source=github&utm_medium=referral&page=upgrade-pr
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants