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).
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
:
- Removed experimental geometry drawing methods:
drawPointGeometry
,drawLineStringGeometry
,drawPolygonGeometry
,drawMultiPointGeometry
,drawMultiLineStringGeometry
,drawMultiPolygonGeometry
, anddrawCircleGeometry
(all have been replaced withdrawGeometry
).
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 withsetStyle
).
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.
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
.
- #4775 - Remove goog.math.modulo and goog.math.lerp (@nicholas-l)
- #5152 - Cartodb cleanup (@fredj)
- #4804 - Use Array.isArray instead of goog.isArray (@fredj)
- #5149 - Batch polygon fill and stroke instructions (@ahocevar)
- #5159 - Update eslint to version 2.6.0 π (@openlayers)
- #5160 - Update clean-css to version 3.4.11 π (@openlayers)
- #5157 - Improve docs for measure example (@probins)
- #5155 - Fix ol.source.Zoomify tests on firefox (@fredj)
- #5086 - Get rid of goog.functions (@bjornharrtell)
- #5105 - Support minZoom in ol.source.Stamen (@fredj)
- #4926 - Add CartoDB tile source. (@aisaacs)
- #5151 - Use fs-extra as fs, remove usage of graceful-fs (@marcjansen)
- #5124 - Removed goog.dom.classlist (@nicholas-l)
- #5150 - Use fs-extra instead of wrench (@fredj)
- #5109 - Add some tests for ol.source.TileUTFGrid (@marcjansen)
- #5139 - Update closure-util to version 1.13.0 π (@openlayers)
- #5141 - Reuse dragListenerKeys_ variable in ol.control.ZoomSlider (@fredj)
- #5118 - Remove goog.dom.classlist usage (@fredj)
- #5115 - Clarify that lineDash has no effect in IE 10 and below (@marcjansen)
- #5136 - Update eslint to version 2.5.3 π (@openlayers)
- #5123 - Update coveralls to version 2.11.9 π (@openlayers)
- #5131 - Update phantomjs-prebuilt to version 2.1.7 π (@openlayers)
- #5122 - Update browser support info in intro tutorial (@probins)
- #5112 - Add decimals option to format write (@probins)
- #5120 - Add tileJSON option to ol.source.TileUTFGrid (@ahocevar)
- #5119 - Add ol.source.Raster events on API docs page (@drnextgis)
- #5116 - Improve examples pages on mobile devices a bit (@ahocevar)
- #5113 - Memory leak in ol.control.FullScreen (@AvatharDG)
- #5111 - Remove CSS filter in examples (@fredj)
- #5108 - Remove unused ol.xml.getAttributeNodeNS function (@fredj)
- #5106 - Get rid of goog.math.Vec2 (@fredj)
- #5096 - Add tests for ol.source.Zoomify (@marcjansen)
- #5102 - Fix typo in API docs (@openlayers)
- #5098 - Reintroduce log messages for relevant WebGL assertions (@bjornharrtell)
- #5094 - FAQ: answer question 4 (@probins)
- #5092 - add raster.jsdoc (@drnextgis)
- #5081 - Snap to vertices or edges (@drnextgis)
- #5090 - Update custom-builds.md (@probins)
- #5089 - Test for both transform coords should use roughlyEqual (@probins)
- #5080 - Fix geojson write GeometryCollection (@probins)
- #5088 - DEVELOPING.md: remove section on running Travis on fork (@probins)
- #5087 - assertion to check that there's a DOM node for target element (@drnextgis)
- #5069 - Update jquery to version 2.2.2 π (@openlayers)
- #5083 - Remove unnecessary lineTo calls in immediate polygon rendering (@tschaub)
- #5082 - Get rid of goog.log. (@bjornharrtell)
- #5079 - Correcting a typo in the upgrade notes (@tschaub)
- #5076 - Update phantomjs-prebuilt to version 2.1.6 π (@openlayers)
- #5077 - Make immediate API uniformly synchronous. (@tschaub)
- #5072 - Add setStyle() and drawGeometry() to the immediate rendering API. (@tschaub)
- #5074 - Do not rotate map canvas after composition (@ahocevar)
- #5071 - correct way to determine freehand mode is enabled (@drnextgis)
- #5066 - Add more getters to ol.source.Vector (@bartvde)
- #5064 - Fix inconsistency in geom docs (@probins)
- #5063 - Remove inappropriate information from API docs (@drnextgis)
- #5061 - Remove redundant required option (@drnextgis)
- #5058 - Note in docs that DOM renderer can also render vectors (@probins)
- #5056 - Note in docs that WebGL can render points (@probins)
- #5055 - Fix cruft on kml scale output (@probins)
- #5051 - Handle aborted tiles in ol.TileQueue (@fredj)
- #5049 - Supported browsers all have getComputedStyle (@marcjansen)
- #5048 - Add tests for ol.dom methods (@marcjansen)
- #5031 - support zooming out for ol.interaction.DragZoom (@drnextgis)
- #5036 - Use imgSize when provided (@ahocevar)
- #5020 - Update gaze to version 1.0.0 π (@openlayers)
- #5039 - Update fs-extra to version 0.26.6 π (@openlayers)
- #5033 - Document GPX geometry output types (@probins)
- #5024 - Resize the map canvas less aggressively (@ahocevar)
- #5000 - Remove use of goog.math.Size and goog.style.setBorderBoxSize (@fredj)
- #5027 - Clarify default value of featureProjection on geometry write (@probins)
- #5019 - Update eslint to version 2.4.0 π (@openlayers)
- #5016 - Add basic tests for ol.geom.flat.center (@marcjansen)
- #5015 - Update proj4 to version 2.3.14 π (@openlayers)
- #5013 - Fix typo in test description (@openlayers)
- #5007 - Accept simpler forms of specifying attribution(s) for sources. (@marcjansen)
- #5011 - Add missing setProjection function to ol.VectorTile API (@ahocevar)
- #5010 - Add and fix API docs for ol.events.Event stack (@ahocevar)
- #5009 - Update tutorials (@gberaudo)
- #5006 - Use the maintained slimerjs package (@ahocevar)
- #5003 - Add 'function' jsdoc tag to ol.geom.Geometry#rotate (@fredj)
- #5002 - Update eslint-config-openlayers to version 4.1.0 π (@openlayers)
- #4999 - Remove use of goog.dom.removeNode (@fredj)
- #4990 - Add new ol.source.TileJSON#getTileJSON function (@fredj)
- #4998 - Remove unused ol.Map#isDef function (@fredj)
- #4995 - Remove unused ol.color functions. (@tschaub)
- #4991 - Do not remove listeners while dispatching event (@ahocevar)
- #4984 - Add new ol.geom.Geometry#rotate function (@fredj)
- #4994 - Add alpha default value to ol.Color array form (@jonataswalker)
- #4992 - Allow configuration of the test reporter (@marcjansen)
- #4988 - Update phantomjs-prebuilt to version 2.1.5 π (@openlayers)
- #4983 - Update Bing Maps Portal url (@ahocevar)
- #4981 - Remove the viewport on map dispose (@fredj)
- #4980 - Remove unused goog.require (@fredj)
- #4977 - Add basic tests for ol.geom.flat.length methods (@marcjansen)
- #4973 - Update eslint to version 2.3.0 π (@openlayers)
- #4971 - Release v3.14.2 (@openlayers)
- #4970 - Tests for ol.Disposable. (@tschaub)
- #4967 - Add missing goog.inherits for ol.render.canvas.Immediate (@fredj)
- #4955 - Remove IE workarounds in src/ol/xml.js (@fredj)
- #4960 - Simplify clipping of lower resolution regions (@ahocevar)
- #4950 - Remove use of goog.Disposable(). (@tschaub)
- #4963 - Handle more XHR errors in the TileJSON source (@tschaub)
- #4962 - Skip tests where features are not available (@tschaub)
- #4956 - Fix Examples layout page (@jonataswalker)
- #4958 - Stop wheel events instead of DOMMouseScroll events (@fredj)
- #4947 - IE support for ol.source.Raster. (@tschaub)
- #4944 - Update resemblejs to version 2.2.0 π (@openlayers)
- #4942 - Remove unused files in examples/data/ (@fredj)
- #4805 - Add new cacheSize option to ol.source (@fredj)
- #4940 - Release v3.14.1 (@openlayers)
- #4939 - Fix rendering of opaque layers with opacity != 1 (@ahocevar)
- #4938 - Get rid of goog.dom.getFirstElementChild (@fredj)
- #4937 - Get rid of goog.json (@fredj)
- #4936 - Remove jquery from getfeatureinfo-layers example (@fredj)
- #4930 - Use ADVANCED instead of ADVANCED_OPTIMIZATIONS (@fredj)
- #4917 - Make ol.source.Cluster more flexible by adding a geometryFunction option (@ahocevar)
- #4918 - Don't change the canvas size to clear it (@fredj)
- #4923 - Update custom-builds.md (@xlhomme)
- #4929 - Update clean-css to version 3.4.10 π (@openlayers)
- #4928 - Upgrade to JSTS 1.0.2 in example (@bjornharrtell)
- #4927 - Upgrade JSTS in example. (@bjornharrtell)
- #4809 - Fix multipolygon clone. (@fperucic)
- #4924 - Update coveralls to version 2.11.8 π (@openlayers)
- #4921 - Unlisten before calling listener and bind to target by default (@ahocevar)
- #4868 - Allow to refresh a source and reload its data. (@sebasbaumh)
- #4903 - Remove use of goog.style.getRelativePosition (@fredj)
- #4902 - Remove use of goog.style.getClientPosition (@fredj)
- #4916 - Fix ol.format.GeoJSON#writeFeatureObject return type (@fredj)
- #4909 - Add ol.renderer.dom.VectorLayer#clearFrame (@fredj)
- #4915 - Use {} instead of Object (@fredj)
- #4914 - Export ol.proj.equivalent (@sebasbaumh)
- #4908 - Remove use of goog.math.Rect (@fredj)
- #4900 - Make ol.format.XML a @struct (@fredj)
- #4880 - Update closure-util to version 1.11.0 π (@openlayers)
- #4905 - Remove use of goog.style.setPosition (@fredj)
- #4879 - Update metalsmith-layouts to version 1.6.4 π (@openlayers)
- #4901 - Release v3.14.0 (@openlayers)
- #4899 - Use ol.format.GMLBase#srsName instead of undeclared srsName_ (@fredj)