Download Latest Version v10.7.0 source code.tar.gz (25.7 MB)
Email in envelope

Get an email when there's a new version of OpenLayers

Home / v10.4.0
Name Modified Size InfoDownloads / Week
Parent folder
v10.4.0-package.zip 2025-01-29 2.9 MB
v10.4.0-site.zip 2025-01-29 18.4 MB
README.md 2025-01-29 14.5 kB
v10.4.0 source code.tar.gz 2025-01-29 24.8 MB
v10.4.0 source code.zip 2025-01-29 25.8 MB
Totals: 5 Items   71.8 MB 0

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.

:::js
// 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.

:::diff
-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.

:::js
// 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

New Contributors

Full Changelog: https://github.com/openlayers/openlayers/compare/v10.3.1...v10.4.0

Source: README.md, updated 2025-01-29