changelog/v3.15.0.md
The v3.15.0 release includes features and fixes from 136 pull requests since the v3.14.2 release. New features and improvements include:
As of this release, OpenLayers requires a classList polyfill for IE 9 support. See https://cdn.polyfill.io/v2/docs/features#Element_prototype_classList.
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:
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:
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.
ol.DEFAULT_TILE_CACHE_HIGH_WATER_MARKThe 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.