Skip to content

Latest commit

 

History

History
204 lines (184 loc) · 22.8 KB

v3.15.0.md

File metadata and controls

204 lines (184 loc) · 22.8 KB

v3.15.0

Summary

The v3.15.0 release includes features and fixes from 136 pull requests since the v3.14.2 release. New features and improvements include:

  • Make ol.source.Cluster more flexible by adding a geometryFunction option (#4917).
  • Add new CartoDB tile source (#4926).
  • Improved rendering performance for vector layers by batching polygon fill and stroke instructions (#5149).
  • Make the tile cache size configurable (#4805).
  • Add new ol.geom.Geometry#rotate function (#4984).
  • Accept simpler forms of specifying attribution(s) for sources (#5007).
  • Support zooming out for ol.interaction.DragZoom (#5031).

Upgrade notes

v3.15.0

Internet Explorer 9 support

As of this release, OpenLayers requires a classList polyfill for IE 9 support. See https://cdn.polyfill.io/v2/docs/features#Element_prototype_classList.

Immediate rendering API

Listeners for precompose, render, and postcompose receive an event with a vectorContext property with methods for immediate vector rendering. The previous geometry drawing methods have been replaced with a single vectorContext.drawGeometry(geometry) method. If you were using any of the following experimental methods on the vector context, replace them with drawGeometry:

  • Removed experimental geometry drawing methods: drawPointGeometry, drawLineStringGeometry, drawPolygonGeometry, drawMultiPointGeometry, drawMultiLineStringGeometry, drawMultiPolygonGeometry, and drawCircleGeometry (all have been replaced with drawGeometry).

In addition, the previous methods for setting style parts have been replaced with a single vectorContext.setStyle(style) method. If you were using any of the following experimental methods on the vector context, replace them with setStyle:

  • Removed experimental style setting methods: setFillStrokeStyle, setImageStyle, setTextStyle (all have been replaced with setStyle).

Below is an example of how the vector context might have been used in the past:

// OLD WAY, NO LONGER SUPPORTED
map.on('postcompose', function(event) {
  event.vectorContext.setFillStrokeStyle(style.getFill(), style.getStroke());
  event.vectorContext.drawPointGeometry(geometry);
});

Here is an example of how you could accomplish the same with the new methods:

// NEW WAY, USE THIS INSTEAD OF THE CODE ABOVE
map.on('postcompose', function(event) {
  event.vectorContext.setStyle(style);
  event.vectorContext.drawGeometry(geometry);
});

A final change to the immediate rendering API is that vectorContext.drawFeature() calls are now "immediate" as well. The drawing now occurs synchronously. This means that any zIndex in a style passed to drawFeature() will be ignored. To achieve zIndex ordering, order your calls to drawFeature() instead.

Removal of ol.DEFAULT_TILE_CACHE_HIGH_WATER_MARK

The ol.DEFAULT_TILE_CACHE_HIGH_WATER_MARK define has been removed. The size of the cache can now be defined on every tile based ol.source:

new ol.layer.Tile({
  source: new ol.source.OSM({
    cacheSize: 128
  })
})

The default cache size is 2048.

Full list of changes