Releases: openlayers/openlayers
6.0.1
Hot on the heels of the 6.0 release, this patch release includes a few fixes for existing functionality. There should be nothing special needed to upgrade an application from 6.0.0 to 6.0.1. See the 6.0.0 release notes for details on upgrading from an older version.
Changes
- #10060 - Ensure zoom level is not less than minimum integer zoom level for extent (@mike-000)
- #10045 - Make the immediate API work with a user projection (@tschaub)
- #10068 - Update jsdoc-plugin-typescript to 2.0.3 (@ahocevar)
- #10063 - Use the same spelling used elsewhere (@tschaub)
- #10067 - fixed jsdoc type annotations (@KlausBenndorf)
- #10057 - Remove unused test extensions (@tschaub)
- #10056 - Remove called assert extension (@tschaub)
- #10055 - Ensure proper tile load sequence (@ahocevar)
- #10051 - Simplify the assertion (@tschaub)
- #10050 - Use expect().fail() instead of expect.fail() (@tschaub)
- #10048 - Early EMPTY state for VectorRenderTile (@ahocevar)
- #10043 - User coordinates during snapping (@tschaub)
- #10042 - Better typing (@fredj)
- #10040 - Additional tests for LineString (@ahocevar)
- #10038 - do not stale issues with
bug
orpull request accepted
labels (@KlausBenndorf) - #10039 - 🚀 Release 6 (@openlayers)
Dependency Updates
- #10065 - Update mocha to the latest version 🚀 (@openlayers)
- #10064 - Update handlebars to the latest version 🚀 (@openlayers)
- #10052 - Update handlebars to the latest version 🚀 (@openlayers)
- #10041 - Update handlebars to the latest version 🚀 (@openlayers)
6.0.0
Wow. The 6.0 release includes changes from 1780 commits in 544 pull requests since the 5.3 release. Thanks to all who contributed to this effort.
A major feature in this release is the ability to compose layers with different renderer types. Previously, the map used a single rendering strategy, and all layers in your map had to implement that strategy. Now it is possible to have a map with layers that use different rendering technologies. This makes it possible, for example, to have Canvas (2D) layer composed together with a WebGL based layer in the same map. It is also possible to create layers with custom renderers. So you could have a map that uses another library (like d3) to render one layer and use OpenLayers to render the other layers. We will continue to take advantage of this new flexibility in future releases.
In addition, the 6.0 release includes a number of vector tile rendering improvements and should have a lower memory footprint overall. The release also includes a number of experimental features that are not yet part of the stable API. Take a look through the examples for a new WebGL based renderer and the experimental useGeographic()
function. Watch upcoming releases for more detail on these.
This release includes a number of backwards incompatible changes. Take a careful look at the notes below when upgrading your application from the 5.3 release.
Backwards incompatible changes
Usage of map.forEachLayerAtPixel
Due to performance considerations, the layers in a map will sometimes be rendered into one
single canvas instead of separate elements.
This means map.forEachLayerAtPixel
will bring up false positives.
The easiest solution to avoid that is to assign different className
properties to each layer like so:
new Layer({
// ...
className: 'my-layer'
})
Please note that this may incur a significant performance loss when dealing with many layers and/or
targetting mobile devices.
Removal of TOUCH
constant from ol/has
If you were previously using this constant, you can check if 'ontouchstart'
is defined in window
instead.
if ('ontouchstart' in window) {
// ...
}
Removal of GEOLOCATION
constant from ol/has
If you were previously using this constant, you can check if 'geolocation'
is defined in navigator
instead.
if ('geolocation' in navigator) {
// ...
}
Removal of CSS print rules
The CSS media print rules were removed from the ol.css
file. To get the previous behavior, use the following CSS:
@media print {
.ol-control {
display: none;
}
}
Removal of optional this arguments
The optional this (i.e. opt_this) arguments were removed from the following methods.
Please use closures, the es6 arrow function or the bind method to achieve this effect (Bind is explained here:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).
forEachCorner
inol/extent
LRUCache#forEach
RBush#forEach
andRBush#forEachInExtent
The setCenter
, setZoom
, setResolution
and setRotation
methods on ol/View
do not bypass constraints anymore
Previously, these methods allowed setting values that were inconsistent with the given view constraints.
This is no longer the case and all changes to the view state now follow the same logic:
target values are provided and constraints are applied on these to determine the actual values to be used.
Removal of the constrainResolution
option on View.fit
, PinchZoom
, MouseWheelZoom
and ol/interaction.js
The constrainResolution
option is now only supported by the View
class. A View.setConstrainResolution
method was added as well.
Generally, the responsibility of applying center/rotation/resolutions constraints was moved from interactions and controls to the View
class.
The view extent
option now applies to the whole viewport
Previously, this options only constrained the view center. This behaviour can still be obtained by specifying constrainCenterOnly
in the view options.
As a side effect, the view rotate
method is gone and has been replaced with adjustRotation
which takes a delta as input.
The view is constrained so only one world is visible
Previously, maps showed multiple worlds at low zoom levels. In addition, it used to be possible to pan off the north or south edge of the world. Now, the view is restricted to show only one world, and you cannot pan off the edge. To get the previous behavior, configure the ol/View
with multiWorld: true
.
Removal of deprecated methods
The inherits
function that was used to inherit the prototype methods from one constructor into another has been removed.
The standard ECMAScript classes should be used instead.
The deprecated getSnapToPixel
and setSnapToPixel
functions from the ImageStyle
class have been removed.
New internal tile coordinates
Previously, the internal tile coordinates used in the library had an unusual row order – the origin of the tile coordinate system was at the top left as expected, but the rows increased upwards. This meant that all tile coordinates within a tile grid's extent had negative y
values.
Now, the internal tile coordinates used in the library have the same row order as standard (e.g. XYZ) tile coordinates. The origin is at the top left (as before), and rows or y
values increase downward. So the top left tile of a tile grid is now 0, 0
, whereas it was 0, -1
before.
x, y values for tile coordinates
origin
*__________________________
| | | |
| 0, 0 | 1, 0 | 2, 0 |
|________|________|________|
| | | |
| 0, 1 | 1, 1 | 2, 1 |
|________|________|________|
| | | |
| 0, 2 | 1, 2 | 2, 2 |
|________|________|________|
This change should only affect you if you were using a custom tileLoadFunction
or tileUrlFunction
. For example, if you used to have a tileUrlFunction
that looked like this:
// before
function tileUrlFunction(tileCoord) {
const z = tileCoord[0];
const x = tileCoord[1];
const y = -tileCoord[2] - 1;
// do something with z, x, y
}
You would now do something like this:
// after
function tileUrlFunction(tileCoord) {
const z = tileCoord[0];
const x = tileCoord[1];
const y = tileCoord[2];
// do something with z, x, y
}
In addition (this should be exceedingly rare), if you previously created a ol/tilegrid/WMTS
by hand and you were providing an array of sizes
, you no longer have to provide a negative height if your tile origin is the top-left corner (the common case). On the other hand, if you are providing a custom array of sizes
and your origin is the bottom of the grid (this is uncommon), your height values must now be negative.
Removal of the "vector" render mode for vector tile layers
If you were previously using VectorTile
layers with renderMode: 'vector'
, you have to remove this configuration option. That mode was removed. 'hybrid'
(default) and 'image'
are still available.
Removal of the "renderMode" option for vector layers
If you were previously using Vector
layers with renderMode: 'image'
, you have to remove this configuration option. Instead, use the new ol/layer/VectorImage
layer with your ol/source/Vector
.
New declutter behavior
If a map has more than one layer with declutter
set to true, decluttering now considers all Vector
and VectorTile
layers, instead of decluttering each layer separately. Only VectorImage
layers continue to be decluttered separately. The higher the z-index of a layer, the higher the priority of its decluttered items.
Within a layer, the declutter order has changed. Previously, styles with a lower zIndex
were prioritized over those with a higher zIndex
. Now the opposite order is used.
On vector layers, even if decluttered images or texts have a lower z-Index than polygons or lines, they will now be rendered on top of the polygons or lines. For vector tile layers, this was the case already in previous releases.
New prerender
and postrender
layer events replace old precompose
, render
and postcompose
events
If you were previously registering for precompose
and postcompose
events, you should now register for prerender
and postrender
events on layers. Instead of the previous render
event, you should now listen for postrender
. Layers are no longer composed to a single Canvas element. Instead, they are added to the map viewport as individual elements.
New getVectorContext
function provides access to the immediate vector rendering API
Previously, render events included a vectorContext
property that allowed you to render features or geometries directly to the map. This is still possible, but you now have to explicitly create a vector context with the getVectorContext
function. This change makes the immediate rendering API an explicit dependency if your application uses it. If you don't use this API, your application bundle will not include the vector rendering modules (as it did before).
Here is an abbreviated example of how to use the getVectorContext
function:
import {getVectorContext} from 'ol/render';
// construct your map and layers as usual
layer.on('postrender', function(event) {
const vectorContext = getVectorContext(event);
// use any of the drawing methods on the vector context
});
Layers can only be added to a single map
Previously, it was possible to render a single layer in two maps. Now, each layer can only belong to a single map (in the same way that a single DOM element can only have one parent).
T...
v5.3.3
v5.3.0
We're continuing to work toward more complete type checking with TypeScript – based on JSDoc annotations in the source. The 5.3 release includes a number of bug fixes related to the type checking effort. In addition the release comes with a handful of new features and improved API reference docs.
Upgrade Notes
The getUid
function returns string
The getUid
function from the ol/util
module now returns a string instead of a number.
Attributions are not collapsible for ol/source/OSM
When a map contains a layer from a ol/source/OSM
source, the ol/control/Attribution
control will be shown with the collapsible: false
behavior.
To get the previous behavior, configure the ol/control/Attribution
control with collapsible: true
.
New Features and Fixes
- #8642 - Fixes for optional key passing, issue #8067 for tile sources (@dimin)
- #8885 - Move GeolocationProperty into Geolocation (@fredj)
- #8881 - Remove custom styles in drag-and-drop examples (@fredj)
- #8877 - Create context in vector tile layer constructor (@tschaub)
- #8883 - New test runner (@tschaub)
- #8882 - Import simplification (@fredj)
- #8858 - Add condition for viewParams and TypeScript related option (@webgeodatavore)
- #8879 - Build with CircleCI (@openlayers)
- #8878 - Avoid logging 404 warnings (@tschaub)
- #8876 - Remove RenderType enum from vector tile layer (@tschaub)
- #8874 - Remove unnecessary type casts in canvas layer renderer (@tschaub)
- #8869 - Fix more types for TypeScript (@ahocevar)
- #8868 - Throw when calling abstract methods; fix abstract return types (@ahocevar)
- #8862 - Legacy build and apidoc improvements (@ahocevar)
- #8867 - Fix example builder (@ahocevar)
- #8852 - Improve link handling in API docs (@ahocevar)
- #8853 - Make rendercomplete work with vector sources without loader (@ahocevar)
- #8851 - Use typescript types for RBush (@fredj)
- #8850 - Remove old TODO in ol/Graticule (@fredj)
- #8847 - Fix API docs (@ahocevar)
- #8845 - Remove RenderType enum from vector layer (@tschaub)
- #8843 - Fix ts typing for fullscreen button (@tonio)
- #8841 - Use super.method instead of prototype.method.call (@fredj)
- #8842 - Change target type from Element to HTMLElement (@fredj)
- #8840 - Remove unneeded code in VectorTile renderer (@elemoine)
- #8844 - Set crossOrigin to anonymous in mapbox-streets-v6-style (@elemoine)
- #8776 - Use setTimeout without the window namespace (@ahocevar)
- #8837 - Re-export MousePosition from ol/control (@fredj)
- #8832 - Remove source foreachfeatureatcoordinate from ol/renderer/webgl/ImageLayer (@fredj)
- #8833 - Fix wrong filename in type annotation (@fredj)
- #8827 - Removed unused forEachFeatureAtCoordinate from ol/source/Source (@schmidtk)
- #8830 - Type annotation fixes in ol/control/ (@fredj)
- #8829 - Change getUid return type from number to string (@fredj)
- #8825 - Fix TypeScript errors (@schmidtk)
- #8828 - Re-export VectorTile from ol/source (@elemoine)
- #8806 - Preserve button class name list in full screen control on toggle (@notnotse)
- #8817 - Clarify format option for ol/source/WMTS (@romanzoller)
- #8824 - Fix TypeScript errors in ol/format/GML (@schmidtk)
- #8820 - Polygon intersectsExtent failure - Issue #8795 (@hmdavidjunior)
- #8519 - GML Format Improvements #8516 #8517 #8518 (@NielsCharlier)
- #8711 - Fix TypeScript errors in ol/format/GML (@schmidtk)
- #8818 - Fix the way zoom comes from (@cs09g)
- #8804 - Add possibility to disable collapsible attributions from Source (@notnotse)
- #8787 - Replace instanceof checks with other logic (@ahocevar)
- #8808 - Fix format and version properties in ol/source/WMTS Options typedef (@fredj)
- #8812 - Update snap.js (@rosedo)
- #8809 - Configurable interval options (@notnotse)
- #8798 - Use unpkg.com instead of rawgit.com (@fredj)
- #8805 - Do not draw image with width or height < 0.5 (@notnotse)
- #8803 - Handle zoom slider position with floating point numbers (@notnotse)
- #8789 - Spelling and indentation fixes (@fredj)
- #8782 - Fix getSimplifiedGeometry definition (@wallw-bits)
- #8783 - Fix missing method declaration (@wallw-bits)
- #8781 - Fix type check errors (@schmidtk)
- #8779 - Fix additional type check errors (@schmidtk)
- #8753 - Fix type check in ol/PluggableMap.js (@wallw-bits)
- #8762 - Fix type errors from interaction event handlers (@schmidtk)
- #8763 - Fix type check for ol/events (@wallw-bits)
- #8774 - Fix type check errors in ol/renderer/webgl (@schmidtk)
- #8768 - Fix type check errors in ol/interaction/Select (@schmidtk)
- #8764 - Fix TypeScript errors in ol/interaction/Draw (@schmidtk)
- #8767 - Fix type check errors in ol/intera...
v5.2.0
The 5.2 release adds a few new features a handful of fixes, including regressions that were reported after the 5.1 release. You should be able to upgrade without any additional work. See the one note below regarding snapToPixel
on ol/style/Image
and subclasses.
We're still working toward type checking with TypeScript. Until that is complete, we apologize for some flwas in the online API documentation. We're excited about the improved experience for application developers when the effort is finished, and will highlight some of the benefit in upcoming releases.
Upgrade Notes
Removal of the snapToPixel
option for ol/style/Image
subclasses
The snapToPixel
option has been removed, and the getSnapToPixel
and setSnapToPixel
methods are deprecated.
The renderer now snaps to integer pixels when no interaction or animation is running to get crisp rendering. During interaction or animation, it does not snap to integer pixels to avoid jitter.
When rendering with the Immediate API, symbols will no longer be snapped to integer pixels. To get crisp images, set context.imageSmoothingEnabled = false
before rendering with the Immediate API, and context.imageSmoothingEnabled = true
afterwards.
New Features and Fixes
- #8511 - Update IGN API key (@openlayers)
- #8547 - Fix port number in developing doc (@pgiraud)
- #8546 - Update projection FAQ for v5 (@ahocevar)
- #8481 - Expose some internal functions (@gberaudo)
- #8510 - Fix WMTS URLs with dimensions (@gberaudo)
- #8524 - Fix compatiblity with XHTML content type (@NeoRaider)
- #8532 - Add 'rendercomplete' event (@ahocevar)
- #8529 - Update link to base class in docs (@TDesjardins)
- #8528 - Update link to base class in docs (@TDesjardins)
- #8525 - Re-export Projection from ol/proj for convenience (@tschaub)
- #8499 - Round center in viewState to pixels (@ahocevar)
- #8520 - Remove redundant if block (@openlayers)
- #8515 - More convenient select and sketch layer management (@ahocevar)
- #8503 - Avoid block scope issues in transpiled code (@ahocevar)
- #8490 - WMTS getCapabilities readCoodinates more than one whitespace delimiter (@MarquesDeAzevedo)
- #8489 - Use .prototype. only where necessary (@ahocevar)
- #8478 - Check font availability with multiple font weights (@ahocevar)
- #8483 - Don't create Polygon with null coordinates (@fredj)
- #8471 - Add getUrl and getImageExtent to ImageStatic API (@samuel-girard)
- #8470 - Update Tile loading API docs (@scroach)
- #8477 - Expose original getGutter (@gberaudo)
- #8466 - Add onFocusOnly option to interaction defaults (@ahocevar)
- #8465 - Do not prevent default on pointermove (@ahocevar)
- #8461 - Fix double backtick typo (@lionralfs)
- #8452 - Remove extra translate function in Geometry, add missing api tag (@fredj)
- #8451 - Remove unimplemented functions (@fredj)
- #8450 - Mark properties of ReadOptions and WriteOptions as optional (@fredj)
- #8443 - Explicit void (@tschaub)
- #8437 - Avoid shadowing EventTarget (@tschaub)
- #8439 - Fewer dots in types (@tschaub)
- #8441 - Fix loaded script for the example-verbatim examples (@fredj)
- #8435 - Call setCoordinates on the point instance (@fredj)
- #8428 - Type name on same line as type (@tschaub)
- #8422 - Improve JSDoc such that
ng build --prod
with angular/cli 6.0.8 succeeds again (@jkoelewijn) - #8396 - Fix ol.interaction.Draw~createRegularPolygon (@iamplex)
- #8420 - Keep function names when building examples (@ahocevar)
- #8419 - Release v5.1.3 (@tschaub)
- #8417 - Minor doc updates (@tschaub)
- #8418 - Set api annotation on classdesc, not constructor (@ahocevar)
- #8414 - Updates for 5.1.2 (@tschaub)
- #8413 - Remove extra curly in type (@tschaub)
- #8412 - Changes for 5.1.1. (@tschaub)
Dependency Updates
- #8543 - Update rollup to the latest version 🚀 (@openlayers)
- #8541 - Update proj4 to the latest version 🚀 (@openlayers)
- #8542 - Update rollup-plugin-commonjs to the latest version 🚀 (@openlayers)
- #8533 - Update webpack to the latest version 🚀 (@openlayers)
- #8530 - Update webpack to the latest version 🚀 (@openlayers)
- #8522 - Update marked to the latest version 🚀 (@openlayers)
- #8505 - Update karma to the latest version 🚀 (@openlayers)
- #8501 - Update rollup-plugin-commonjs to the latest version 🚀 (@openlayers)
- #8495 - Update rollup to the latest version 🚀 (@openlayers)
- #8493 - Update clean-css-cli to the latest version 🚀 (@openlayers)
- #8491 - Update rollup to the latest version 🚀 (@openlayers)
- #8486 - Update webpack to the latest version 🚀 (@openlayers)
- #8476 - Update webpack to the latest version 🚀 (@openlayers)
- #8475 - Update clean-css-cli to the latest version 🚀 (@openlayers)
- #8469 - Update rollup to the latest version 🚀 (@openlayers)
- #8453 - Update webpack to the latest version 🚀 (@openlayers)
- #8447 - Upda...
v5.1.3
v5.1.2
v5.1.1
The 5.1.1 release is a patch to include the readme in the package. See the 5.1.0 notes for detail on the 5.1 release.
v5.1.0
The 5.1 release adds a few new features a handful of fixes. You should be able to upgrade without any additional work. See the one note below regarding null
geometry coordinates.
We're working toward type checking with TypeScript. This will complete our move away from using the Closure Compiler for type checking and compilation. We're excited about the improved experience for application developers and will highlight some of the benefit in upcoming releases.
Upgrade Notes
Geometry constructor and setCoordinates
no longer accept null
coordinates
Geometries (ol/geom/*
) now need to be constructed with valid coordinates (center for ol/geom/Circle
) as first constructor argument. The same applies to the setCoordinates()
(setCenter() for
ol/geom/Circle`) method.
New Features and Fixes
- #8409 - Add abstract translate to ol/geom/Geometry (@pjeweb)
- #8405 - Minor type fixes (@tschaub)
- #8401 - Make webpack's css loader work (@ahocevar)
- #8403 - Markdown links (@tschaub)
- #8402 - Type fixes from the typescript checks (@fredj)
- #8400 - ESLint config update (@tschaub)
- #8399 - Copy ol.css to build dir when building package (@ahocevar)
- #8397 - Update rollup (@tschaub)
- #8385 - Use class syntax (@openlayers)
- #8383 - style/Icon: Add
setAnchor()
method (@Turbo87) - #8368 - Make render listeners work with image render mode (@ahocevar)
- #8376 - copy ZM values to polygon in makeRegular (@virtualcitySYSTEMS)
- #8372 - Release v5.0.3 (@openlayers)
- #8364 - Make examples work in IE11 (@ahocevar)
- #8363 - Autogenerate src/ol/package.json (@ahocevar)
- #8371 - Skip rendering when there is no replay group (@ahocevar)
- #8362 - Smart flat coordinates (@ahocevar)
- #8352 - Set
sideEffects
tofalse
instead of"false"
(@tschaub) - #8351 - Fix typo in release notes (@ahocevar)
- #8350 - Updates for v5.0.2 (@ahocevar)
- #8349 - Release v5.0.1 (@ahocevar)
- #8343 - Starter projects (@tschaub)
- #8347 - Fix typos in release notes (@ahocevar)
- #8346 - Release v5.0.1 (@openlayers)
- #8342 - Fix links and description in quickstart tutorial (@ahocevar)
- #8344 - Updated issue and pr templates (@tschaub)
- #8341 - Set sideEffects: false flag (@ahocevar)
- #8333 - Fix wrong return type for readHref function (@openlayers)
- #8329 - Better jsdoc typing (@fredj)
- #8319 - Remove reference to setProj4 function in documentation (@fredj)
Dependency Updates
- #8410 - Update rollup to the latest version 🚀 (@openlayers)
- #8408 - Update rollup to the latest version 🚀 (@openlayers)
- #8386 - Update fs-extra to the latest version 🚀 (@openlayers)
- #8382 - Update webpack to the latest version 🚀 (@openlayers)
- #8373 - Update webpack to the latest version 🚀 (@openlayers)
- #8355 - Update recast to the latest version 🚀 (@openlayers)
- #8354 - Update webpack to the latest version 🚀 (@openlayers)
- #8348 - Update webpack to the latest version 🚀 (@openlayers)
- #8338 - Update recast to the latest version 🚀 (@openlayers)
- #8332 - Update webpack to the latest version 🚀 (@openlayers)
- #8326 - Update webpack to the latest version 🚀 (@openlayers)
- #8321 - Update rollup to the latest version 🚀 (@openlayers)
- #8318 - Update webpack to the latest version 🚀 (@openlayers)