Skip to content

Releases: openlayers/openlayers

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

v3.13.0

20 Jan 14:41
Compare
Choose a tag to compare

v3.13.0

Summary

The v3.13.0 release includes features and fixes from 68 pull requests since the v3.12.1 release. New features and improvements include:

  • Improved tiles rendering for the canvas renderer
  • Improved MapQuest rendering
  • Add color option to ol.style.Icon
  • Load TileJSON sources via XMLHttpRequest by default
  • Add new ol.geom.LineString#getCoordinateAt function
  • Simplify meters per unit handling
  • Use ESLint as a replacement for gjslint.py and jshint

Upgrade notes

proj4js integration

Before this release, OpenLayers depended on the global proj4 namespace. When using a module loader like Browserify, you might not want to depend on the global proj4 namespace. You can use the ol.proj.setProj4 function to set the proj4 function object. For example in a browserify ES6 environment:

import ol from 'openlayers';
import proj4 from 'proj4';
ol.proj.setProj4(proj4);

ol.source.TileJSON changes

The ol.source.TileJSON now uses XMLHttpRequest to load the TileJSON instead of JSONP with callback.
When using server without proper CORS support, jsonp: true option can be passed to the constructor to get the same behavior as before:

new ol.source.TileJSON({
  url: 'http://serverwithoutcors.com/tilejson.json',
  jsonp: true
})

Also for Mapbox v3, make sure you use urls ending with .json (which are able to handle both XMLHttpRequest and JSONP) instead of .jsonp.

Full list of changes

Read more

v3.12.1

17 Dec 15:38
Compare
Choose a tag to compare

v3.12.1

Summary

The v3.12.1 release is a patch release that addresses a few regressions in the v3.12.0 release. See the v3.12.0 release notes for details on upgrading from v3.11.

Fixes

v3.12.0

15 Dec 10:59
Compare
Choose a tag to compare

v3.12.0

Summary

The v3.12.0 release includes features and fixes from 71 pull requests since the v3.11.2 release. New features and improvements include:

  • Tile coordinate wrapping for raster reprojection.
  • Support for multi-line labels.
  • Allow rendering geometries to an arbitrary canvas (useful for vector legends).

Upgrade notes

ol.Map#forEachFeatureAtPixel changes

The optional layerFilter function is now also called for unmanaged layers. To get the same behaviour as before, wrap your layer filter code in an if block like this:

function layerFilter(layer) {
  if (map.getLayers().getArray().indexOf(layer) !== -1) {
    // existing layer filter code
  }
}

Full list of changes

Read more

v3.11.2

19 Nov 20:07
Compare
Choose a tag to compare

Summary

The v3.11.2 release is a patch release that addresses a few regressions in the v3.11.1 release. See the v3.11.0 release notes for details on upgrading from v3.10.

Fixes

v3.11.1

12 Nov 23:52
Compare
Choose a tag to compare

Summary

The v3.11.1 release is a patch release that addresses a few regressions in the v3.11.0 release. See the v3.11.0 release notes for details on upgrading from v3.10.

Fixes

v3.11.0

11 Nov 22:34
Compare
Choose a tag to compare

Summary

The v3.11.0 release includes features and fixes from 73 pull requests since the v3.10.1 release. New features and improvements include:

  • Support for raster reprojection - load raster sources in one projection and view them in another.
  • Support for Mapbox Vector Tiles!
  • Improved KML support, GeoJSON & TopoJSON fixes, and much more. See below for the full list.

Upgrade notes

ol.format.KML changes

KML icons are scaled 50% so that the rendering better matches Google Earth rendering.

If a KML placemark has a name and is a point, an ol.style.Text is created with the name displayed to the right of the icon (if there is an icon).
This can be controlled with the showPointNames option which defaults to true.

To disable rendering of the point names for placemarks, use the option:
new ol.format.KML({ showPointNames: false });

ol.interaction.DragBox and ol.interaction.DragZoom changes

Styling is no longer done with ol.Style, but with pure CSS. The style constructor option is no longer required, and no longer available. Instead, there is a className option for the CSS selector. The default for ol.interaction.DragBox is ol-dragbox, and ol.interaction.DragZoom uses ol-dragzoom. If you previously had

new ol.interaction.DragZoom({
  style: new ol.style.Style({
    stroke: new ol.style.Stroke({
      color: 'red',
      width: 3
    }),
    fill: new ol.style.Fill({
      color: [255, 255, 255, 0.4]
    })
  })
});

you'll now just need

new ol.interaction.DragZoom();

but with additional css:

.ol-dragzoom {
  border-color: red;
  border-width: 3px;
  background-color: rgba(255,255,255,0.4);
}

Removal of ol.source.TileVector

With the introduction of true vector tile support, ol.source.TileVector becomes obsolete. Change your code to use ol.layer.VectorTile and ol.source.VectorTile instead of ol.layer.Vector and ol.source.TileVector.

ol.Map#forEachFeatureAtPixel changes for unmanaged layers

ol.Map#forEachFeatureAtPixel will still be called for unmanaged layers, but the 2nd argument to the callback function will be null instead of a reference to the unmanaged layer. This brings back the behavior of the abandoned ol.FeatureOverlay that was replaced by unmanaged layers.

If you are affected by this change, please change your unmanaged layer to a regular layer by using e.g. ol.Map#addLayer instead of ol.layer.Layer#setMap.

Full list of changes

Read more