Files
openlayers/changelog/v3.11.0.md
2017-01-02 23:03:03 +01:00

13 KiB

v3.11.0

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