Skip to content

Releases: openlayers/openlayers

v3.18.0

26 Aug 16:05
Compare
Choose a tag to compare

Summary

The v3.18.0 release includes features and fixes from almost 120 pull requests since the v3.17.1 release. Most of the changes are bug fixes and continuing removal of the dependency on Closure Library. New features include:

  • Addition of Intersects and Within filters to ol.format.ogc.filter #5668
  • New overlaps option for ol.source.Vector and ol.source.VectorTile to improve rendering performance for polygon topologies #5196
  • New rotateWithView option for ol.style.Text to control appearance of text on rotated views #5050
  • Add a #scale() method to ol.geom.Geometry and subclasses #5685
  • Parse id of features in ol.format.MVT #5613

Upgrade notes

Changes in the way assertions are handled

Previously, minified builds of the library did not have any assertions. This caused applications to fail silently or with cryptic stack traces. Starting with this release, developers get notified of many runtime errors through the new ol.AssertionError. This error has a code property. The meaning of the code can be found on http://openlayers.org/en/latest/doc/errors/. There are additional console assertion checks in debug mode when the goog.DEBUG compiler flag is true. As this is true by default, it is recommended that those creating custom builds set this to false so these assertions are stripped.'

Removal of ol.ENABLE_NAMED_COLORS

This option was previously needed to use named colors with the WebGL renderer but is no longer needed.

KML format now uses URL()

The URL constructor is supported by all modern browsers, but not by older ones, such as IE. To use the KML format in such older browsers, a URL polyfill will have to be loaded before use.

Changes only relevant to those who compile their applications together with the Closure Compiler

A number of internal types have been renamed. This will not affect those who use the API provided by the library, but if you are compiling your application together with OpenLayers and using type names, you'll need to do the following:

  • rename ol.CollectionEventType to ol.Collection.EventType
  • rename ol.CollectionEvent to ol.Collection.Event
  • rename ol.ViewHint to ol.View.Hint
  • rename ol.ViewProperty to ol.View.Property
  • rename ol.render.webgl.imagereplay.shader.Default.Locations to ol.render.webgl.imagereplay.defaultshader.Locations
  • rename ol.render.webgl.imagereplay.shader.DefaultFragment to ol.render.webgl.imagereplay.defaultshader.Fragment
  • rename ol.render.webgl.imagereplay.shader.DefaultVertex to ol.render.webgl.imagereplay.defaultshader.Vertex
  • rename ol.renderer.webgl.map.shader.Default.Locations to ol.renderer.webgl.defaultmapshader.Locations
  • rename ol.renderer.webgl.map.shader.Default.Locations to ol.renderer.webgl.defaultmapshader.Locations
  • rename ol.renderer.webgl.map.shader.DefaultFragment to ol.renderer.webgl.defaultmapshader.Fragment
  • rename ol.renderer.webgl.map.shader.DefaultVertex to ol.renderer.webgl.defaultmapshader.Vertex
  • rename ol.renderer.webgl.tilelayer.shader.Fragment to ol.renderer.webgl.tilelayershader.Fragment
  • rename ol.renderer.webgl.tilelayer.shader.Locations to ol.renderer.webgl.tilelayershader.Locations
  • rename ol.renderer.webgl.tilelayer.shader.Vertex to ol.renderer.webgl.tilelayershader.Vertex
  • rename ol.webgl.WebGLContextEventType to ol.webgl.ContextEventType
  • rename ol.webgl.shader.Fragment to ol.webgl.Fragment
  • rename ol.webgl.shader.Vertex to ol.webgl.Vertex

Full list of changes

Read more

v3.17.1

04 Jul 08:28
Compare
Choose a tag to compare

Summary

The v3.17.1 release is a patch release that addresses a regression in the v3.17.0 release. See the v3.17.0 release notes for details on upgrading from v3.16.

Fixes

v3.17.0

01 Jul 18:20
Compare
Choose a tag to compare

Summary

The v3.17.0 release includes features and fixes from 60 pull requests since the v3.16.0 release. Most of the changes are bug fixes and continuing removal of the dependency on Closure Library.

Upgrade notes

ol.source.MapQuest removal

Because of changes at MapQuest (see: https://lists.openstreetmap.org/pipermail/talk/2016-June/076106.html) we had to remove the MapQuest source for now (see #5484 for details).

ol.interaction.ModifyEvent changes

The event object previously had a mapBrowserPointerEvent property, which has been renamed to mapBrowserEvent.

Removal of ol.raster namespace

Users compiling their code with the library and using types in the ol.raster namespace should note that this has now been removed. ol.raster.Pixel has been deleted, and the other types have been renamed as follows, and your code may need changing if you use these:

  • ol.raster.Operation to ol.RasterOperation
  • ol.raster.OperationType to ol.RasterOperationType

All typedefs now in ol namespace

Users compiling their code with the library should note that the following typedefs have been renamed; your code may need changing if you use these:

  • ol.events.ConditionType to ol.EventsConditionType
  • ol.events.EventTargetLike to ol.EventTargetLike
  • ol.events.Key to ol.EventsKey
  • ol.events.ListenerFunctionType to ol.EventsListenerFunctionType
  • ol.interaction.DragBoxEndConditionType to ol.DragBoxEndConditionType
  • ol.interaction.DrawGeometryFunctionType to ol.DrawGeometryFunctionType
  • ol.interaction.SegmentDataType to ol.ModifySegmentDataType
  • ol.interaction.SelectFilterFunction to ol.SelectFilterFunction
  • ol.interaction.SnapResultType to ol.SnapResultType
  • ol.interaction.SnapSegmentDataType to ol.SnapSegmentDataType
  • ol.proj.ProjectionLike to ol.ProjectionLike
  • ol.style.AtlasBlock to ol.AtlasBlock
  • ol.style.AtlasInfo to ol.AtlasInfo
  • ol.style.AtlasManagerInfo to ol.AtlasManagerInfo
  • ol.style.CircleRenderOptions to ol.CircleRenderOptions
  • ol.style.ImageOptions to ol.StyleImageOptions
  • ol.style.GeometryFunction to ol.StyleGeometryFunction
  • ol.style.RegularShapeRenderOptions to ol.RegularShapeRenderOptions
  • ol.style.StyleFunction to ol.StyleFunction

Full list of changes

Read more

v3.16.0

23 May 19:11
Compare
Choose a tag to compare

Summary

The v3.16.0 release includes features and fixes from 95 pull requests since the v3.15.1 release. New features and improvements include:

  • Add ol.source.ImageArcGISRest for ArcGIS REST image layer support (#3880)
  • New finishCondition option for ol.interaction.Draw to control which action should finish a geometry when drawing (#5261)
  • New filter API for ol.format.WFS#writeGetFeature for WFS queries with OGC filters (#5252)
  • New renderMode option for ol.layer.VectorTile to balance between rendering performance and rendering quality (#5177)
  • More flexibility for configuring attribution logos by allowing HTML elements (#5274)
  • UTFGrid updates, now supporting Mapbox API v4 (#5329)
  • New condition option for ol.interaction.Modify for better reliability when combining with other interactions (#5320)

In addition to these new features, the code base has been simplified and refactored in the process of removing the dependency on Closure Library and Compiler.

Upgrade notes

Rendering change for tile sources

Previously, if you called source.setUrl() on a tile source, all currently rendered tiles would be cleared before new tiles were loaded and rendered. This clearing of the map is undesirable if you are trying to smoothly update the tiles used by a source. This behavior has now changed, and calling source.setUrl() (or source.setUrls()) will not clear currently rendered tiles before loading and rendering new tiles. Instead, previously rendered tiles remain rendered until new tiles have loaded and can replace them. If you want to achieve the old behavior (render a blank map before loading new tiles), you can call source.refresh() or you can replace the old source with a new one (using layer.setSource()).

Move of typedefs out of code and into separate file

This change should not affect the great majority of application developers, but it's possible there are edge cases when compiling application code together with the library which cause compiler errors or warnings. In this case, please raise a GitHub issue. goog.requires for typedefs should not be necessary.
Users compiling their code with the library should note that the following API @typedefs have been renamed; your code may need changing if you use these:

  • ol.format.WFS.FeatureCollectionMetadata to ol.WFSFeatureCollectionMetadata
  • ol.format.WFS.TransactionResponse to ol.WFSTransactionResponse

Removal of opaque option for ol.source.VectorTile

This option is no longer needed, so it was removed from the API.

XHR loading for ol.source.TileUTFGrid

The ol.source.TileUTFGrid now uses XMLHttpRequest to load UTFGrid tiles by default. This works out of the box with the v4 Mapbox API. To work with the v3 API, you must use the new jsonp option on the source. See the examples below for detail.

// To work with the v4 API
var v4source = new ol.source.TileUTFGrid({
  url: 'https://api.tiles.mapbox.com/v4/example.json?access_token=' + YOUR_KEY_HERE
});

// To work with the v3 API
var v3source = new ol.source.TileUTFGrid({
  jsonp: true, // <--- this is required for v3
  url: 'http://api.tiles.mapbox.com/v3/example.json'
});

Full list of changes

Read more

v3.15.1

07 Apr 15:00
Compare
Choose a tag to compare

v3.15.1

Summary

The v3.15.1 release is a patch release that addresses a regression in the v3.15.0 release. See the v3.15.0 release notes for details on upgrading from v3.14.x.

Fixes

  • #5190 - Revert "Batch polygon fill and stroke instructions" (@ahocevar)

v3.15.0

04 Apr 09:13
Compare
Choose a tag to compare

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

Internet Explorer 9 support

As of this release, OpenLayers requires a classList polyfill for IE 9 support. See http://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

Read more

v3.14.2

04 Mar 09:22
Compare
Choose a tag to compare

Summary

The v3.14.2 release is a patch release that addresses a few regressions in the v3.14.1 release. See the v3.14.0 release notes for details on upgrading from v3.13.x.

Fixes

v3.14.1

01 Mar 09:30
Compare
Choose a tag to compare

Summary

The v3.14.1 release is a patch release that addresses a few regressions in the v3.14.0 release. See the v3.14.0 release notes for details on upgrading from v3.13.x.

Fixes

  • #4939 - Fix rendering of opaque layers with opacity != 1 (@ahocevar)
  • #4921 - Unlisten before calling listener and bind to target by default (@ahocevar)

v3.14.0

24 Feb 09:13
Compare
Choose a tag to compare

Summary

The v3.14.0 release includes features and fixes from 93 pull requests since the v3.13.1 release. New features and improvements include:

  • New source option for the ol.control.FullScreen, to allow including other elements besides the map in a full screen view (#4679).
  • New target property for the Drag&Drop interaction allows using a different drop target than the map viewport (#4876).
  • ol.style.RegularShape has a new rotateWithView option, for controlling how regular shape symbols are rendered on rotated views (#4698).
  • New layers option for ol.format.WMSGetFeatureInfo format, to selectively only read features from specific layers (#4700).
  • New precision parameter for formatting coordinates with ol.coordinate.toStringHDMS (#4787).
  • Smarter tile queue for improved tile loading user experience when more than one tile layer is used (#4794).
  • Improved rendering performance for tile layers by rendering tiles directly to the map canvas (#4597).
  • The goog.events event system was replaced with our own lightweight event system. This significally reduces the build size (#4711). Replacement of other goog.* components with ES5 features or custom code marks a huge step towards the complete removal of the Closure Library dependency.

Upgrade notes

Internet Explorer 9 support

As of this release, OpenLayers requires a requestAnimationFrame/cancelAnimationFrame polyfill for IE 9 support. See http://cdn.polyfill.io/v2/docs/features/#requestAnimationFrame.

Layer pre-/postcompose event changes

It is the responsibility of the application to undo any canvas transform changes at the end of a layer 'precompose' or 'postcompose' handler. Previously, it was ok to set a null transform. The API now guarantees a device pixel coordinate system on the canvas with its origin in the top left corner of the map. However, applications should not rely on the underlying canvas being the same size as the visible viewport.

Old code:

layer.on('precompose', function(e) {
  // rely on canvas dimensions to move coordinate origin to center
  e.context.translate(e.context.canvas.width / 2, e.context.canvas.height / 2);
  e.context.scale(3, 3);
  // draw an x in the center of the viewport
  e.context.moveTo(-20, -20);
  e.context.lineTo(20, 20);
  e.context.moveTo(-20, 20);
  e.context.lineTo(20, -20);
  // rely on the canvas having a null transform
  e.context.setTransform(1, 0, 0, 1, 0, 0);
});

New code:

layer.on('precompose', function(e) {
  // use map size and pixel ratio to move coordinate origin to center
  var size = map.getSize();
  var pixelRatio = e.frameState.pixelRatio;
  e.context.translate(size[0] / 2 * pixelRatio, size[1] / 2 * pixelRatio);
  e.context.scale(3, 3);
  // draw an x in the center of the viewport
  e.context.moveTo(-20, -20);
  e.context.lineTo(20, 20);
  e.context.moveTo(-20, 20);
  e.context.lineTo(20, -20);
  // undo all transforms
  e.context.scale(1 / 3, 1 / 3);
  e.context.translate(-size[0] / 2 * pixelRatio, -size[1] / 2 * pixelRatio);
});

Full list of changes

Read more

v3.13.1

04 Feb 07:34
Compare
Choose a tag to compare

Summary

The v3.13.1 release is a patch release that addresses a few regressions in the v3.13.0 release. See the v3.13.0 release notes for details on upgrading from v3.12.

Fixes