The `WebGLHelper` class now provides a `makeProjectionTransform` method
that updates a transform to match the projection for a given frame state.
This also means that the WebGLHelper does not set the projection matrix
uniform anymore, this is the responsibility of the renderer as
the rendered coordinates will not be in world space from now on.
This uses an undocumented method to trigger a synchronous redraw
instead of using the standard schedule from Mapbox. The CSS previously used
to make the OL and MB views match is not necessary anymore.
Reference: https://github.com/mapbox/mapbox-gl-js/issues/7893#issue-408992184
IIIF Image API 3 allows context extensions that should be added to the
info.json's @context property. Therefore, '@context' might be an array
instead of a string.
60: "Missing or invalid `size`."
Without at least a size, no IIIF can be displayed.
61: "Cannot determine IIIF Image API version from provided image
information JSON."
Without finding out the version information, one could only guess how to
use the image info JSON.
src/ol/source/IIIF.js contains a tile source for IIIF Image API services.
It supports Image API version 1 and 2 on compliance levels 0, 1 and 2.
To get working constructor options for IIIF from an IIIF image info.json,
use src/ol/format/IIIFInfo.js.
An example is available in examples/iiif.html respectivly examples/iiif.js.
The transpiling step is done by babel instead of bublé now.
Bublé caused the istanbul instrumenter step to crash because of an
unexpected SourceMap object format.
Previously, an interaction could begin while target values
(center/resolution) were out of the allowed range, causing a
glitch where the view zoom/position would jump suddenly.
By default, alpha premultiplying should be done by the initial rendering
(eg quads) and not the final post processing pass.
The default post processing pass expects premultiplied color values and
will not do this operation itself.
This also makes it possible to call `solveConstraints_` with a duration of 0,
which means the target values are modified straight away without triggering
an animation or leaving the current flow.
The renderer now accesses the zDirection member directly if it exists.
This also has the advantage of not advertising any object methods that
hav no use for most tile sources.
The zDirection addition to the Zoomify tile source only takes effect through
the renderer, so these two renderer cases are added to test the behavior.
zoomify-no-zdirection expects the default behavior.
zoomify-zdirection expects the tiles for the next better resolution.
Via zDirection, the renderer's selection of a tile source's resolution can be
controlled if the view's resolution does not match any tile source resolution.
Currently the zDirection option is only available for Zoomify. The comment
https://github.com/openlayers/openlayers/issues/9343#issuecomment-474341033
describes why caution is advised when using zDirection for other sources.
ol/source/Tile~TileSource#getZDirection has been added to avoid having the
getZDirection method solely in the Zoomify source - just to document the
possibility.
Transforms the old rendering tests for the VectorImageLayer
to the new rendering test approach.
The declutter tests are kept in the old format for know.
- This sets ignore to false if a method tagged with
inheritdoc has a matching ancestor. It also stops iterating
when a match is found.
- Outdated TODO is removed, too.
this commit enhances the readability of
tile debug coordinates by adding a stroke
for better readability on aerial imagery
and a maxWidth for high zoom levels
The BSD 2-Clause License is a simplified version of the BSD 3-Clause License. This license was popularized by the FreeBSD project and is sometimes referred to as the "FreeBSD License" (see https://opensource.org/licenses/BSD-2-Clause and https://en.wikipedia.org/wiki/BSD_licenses#2-clause). To clarify that the OpenLayers License uses the BSD 2-Clause License template, this change adds "The 2-Clause BSD License" to the top of our license file. In addition, this change makes our license a verbatim copy of the template at https://opensource.org/licenses/BSD-2-Clause with only the copyright holders added. This change is not intended to change the project's license, only to clarify the template used for that license. See https://lists.osgeo.org/pipermail/openlayers-dev/2011-May/007555.html for the original motion to switch to the BSD 2-Clause License (also known as the FreeBSD License).
This downgrades puppeteer to version `~1.11.0`.
This will download the stable version of chromium
(72.0.3582.0). The current puppeteer version
(`^1.12.2`) downloads the beta version of
chromium (73.0.3679.0).
Previously the formula for the resolution constraint allowed going way past
the minimum zoom.
Also adjusted the center constraint to avoid a zigzag effect when going out
of resolution bounds.
The DragPan, KeyboardPan and DragZoom interactions now make sure to
animate to a valid center/resolution target to avoid
a chained "resolve" animation which looks weird.
The `View.fit` method was also fixed to use this.
API changes:
* (breaking) the `rotate` method is gone
* the `adjustRotation`, `adjustResolution` and `adjustZoom` methods are now
available and allow using an anchor.
This means interactions do not have to do the anchor computation themselves
and this also fix anchor computation when constraints must be applied.
This introduces a breaking change.
This options replaces the various `constrainResolution` options on interactions
and the `fit` method.
Since constraints are now the responsibility of the View, the fact that intermediary
zoom levels are allowed or not is now set in the view options.
By default, the view resolution is unconstrained.
This is done by applying the center constraint differently when we're in the
middle of an interaction/animation or not.
When the view is moving, the center constraint will restrain the given value
in an "elastic" way, using a logarithmic function.
This can be disabled using the `smoothCenterConstrain` view parameter.
This will help making sure that the view will come back to a "rested" state
once the interactions are over.
Interactions no longer need to handle the animation back to a rested state,
they simply call `endInteraction` with the desired duration and direction.
This commit aims to simplify the computation of zoom and resolution in the
View class.
Previously zoom levels and resolution computations were mixed in different places,
ie resolution constraints, initial values, etc.
Now the View class only has the `getZoomForResolution` and `getResolutionForZoom`
methods to convert from one system to another.
Other than that, most computations use the resolution system internally.
The `constrainResolution` method also does not exist anymore, and is replaced
by `getValidResolution` and `getValidZoomLevel` public methods.
This introduces a breaking change:
The `extent` view option now constrains the whole viewport and not just the
view center.
The option `constrainOnlyCenter` was added to keep the previous behaviour.
Constraining the whole viewport and not only the view center means
that the center and resolution constraints must be applied with a knowledge of
the viewport size.
The `getValidZoomLevel` apply the current resolution constraint to return
a value that is guaranteed valid.
This is used for interactions & controls which need a target value to work:
the +/- buttons, the zoom clider, the dragbox zoom and the mouse wheel zoom.
The view now has targetCenter, targetRotation and targetResolution members.
These hold the new values given by set* methods. The actual view parameters are then changed by
calling `applyParameters_`.
The TileJSON spec does not specify the tile size
and there is no TileJSON property specifying the value.
Many providers nowadays provide 512x512 with TileJSON.
- Rename linearRingIsOriented => linearRingsAreOriented
The function checks all linear rings of a Polygon, so
the plural "rings" is more appropriate
- Rename linearRingsAreOriented => linearRingssAreOriented
The double s is appropriate because the check is done for
all Polygons of a MultiPolygon
This commit restores the function names from OpenLayers v4,
they were changed (wrongly IMHO) in #7820.
Things done:
- stay closer to the original rendering in canvas
- get rid of the intermediary blur step
- use the new callbacks in the webgl points renderer
- premultiply alpha in the last postprocessing step
Now the shader and program caches are simply arrays of native WebGL created objects.
The WebGLHelper simply takes the sources of the frag and vert shader and produces a program.
This removes 2 classes & reduces the general verbosity of the API.
Also a `getShaderCompilationErrors` was added on `WebGLHelper` to help debug GLSL errors.
Executors are use to render instructions.
They do not contain cod for building instructions.
Signed-off-by: Guillaume Beraudo <guillaume.beraudo@camptocamp.com>
ol/renderer/vector was using the abstract ReplayGroup type while
referencing replayGroup.addDeclutter(), which was only defined
on the canvas and webgl implementations and was also defined
differently.
- Added JSDoc to getRenderer()
- Cast default options to types
- Cast event to MouseEvent to satisfy tsc. Non mouse/touch events
will simply produce [NaN, NaN]
- Cast to Layer before calling getSource(), as it does not exist
on Base
tsc considers everything in the else block to be of type 'never',
since it thinks that cosh is permanently defined for Math. Casting
back to Math in the else block fixes the error.
Remove 'extent' because the parent Source class does not contain
'extent' on its options or use options.extent in the constructor.
Also removed 'extent' from 'Options' for 'TileSource'.
Fixed constructor docs specifying optional options without a
default value. Fixed malformed @link tag in typedef description.
canvasFunction type was previously declared with the 'this' type
as ImageCanvas, but the 'this' ref was not passed on the scope when
calling the function.
The parent class does not accept an extent on its options. Also
check that the image is an img or video tag before setting the
source as Canvas does not have the src property.
If `VOID` is used, TypeScript is not able to figure out what the function parameters are.
Before:
```
$ npx tsc | wc -l
1188
```
After:
```
$ npx tsc | wc -l
1169
```
I'm not entirely sure that I like this pattern, but there does not
appear to be a better option since TypeScript would recommend:
function(this: SomeClass, ...)
tsdoc does not appear to support an associated annotation for the
function a la @this {SomeClass}.
Remove the following errors from the TypeScript checks:
```
src/ol/pointer/TouchSource.js(231,23): error TS2339: Property 'webkitRadiusX' does not exist on type 'Touch'.
src/ol/pointer/TouchSource.js(232,24): error TS2339: Property 'webkitRadiusY' does not exist on type 'Touch'.
src/ol/pointer/TouchSource.js(233,26): error TS2339: Property 'webkitForce' does not exist on type 'Touch'.
```
The only reference that I've found for these properties is a warning message from Google Chrome:
```
'Touch.webkitRadiusX' is deprecated and will be removed in M47, around November 2015. Please use 'Touch.radiusX' instead.
```
TypeScript doesn't like the current implementation:
```
src/ol/control/MousePosition.js(82,64): error TS2339: Property 'undefinedHTML' does not exist on type 'never'.
```
Some WMTS getCapabilities return <MatrixSet><TopLeftCorner> with more than one whitespace as delimiter between the coordinates. This leads to the layer not being displayed, because the origin_ property of ol.tilegrid.TileGrid is not set.
Error in ol.tilegrid.TileGrid.prototype.getTileCoordForXYAndZ_: JavaScript runtime error: Unable to get property '0' of undefined or null reference
It is often useful in application code to have a way to uniquely identify
and object.
Exposing the OpenLayers mechanism allows for best performance and avoid
unneccessary dirt.
TileWMS objects take a gutter option but do not have a public getter
for it. This makes it convoluted for user code to recreate the object
(ex: in the case of serialization/deserialization).
- the getGutterInternal() method is renamed to getGutter;
- the getGutter(projection) method is renamed to getGutterForProjection,
which is also more explicit.
The getGutter method was not API and is only used by the renderer.
Instead, only prevent default on handled pointerdown events. This makes
the `focus` condition work with interactions that involve dragging on
touch devices.
By overriding getTile() and creating replay and image there, we can do
all preparations earlier and stop creating new tiles when we have maxed
out the frame time budget. It also allows us to get rid of the
drawTileImage override.
In OpenLayers 5, the following features are not supported anymore:
- Google Closure Compiler builds;
- custom builds.
The Google Closure Compiler is only kept for internal type checking.
To remove the following closure compiler warning:
```
Function module$node_modules$rbush$index.default: called with 1 argument(s). Function requires at least 2 argument(s) and at most 2.
```
`ol.tilegrid.WMTS.createFromCapabilitiesMatrixSet` fails when tileMatrix identifiers
are not prefixed by their tileMatrixSet identifier.
Original code by @filipheymans
In order to allow a user to select content within an element with the `.ol-selectable` class the `user-select` CSS property should be `text`.
The current value of `auto` results in a computed value of `none` due to the rule `.ol-viewport, .ol-unselectable` specifying `user-select: none`. According to the [the specification](https://www.w3.org/TR/css-ui-4/#valdef-user-select-auto):
> if the computed value of `user-select` on the parent of this element is `none`, the computed value is `none`
Tested manually on Chromium, Firefox and IE11.
The PDF was only generated AFTER requesting new tiles. When no new tiles where needed,
the callback never completed. Also fixed fitting the correct extent.
Fixes#7830.
This brings canvas polygon hit detection in parity with WebGL, where an
unfilled polygon will not be hit detected hovering inside the polygon.
Fixes#4846
This uses Closure Compiler to create a full build and run type checks.
Currently type errors are reported as warnings and the build is created
with SIMPLE optimizations until we have transitioned all types to path
types.
In rare cases, the previous font check returned false negatives when
checking against monospace only. By checking against another font, this
can be avoided.
See Issue #5881: setUrl was inherited from ol.source UrlTile, which creates a wrong tileUrlFunction: The official WMTS URL Template variables were no longer replaced.
Use the defined source projection despite it being equivalent to the rendering projection to enable using the specified alias code name instead of the code provided by the renderer's projection object. For example: The server only knows the name "EPSG:900913", which is an alias for the equivalent "EPSG:3857", that the renderer uses (by default).
This adds the pixelTolerance option parameter to the constructor of ol.interaction.Extent.
In this way the user can override the current default value of 10.
Also IMHO it doesn't make much sense to have issues of previous patch releases eg. 4.3.4 in here as these have their own release notes already, but I'll leave that for your debate
Previously, events weren't being propagated if the active draw
interaction had its `freehand` property set to true. This means that
you can't use your mouse wheel to zoom the map in freehand mode.
This change sets the default `pass` value to true and adds additional
logic to determine when it should be set to false (and stop event
propagation).
This commit also changes the TextReplay.drawText() signature, and moves
geometry calculation into drawText(). This improves performance where no
text needs to be rendered (TextStyle.getText() == ''), which is used often
in applications.
Having the coverage calculation code in the test files makes it hard to debug
tests, so it is better to only analyze coverage on Travis, and not locally.
There is a great deal of lines about Greenkeeper merges in the changelog, making it
hard to find real changes to the code.
This commit modifies the changelog task to exclude such lines.
This adds a unit test that tests weather the projection (spatial reference)
is being added inside the geometry object when writing features as
esriJson.
The WFS transaction failed if the srsDimension was not present on the
geometries.
Unit tests have been changed to accomodate the srsDimension attribute.
Contrary to Mapserver, Geoserver sets the srsDimension attribute on
the child of the geometry node, not on the points list.
This fix searches that node as well.
A small unit test was also added.
Changes to the layer were only propagated in some cases like addition/removal of a
layer to the group.
To make it consistent both with the rest of the group.js file and with the
layer.js file, the changes are now always notified.
Appears to have just been a typeo, using the minLon_, maxLon_ member variables rather than the function parameters provided.
This was creating very wide lines of parallel which were sometimes very slow in Chrome.
Until now, the features of transparent vector layers were rendered using
the layer opacity. This caused colors to mix together and the opacities
to stack up to an higher value than the expected layer opacity.
With this commit, the features are rendered at 100% opacity to an
intermediate canvas which ensures colors do not mix up even in the case
of features using an array of styles. The intermediate canvas is then
composed to the map canvas using the layer opacity.
Transparent layers are automatically detected, non-transparent layers
are not affected by the change.
As mentioned on issue 6992, EsriFormat was adding the spatial reference
outside the geometry, failing to insert data via the Arcgis rest API.
The spatial reference should be inside the geometry.
OriginalEvent 'mousemove' break default OL interaction move of map canvas. Using OL event 'pointermove' have same function and allow move of map canvas.
The previous x coordinate was one earth to the left which led to confusing results with everything.
This change makes sure the map is centered in a proper location (pretty much the same as before) WITHIN proper bounds.
This method does have value for users that want to switch between ol.Feature
and ol.render.Feature and still be able to use #getGeometry().getType() in a
style function to determine the feature geometry's type.
Some WFS servers like tinyOWS require the feature prefix to be in the
feature type for the feature to be found (eg `prefix:layer`).
The problem was, the prefix was always added to the feature type which
gave us a type name like `prefix:prefix:feature` or
`feature:prefix:feature`. The requests were then rejected by the WFS
server.
We now check if the feature type starts with the prefix. If it does, we
don't append it again. If it doesn't we do.
The code used to rely on the dimension. However, the dimension can only
be read from a GML3 document. This caused, for 3D geometries:
- An assertion error to be raised since the flatCoordinates list
contains more than 3 elements: "Assertion failed: flatCoordinates should
have a length of 3" The value of flatCoordinates for a 3D point was
something like `[2586394, 1232407, 0, 731, NaN, 0]`
- The value of the Z coordinates to be incorrect and always set to 0
This patch simplifies and correct the parsing of the coordinates:
- Don't parse groups of coords and the coordonates at the same time.
- Detect the dimension for the coordinates.
- If the Z coordinate exists, its value is used, otherwise, we use 0.
- Correct the presentation of test data to make it work with the new
parser.
- Add a test for a 3D point.
This enhance the procedure to find path of jsdoc binary by checking if the file exists.
It also use 2 possible paths to perform this check, one for npm and the other for yarn.
Close#6633
Previous typing was confusing the compiler. It could not figure out the
difference between the proj4 property and the constructor, which lead to
errors such as:
- ol.proj.setProj4(proj4)
ERR! compile /home/gberaudo/dev/ngeo/src/proj/epsg21781.js:8: ERROR - actual parameter 1 of ol.proj.setProj4 does not match formal parameter
ERR! compile found : function (new:proj4): ?
ERR! compile required: (null|proj4)
ERR! compile ol.proj.setProj4(proj4);
ERR! compile ^^^^^
- ol.proj.proj4.get().defs('EPSG:21781', epsg21781def)
ERR! compile /home/gberaudo/dev/ngeo/src/proj/epsg21781.js:26: ERROR - Property defs never defined on proj4
ERR! compile ol.proj.proj4.get().defs('EPSG:21781', epsg21781def);
ERR! compile ^^^^
- Add a version property to olx.format.WFSWriteTransactionOptions to set
the WFS protocol version to use
- Use the specified version to use the correct schema and version in the
GML request
- Use the version to select the proper GML serializer
Make the overlay visible before updating the render position
so that the `offsetWidth` and `offsetHeight` can be
considered in evaluating the offset and positioning of the
element
See openlayers/openlayers#6566
Your contribution will be under our [license](https://raw.githubusercontent.com/openlayers/openlayers/master/LICENSE.md) as per [GitHub's terms of service](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license).
## Pull request guidelines
@@ -47,7 +42,7 @@ Your pull request must:
* Follow OpenLayers's coding style.
* Pass the integration tests run automatically by the Travis Continuous
* Pass the integration tests run automatically by the CircleCI Continuous
Integration system.
* Address a single issue or add a single item of functionality.
@@ -60,66 +55,6 @@ Your pull request must:
* Be possible to merge automatically.
### The `check` build target
It is strongly recommended that you run
$ make check
before every commit. This will catch many problems quickly, and it is much
faster than waiting for the Travis CI integration tests to run.
The `check` build target runs a number of quick tests on your code. These
[forking](https://github.com/openlayers/openlayers/fork) the OpenLayers repository.
### Travis CI
### CircleCI
The Travis CI hook is enabled on the Github repository. This means every pull request
The CircleCI hook is enabled on the Github repository. This means every pull request
is run through a full test suite to ensure it compiles and passes the tests. Failing
pull requests will not be merged.
@@ -15,103 +15,32 @@ pull requests will not be merged.
The minimum requirements are:
* GNU Make
* Git
* [Node.js](http://nodejs.org/) (higher than 0.12.x)
* Python 2.6 or 2.7
* Java 7 (JRE and JDK)
* [Node.js](http://nodejs.org/) (version 8 and above)
The executables `git`,`node`, and `java` should be in your `PATH`.
You can check your configuration by running:
$ make check-deps
The executables `git` and`node` should be in your `PATH`.
To install the Node.js dependencies run
$ npm install
## Working with the build tool
As an OpenLayers developer you will use `make` to run build targets defined in the
`Makefile` located at the root of the repository. The `Makefile` includes
targets for running the linter, the compiler, the tests, etc.
The usage of `make` is as follows:
$ make <target>
where `<target>` is the name of the build target you want to execute. For
example:
$ make test
The main build targets are `serve`, `lint`, `build`, `test`, and `check`. The
latter is a meta-target that basically runs `lint`, `build`, and `test`.
The `serve` target starts a node-based web server, which we will refer to as the *dev server*. You'll need to start that server for running the examples and the tests in a browser. More information on that further down.
Other targets include `apidoc` and `ci`. The latter is the target used on Travis CI. See OpenLayers's [Travis configuration file](https://github.com/openlayers/openlayers/blob/master/.travis.yml).
## Running the `check` target
The `check` target is to be run before pushing code to GitHub and opening pull
requests. Branches that don't pass `check` won't pass the integration tests,
and have therefore no chance of being merged into `master`.
To run the `check` target:
$ make check
If you want to run the full suite of integration tests, see "Running the integration
tests" below.
## Running examples
To run the examples you first need to start the dev server:
$ make serve
$ npm run serve-examples
Then, just point your browser <http://localhost:3000/build/examples> in your browser. For example <http://localhost:3000/build/examples/side-by-side.html>.
Run examples against the `ol.js` standalone build:
The examples can also be run against the `ol.js` standalone build, just like
the examples [hosted](https://openlayers.org/en/master/examples/) on GitHub.
Start by executing the `host-examples` build target:
$ make host-examples
After running `host-examples` you can now open the examples index page in the browser: <http://localhost:3000/build/hosted/master/examples/>. (This assumes that you still have the dev server running.)
Append `?mode=raw` to make the example work in full debug mode. In raw mode the OpenLayers and Closure Library scripts are loaded individually by the Closure Library's `base.js` script (which the example page loads and executes before any other script).
Then, load <http://localhost:8080/> in your browser.
## Running tests
To run the tests in a browser start the dev server (`make serve`) and open <http://localhost:3000/test/index.html> in the browser.
To run the tests once:
To run the tests on the console (headless testing with PhantomJS) use the `test` target:
$ npm test
$ make test
To run the tests continuously during development:
See also the test-specific [README](../master/test/README.md).
## Running the integration tests
When you submit a pull request the [Travis continuous integration
server](https://travis-ci.org/) will run a full suite of tests, including
building all versions of the library and checking that all of the examples
work. You will receive an email with the results, and the status will be
displayed in the pull request.
To run the full suite of integration tests use the `ci` target:
$ make ci
Running the full suite of integration tests currently takes 5-10 minutes.
This makes sure that your commit won't break the build. It also runs JSDoc3 to
make sure that there are no invalid API doc directives.
$ npm run karma
## Adding examples
@@ -123,14 +52,3 @@ implies creating two or three files in this directory, an `.html` file, a `.js`
file, and, optionally, a `.css` file.
You can use `simple.js` and `simple.html` as templates for new examples.
### Use of the `goog` namespace in examples
Short story: the OpenLayers examples should not use the `goog` namespace, except
for `goog.require`.
Longer story: we want that the OpenLayers examples work in multiple modes, with the
standalone lib (which has implications of the symbols and properties we
export), and compiled together with the OpenLayers library.
Compiling the examples together with the library makes it mandatory to declare dependencies with `goog.require` statements.
[OpenLayers](https://openlayers.org/) is a high-performance, feature-packed library for creating interactive maps on the web. It can display map tiles, vector data and markers loaded from any source on any web page. OpenLayers has been developed to further the use of geographic information of all kinds. It is completely free, Open Source JavaScript, released under the 2-clause BSD License (also known as the FreeBSD).
[OpenLayers](https://openlayers.org/) is a high-performance, feature-packed library for creating interactive maps on the web. It can display map tiles, vector data and markers loaded from any source on any web page. OpenLayers has been developed to further the use of geographic information of all kinds. It is completely free, Open Source JavaScript, released under the [BSD 2-Clause License](https://opensource.org/licenses/BSD-2-Clause).
## Getting Started
- Download the [latest release](https://openlayers.org/download/)
- Install with npm: `npm install openlayers`
- Clone the repo: `git clone git@github.com:openlayers/openlayers.git`
Install the [`ol` package](https://www.npmjs.com/package/ol):
See the following examples for more detail on bundling OpenLayers with your application:
* Using [Rollup](https://github.com/openlayers/ol-rollup)
* Using [Webpack](https://github.com/openlayers/ol-webpack)
* Using [Parcel](https://github.com/openlayers/ol-parcel)
* Using [Browserify](https://github.com/openlayers/ol-browserify)
## IntelliSense support and type checking for VS Code
The `ol` package contains a `src/` folder with JSDoc annotated sources. TypeScript can get type definitions from these sources with a `jsconfig.json` config file in the project root:
```js
{
"compilerOptions":{
"checkJs":true,
// Point to the JSDoc typed sources when using modules from the ol package
"baseUrl":"./",
"paths":{
"ol":["node_modules/ol/src"],
"ol/*":["node_modules/ol/src/*"]
}
},
"include":[
"**/*.js",
"node_modules/ol/**/*.js"
]
}
```
Project template with this configuration: https://gist.github.com/9a7253cb4712e8bf38d75d8ac898e36c.
Note that the above only works when authoring in plain JavaScript. For similar configurations with a `tsconfig.json` in TypeScript projects, your mileage may vary.
## Supported Browsers
@@ -33,4 +85,5 @@ Please see our guide on [contributing](CONTRIBUTING.md) if you're interested in
- Need help? Find it on [Stack Overflow using the tag 'openlayers'](http://stackoverflow.com/questions/tagged/openlayers)
- Follow [@openlayers](https://twitter.com/openlayers) on Twitter
- Discuss with openlayers users on IRC in `#openlayers` at `chat.freenode`
##### 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:
```js
// before
functiontileUrlFunction(tileCoord){
constz=tileCoord[0];
constx=tileCoord[1];
consty=-tileCoord[2]-1;
// do something with z, x, y
}
```
You would now do something like this:
```js
// after
functiontileUrlFunction(tileCoord){
constz=tileCoord[0];
constx=tileCoord[1];
consty=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:
```js
import{getVectorContext}from'ol/render';
// construct your map and layers as usual
layer.on('postrender',function(event){
constvectorContext=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).
##### The `OverviewMap` requires a list of layers.
Due to the constraint above (layers can only be added to a single map), the overview map needs to be constructed with a list of layers.
##### The `ol/Graticule` has been replaced by `ol/layer/Graticule`
Previously, a graticule was not a layer. Now it is. See the graticule example for details on how to add a graticule layer to your map.
##### `ol/format/Feature` API change
The `getLastExtent()` method, which was required for custom `tileLoadFunction`s in `ol/source/Vector`, has been removed because it is no longer needed (see below).
##### `ol/VectorTile` API changes
* Removal of the `getProjection()` and `setProjection()` methods. These were used in custom `tileLoadFunction`s on `ol/source/VectorTile`, which work differently now (see below).
* Removal of the `getExtent()` and `setExtent()` methods. These were used in custom `tileLoadFunction`s on `ol/source/VectorTile`, which work differently now (see below).
##### Custom tileLoadFunction on a VectorTile source needs changes
Previously, applications needed to call `setProjection()` and `setExtent()` on the tile in a custom `tileLoadFunction` on `ol/source/VectorTile`. The format's `getLastExtent()` method was used to get the extent. All this is no longer needed. Instead, the `extent` (first argument to the loader function) and `projection` (third argument to the loader function) are simply passed as `extent` and `featureProjection` options to the format's `readFeatures()` method.
Example for an old `tileLoadFunction`:
```js
function(tile,url){
tile.setLoader(function(){
fetch(url).then(function(response){
response.arrayBuffer().then(function(data){
varformat=tile.getFormat();
tile.setProjection(format.readProjection(data));
tile.setFeatures(format.readFeatures(data,{
// featureProjection is not required for ol/format/MVT
##### Drop of support for the experimental WebGL renderer
The WebGL map and layers renderers are gone, replaced by a `WebGLHelper` function that provides a lightweight,
low-level access to the WebGL API. This is implemented in a new `WebGLPointsLayer` which does simple rendering of large number
of points with custom shaders.
This is now used in the `Heatmap` layer.
The removed classes and components are:
*`WebGLMap` and `WebGLMapRenderer`
*`WebGLLayerRenderer`
*`WebGLImageLayer` and `WebGLImageLayerRenderer`
*`WebGLTileLayer` and `WebGLTileLayerRenderer`
*`WebGLVectorLayer` and `WebGLVectorLayerRenderer`
*`WebGLReplay` and derived classes, along with associated shaders
*`WebGLReplayGroup`
*`WebGLImmediateRenderer`
*`WebGLMap`
* The shader build process using `mustache` and the `Makefile` at the root
##### Removal of the AtlasManager
Following the removal of the experimental WebGL renderer, the AtlasManager has been removed as well. The atlas was only used by this renderer.
The non API `getChecksum` functions of the style is also removed.
##### Change of the behavior of the vector source's clear() and refresh() methods
The `ol/source/Vector#clear()` method no longer triggers a reload of the data from the server. If you were previously using `clear()` to refetch from the server, you now have to use `refresh()`.
The `ol/source/Vector#refresh()` method now removes all features from the source and triggers a reload of the data from the server. If you were previously using the `refresh()` method to re-render a vector layer, you should instead call `ol/layer/Vector#changed()`.
#### Other changes
##### Allow declutter in image render mode
It is now possible to configure vector tile layers with `declutter: true` and `renderMode: 'image'`. However, note that decluttering will be done per tile, resulting in labels and point symbols getting cut off at tile boundaries.
Until now, using both options forced the render mode to be `hybrid`.
##### Always load tiles while animating or interacting
`ol/PluggableMap` and subclasses no longer support the `loadTilesWhileAnimating` and `loadTilesWhileInteracting` options. These options were used to enable tile loading during animations and interactions. With the new DOM composition render strategy, it is no longer necessary to postpone tile loading until after animations or interactions.
### v5.3.0
#### 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`.
### v5.2.0
#### 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.
### v5.1.0
#### 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.
### v5.0.0
#### Renamed `ol/source/TileUTFGrid` to `ol/source/UTFGrid`
The module name is now `ol/source/UTFGrid` (`ol.source.UTFGrid` in the full build).
#### Renaming of the `defaultDataProjection` in the options and property of the `ol/format/Feature` class and its subclasses
The `defaultDataProjection` option is now named `dataProjection`. The protected property available on the class is also renamed.
#### `transition` option of `ol/source/VectorTile` is ignored
The `transition` option to get an opacity transition to fade in tiles has been disabled for `ol/source/VectorTile`. Vector tiles are now always rendered without an opacity transition.
#### `ol/style/Fill` with `CanvasGradient` or `CanvasPattern`
The origin for gradients and patterns has changed from the top-left corner of the extent of the geometry being filled to 512 css pixel increments from map coordinate `[0, 0]`. This allows repeat patterns to be aligned properly with vector tiles. For seamless repeat patterns, width and height of the pattern image must be a factor of two (2, 4, 8, ..., 512).
#### Removal of the renderer option for maps
The `renderer` option has been removed from the `Map` constructor. The purpose of this change is to avoid bundling code in your application that you do not need. Previously, code for both the Canvas and WebGL renderers was included in all applications - even though most people only use one renderer. The `Map` constructor now gives you a Canvas (2D) based renderer. If you want to try the WebGL renderer, you can import the constructor from `ol/WebGLMap`.
Old code:
```js
importMapfrom'ol/Map';
constcanvasMap=newMap({
renderer:['canvas']
// other options...
});
constwebglMap=newMap({
renderer:['webgl']
// other options...
});
```
New code:
```js
importMapfrom'ol/Map';
importWebGLMapfrom'ol/WebGLMap';
constcanvasMap=newMap({
// options...
});
constwebglMap=newWebGLMap({
// options...
});
```
#### Removal of ol.FeatureStyleFunction
The signature of the vector style function passed to the feature has changed. The function now always takes the `feature` and the `resolution` as arguments, the `feature` is no longer bound to `this`.
Old code:
```js
feature.setStyle(function(resolution){
vartext=this.get('name');
...
});
```
New code:
```js
feature.setStyle(function(feature,resolution){
vartext=feature.get('name');
...
});
```
#### Changed behavior of the `Draw` interaction
For better drawing experience, two changes were made to the behavior of the Draw interaction:
1. On long press, the current vertex can be dragged to its desired position.
2. On touch move (e.g. when panning the map on a mobile device), no draw cursor is shown, and the geometry being drawn is not updated. But because of 1., the draw cursor will appear on long press. Mouse moves are not affected by this change.
#### Changes in proj4 integration
Because relying on a globally available proj4 is not practical with ES modules, we have made a change to the way we integrate proj4:
* The `setProj4()` function from the `ol/proj` module was removed.
* A new `ol/proj/proj4` module with a `register()` function was added. Regardless of whether the application imports `proj4` or uses a global `proj4`, this function needs to be called with the proj4 instance as argument whenever projection definitions were added to proj4's registry with (`proj4.defs`).
It is also recommended to no longer use a global `proj4`. Instead,
npm install proj4
and import it:
```js
importproj4from'proj4';
```
Applications can be updated by importing the `register` function from the `ol/proj/proj4` module
```js
import{register}from'ol/proj/proj4'
```
and calling it before using projections, and any time the proj4 registry was changed by `proj4.defs()` calls:
```js
register(proj4);
```
#### Removal of logos
The map and sources no longer accept a `logo` option. Instead, if you wish to append a logo to your map, add the desired markup directly in your HTML. In addition, you can use the `attributions` property of a source to display arbitrary markup per-source with the attribution control.
#### Replacement of `ol/Sphere` constructor with `ol/sphere` functions
The `ol/Sphere` constructor has been removed. If you were using the `getGeodesicArea` method, use the `getArea` function instead. If you were using the `haversineDistance` method, use the `getDistance` function instead.
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).
#### `Map#forEachLayerAtPixel` parameters have changed
If you are using the layer filter, please note that you now have to pass in the layer filter via an `AtPixelOptions` object. If you are not using the layer filter the usage has not changed.
To bind a function to a this, please use the bind method of the function (See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).
This change is due to the introduction of the `hitTolerance` parameter which can be passed in via this `AtPixelOptions` object, too.
### v4.6.0
#### Renamed `exceedLength` option of `ol.style.Text` to `overflow`
To update your applications, simply replace `exceedLength` with `overflow`.
#### Deprecation of `ol.source.ImageVector`
Rendering vector sources as image is now directly supported by `ol.layer.Vector` with the new `renderMode: 'image'` configuration option. Change code like this:
```js
newol.layer.Image({
source:newol.source.ImageVector({
style:myStyle,
source:newol.source.Vector({
url:'my/data.json',
format:newol.format.GeoJSON()
})
})
});
```
to:
```js
newol.layer.Vector({
renderMode:'image',
style:myStyle,
source:newol.source.Vector({
url:'my/data.json',
format:newol.format.GeoJSON()
})
});
```
### v4.5.0
#### Removed GeoJSON crs workaround for GeoServer
Previous version of GeoServer returned invalid crs in GeoJSON output. The workaround in `ol.format.GeoJSON` used to read this crs code is now removed.
#### Deprecation of `ol.Attribution`
`ol.Attribution` is deprecated and will be removed in the next major version. Instead, you can construct a source with a string attribution or an array of strings. For dynamic attributions, you can provide a function that gets called with the current frame state.
Before:
```js
varsource=newol.source.XYZ({
attributions:[
newol.Attribution({html:'some attribution'})
]
});
```
After:
```js
varsource=newol.source.XYZ({
attributions:'some attribution'
});
```
In addition to passing a string or an array of strings for the `attributions` option, you can also pass a function that will get called with the current frame state.
```js
varsource=newol.source.XYZ({
attributions:function(frameState){
// inspect the frame state and return attributions
return'some attribution';// or ['multiple', 'attributions'] or null
}
});
```
### v4.4.0
#### Behavior change for polygon labels
Polygon labels are now only rendered when the label does not exceed the polygon at the label position. To get the old behavior, configure your `ol.style.Text` with `exceedLength: true`.
#### Minor change for custom `tileLoadFunction` with `ol.source.VectorTile`
It is no longer necessary to set the projection on the tile. Instead, the `readFeatures` method must be called with the tile's extent as `extent` option and the view's projection as `featureProjection`.
Before:
```js
tile.setLoader(function(){
vardata=// ... fetch data
varformat=tile.getFormat();
tile.setFeatures(format.readFeatures(data));
tile.setProjection(format.readProjection(data));
// uncomment the line below for ol.format.MVT only
//tile.setExtent(format.getLastExtent());
});
```
After:
```js
tile.setLoader(function(){
vardata=// ... fetch data
varformat=tile.getFormat();
tile.setFeatures(format.readFeatures(data,{
featureProjection:map.getView().getProjection(),
// uncomment the line below for ol.format.MVT only
//extent: tile.getExtent()
}));
);
```
#### Deprecation of `ol.DeviceOrientation`
`ol.DeviceOrientation` is deprecated and will be removed in the next major version.
The device-orientation example has been updated to use the (gyronorm.js)[https://github.com/dorukeker/gyronorm.js] library.
### v4.3.0
#### `ol.source.VectorTile` no longer requires a `tileGrid` option
By default, the `ol.source.VectorTile` constructor creates an XYZ tile grid (in Web Mercator) for 512 pixel tiles and assumes a max zoom level of 22. If you were creating a vector tile source with an explicit `tileGrid` option, you can now remove this.
If you need to change the max zoom level, you can pass the source a `maxZoom` option. If you need to change the tile size, you can pass the source a `tileSize` option. If you need a completely custom tile grid, you can still pass the source a `tileGrid` option.
#### `ol.interaction.Modify` deletes with `alt` key only
To delete features with the modify interaction, press the `alt` key while clicking on an existing vertex. If you want to configure the modify interaction with a different delete condition, use the `deleteCondition` option. For example, to allow deletion on a single click with no modifier keys, configure the interaction like this:
The motivation for this change is to make the modify, draw, and snap interactions all work well together. Previously, the use of these interactions with the default configuration would make it so you couldn't reliably add new vertices (click with no modifier) and delete existing vertices (click with no modifier).
#### `ol.source.VectorTile` no longer has a `tilePixelRatio` option
The `tilePixelRatio` option was only used for tiles in projections with `tile-pixels` as units. For tiles read with `ol.format.MVT` and the default tile loader, or tiles with the default pixel size of 4096 pixels, no changes are necessary. For the very rare cases that do not fall under these categories, a custom `tileLoadFunction` now needs to be configured on the `ol.source.VectorTile`. In addition to calling `tile.setFeatures()` and `tile.setProjection()`, it also needs to contain code like the following:
#### `ol.animate` now takes the shortest arc for rotation animation
Usually rotation animations should animate along the shortest arc. There are rare occasions where a spinning animation effect is desired. So if you previously had something like
```js
map.getView().animate({
rotation:2*Math.PI,
duration:2000
});
```
we recommend to split the animation into two parts and use different easing functions. The code below results in the same effect as the snippet above did with previous versions:
```js
map.getView().animate({
rotation:Math.PI,
easing:ol.easing.easeIn
},{
rotation:2*Math.PI,
easing:ol.easing.easeOut
});
```
### v4.2.0
#### Return values of two `ol.style.RegularShape` getters have changed
To provide a more consistent behaviour the following getters now return the same value that was given to constructor:
`ol.style.RegularShape#getPoints` does not return the double amount of points anymore if a radius2 is set.
`ol.style.RegularShape#getRadius2` will return `undefined` if no radius2 is set.
### v4.1.0
#### Adding duplicate layers to a map throws
Previously, you could do this:
```js
map.addLayer(layer);
map.addLayer(layer);
```
However, after adding a duplicate layer, things failed if you tried to remove that layer.
Now, `map.addLayer()` throws if you try adding a layer that has already been added to the map.
#### Simpler `constrainResolution` configuration
The `constrainResolution` configuration for `ol.interaction.PinchZoom` and `ol.interaction.MouseWheelZoom`
can now be set directly with an option in `ol.interaction.defaults`:
The v4.0.1 release is a patch release that addresses a regression in the v4.0.0 release. The fix makes pinch zooming work again properly when the two fingers are not placed on the screen at the same time.
See the [v4.0.0 release notes](https://github.com/openlayers/openlayers/releases/tag/v4.0.0) for details on upgrading from v3.20.x.
## Fix
* [#6486](https://github.com/openlayers/openlayers/pull/6486) - Do not set center when touches count has changed ([@ahocevar](https://github.com/ahocevar))
The v4.1.0 release includes features and fixes from 91 pull requests.
#### Interactive overview map
The extent rectangle on the overview map can now be dragged to control the view for the main map.
#### Setting min and max zoom for a view
You can now change the min or max zoom for a view after it has been created. This can be useful if you want to limit how far out users can zoom based on changes in viewport width (use `view.setMinZoom()` for this).
#### Adding duplicate layers to a map throws
Previously, you could do this:
```js
map.addLayer(layer);
map.addLayer(layer);
```
However, after adding a duplicate layer, things failed if you tried to remove that layer.
Now, `map.addLayer()` throws if you try adding a layer that has already been added to the map.
#### Simpler `constrainResolution` configuration
The `constrainResolution` configuration for `ol.interaction.PinchZoom` and `ol.interaction.MouseWheelZoom`
can now be set directly with an option in `ol.interaction.defaults`:
```js
ol.interaction.defaults({
constrainResolution:true
});
```
## Detailed changes
* [#6675](https://github.com/openlayers/openlayers/pull/6675) - Reset cursor when translate interaction is removed or deactivated ([@tchandelle](https://github.com/tchandelle))
* [#6707](https://github.com/openlayers/openlayers/pull/6707) - Set version when building ol package ([@tschaub](https://github.com/tschaub))
* [#6706](https://github.com/openlayers/openlayers/pull/6706) - Add ol.source.Cluster#getDistance function ([@fredj](https://github.com/fredj))
* [#6704](https://github.com/openlayers/openlayers/pull/6704) - Include typedefs.js in closure compiler tutorial build configurations ([@openlayers](https://github.com/openlayers))
* [#6702](https://github.com/openlayers/openlayers/pull/6702) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6693](https://github.com/openlayers/openlayers/pull/6693) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6691](https://github.com/openlayers/openlayers/pull/6691) - Move eslint globals to to test/.eslintrc ([@fredj](https://github.com/fredj))
* [#6689](https://github.com/openlayers/openlayers/pull/6689) - Add new constrainResolution option to olx.interaction.DefaultsOptions ([@fredj](https://github.com/fredj))
* [#6692](https://github.com/openlayers/openlayers/pull/6692) - Improve docs for MouseWheelZoom constrainResolution ([@ahocevar](https://github.com/ahocevar))
* [#6687](https://github.com/openlayers/openlayers/pull/6687) - Clip image only if the layer extent intersects the view extent ([@tchandelle](https://github.com/tchandelle))
* [#6686](https://github.com/openlayers/openlayers/pull/6686) - Update finishCoordinate in ol.interaction.Draw#removeLastPoint ([@fredj](https://github.com/fredj))
* [#6682](https://github.com/openlayers/openlayers/pull/6682) - Add example, docs and typedef for MouseWheelZoom's constrainResolution option ([@ahocevar](https://github.com/ahocevar))
* [#6683](https://github.com/openlayers/openlayers/pull/6683) - Add this jsdoc tag to ol.interaction.DragBox.defaultBoxEndCondition ([@fredj](https://github.com/fredj))
* [#6681](https://github.com/openlayers/openlayers/pull/6681) - Add constrainResolution in olx.interaction.PinchZoomOptions typedef ([@fredj](https://github.com/fredj))
* [#6671](https://github.com/openlayers/openlayers/pull/6671) - Add constraintResolution option to MouseWheelZoom for zoom with trackpad ([@kaiCu](https://github.com/kaiCu))
* [#6680](https://github.com/openlayers/openlayers/pull/6680) - Remove ol.DRAG_BOX_HYSTERESIS_PIXELS define and add option ([@fredj](https://github.com/fredj))
* [#6666](https://github.com/openlayers/openlayers/pull/6666) - Use the optional extent in ol.structs.RBush#getExtent ([@fredj](https://github.com/fredj))
* [#6670](https://github.com/openlayers/openlayers/pull/6670) - fix(package): update browserify to version 14.3.0 ([@openlayers](https://github.com/openlayers))
* [#6664](https://github.com/openlayers/openlayers/pull/6664) - Update async to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6659](https://github.com/openlayers/openlayers/pull/6659) - Add crossOrigin to examples using ol.style.Icon ([@openlayers](https://github.com/openlayers))
* [#6658](https://github.com/openlayers/openlayers/pull/6658) - Fixes for raster source rendering ([@tschaub](https://github.com/tschaub))
* [#6620](https://github.com/openlayers/openlayers/pull/6620) - Fix the parsing of flat coordinates in GML2 for 3D geometies ([@Jenselme](https://github.com/Jenselme))
* [#6657](https://github.com/openlayers/openlayers/pull/6657) - Update coveralls to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6644](https://github.com/openlayers/openlayers/pull/6644) - Allow minZoom and maxZoom to be set on a view ([@tschaub](https://github.com/tschaub))
* [#6636](https://github.com/openlayers/openlayers/pull/6636) - Add test for the metric unit displayed in the scaleline ([@fredj](https://github.com/fredj))
* [#6598](https://github.com/openlayers/openlayers/pull/6598) - Add support of micrometers to scaleline ([@hajjimurad](https://github.com/hajjimurad))
* [#6643](https://github.com/openlayers/openlayers/pull/6643) - Add common transforms by default ([@tschaub](https://github.com/tschaub))
* [#6567](https://github.com/openlayers/openlayers/pull/6567) - Overlay visible before updating render position ([@nagytech](https://github.com/nagytech))
* [#6634](https://github.com/openlayers/openlayers/pull/6634) - Fix custom build when openlayers is installed from yarn package manager ([@Toilal](https://github.com/Toilal))
* [#6639](https://github.com/openlayers/openlayers/pull/6639) - Update async to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6627](https://github.com/openlayers/openlayers/pull/6627) - Change css selector for user-select none ([@bartvde](https://github.com/bartvde))
* [#6626](https://github.com/openlayers/openlayers/pull/6626) - Respect cacheSize for reprojected caches ([@ahocevar](https://github.com/ahocevar))
* [#6623](https://github.com/openlayers/openlayers/pull/6623) - Fix outerWidth and outerHeight calculation in IE ([@ahocevar](https://github.com/ahocevar))
* [#6625](https://github.com/openlayers/openlayers/pull/6625) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6622](https://github.com/openlayers/openlayers/pull/6622) - Fix proj4 type ([@gberaudo](https://github.com/gberaudo))
* [#6617](https://github.com/openlayers/openlayers/pull/6617) - Use GeoServer/GWC caching when possible ([@ahocevar](https://github.com/ahocevar))
* [#6616](https://github.com/openlayers/openlayers/pull/6616) - Fix closing tag in gml tests ([@fredj](https://github.com/fredj))
* [#6612](https://github.com/openlayers/openlayers/pull/6612) - Add support for WFS 1.0.0 to ol.format.WFS#writeTransaction ([@Jenselme](https://github.com/Jenselme))
* [#6589](https://github.com/openlayers/openlayers/pull/6589) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6592](https://github.com/openlayers/openlayers/pull/6592) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6594](https://github.com/openlayers/openlayers/pull/6594) - Update fs-extra to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6570](https://github.com/openlayers/openlayers/pull/6570) - Don't use deprecated sinon.stub(obj, 'meth', fn) ([@openlayers](https://github.com/openlayers))
* [#6569](https://github.com/openlayers/openlayers/pull/6569) - Return null if the layer was not found in the WMTS capabilities ([@fredj](https://github.com/fredj))
* [#6551](https://github.com/openlayers/openlayers/pull/6551) - Use the default fill and stroke color ([@fredj](https://github.com/fredj))
* [#6559](https://github.com/openlayers/openlayers/pull/6559) - Remove unneeded type cast ([@fredj](https://github.com/fredj))
* [#6558](https://github.com/openlayers/openlayers/pull/6558) - Update coveralls to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6553](https://github.com/openlayers/openlayers/pull/6553) - Update proj4 to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6554](https://github.com/openlayers/openlayers/pull/6554) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6549](https://github.com/openlayers/openlayers/pull/6549) - Make getAnimating and cancelAnimations @api ([@bartvde](https://github.com/bartvde))
* [#6547](https://github.com/openlayers/openlayers/pull/6547) - Clean up left-over code from animation changes ([@bartvde](https://github.com/bartvde))
* [#6540](https://github.com/openlayers/openlayers/pull/6540) - More precise ol.Geolocation#getAccuracyGeometry return type ([@openlayers](https://github.com/openlayers))
* [#6539](https://github.com/openlayers/openlayers/pull/6539) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6535](https://github.com/openlayers/openlayers/pull/6535) - Update closure-util to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6529](https://github.com/openlayers/openlayers/pull/6529) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6530](https://github.com/openlayers/openlayers/pull/6530) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6515](https://github.com/openlayers/openlayers/pull/6515) - Add view methods for getting max zoom, min zoom, and any zoom for a resolution ([@tschaub](https://github.com/tschaub))
* [#6520](https://github.com/openlayers/openlayers/pull/6520) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6518](https://github.com/openlayers/openlayers/pull/6518) - Fix olx.style.IconOptions.prototype.src type ([@fredj](https://github.com/fredj))
* [#6513](https://github.com/openlayers/openlayers/pull/6513) - Update async to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6512](https://github.com/openlayers/openlayers/pull/6512) - Complete animations at target values ([@tschaub](https://github.com/tschaub))
* [#6511](https://github.com/openlayers/openlayers/pull/6511) - Revert accidently committed example change ([@ahocevar](https://github.com/ahocevar))
* [#6507](https://github.com/openlayers/openlayers/pull/6507) - ol.DEBUG no longer needed in transforms/module.js ([@probins](https://github.com/probins))
* [#6505](https://github.com/openlayers/openlayers/pull/6505) - Update ol package to include Browserify config ([@tschaub](https://github.com/tschaub))
* [#6504](https://github.com/openlayers/openlayers/pull/6504) - Determine if we should handle the drawing while the pointer is moving ([@tchandelle](https://github.com/tchandelle))
* [#6499](https://github.com/openlayers/openlayers/pull/6499) - Be more tolerant when comparing vertices when modifying a circle ([@tchandelle](https://github.com/tchandelle))
* [#6498](https://github.com/openlayers/openlayers/pull/6498) - Travis failing on master - use Node v6.1.x ([@ahocevar](https://github.com/ahocevar))
* [#6483](https://github.com/openlayers/openlayers/pull/6483) - Fix renderer.canvas.TileLayer to calculate correct canvas height for drawing. ([@nearmap](https://github.com/nearmap))
* [#6488](https://github.com/openlayers/openlayers/pull/6488) - Do not draw circle when pointer not moved and freehand is on ([@tchandelle](https://github.com/tchandelle))
* [#6491](https://github.com/openlayers/openlayers/pull/6491) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
This is a patch release to fix several minor issues and two regressions in the [4.1.0 release](https://github.com/openlayers/openlayers/releases/tag/v4.1.0).
## Changes
* [#6711](https://github.com/openlayers/openlayers/pull/6711) - Correct path to cleancss ([@tschaub](https://github.com/tschaub))
The v4.2.0 release includes features and fixes from 87 pull requests.
#### New `movestart` event on `ol.Map`
The map now has a `movestart` event, as countarpart to the already existing `moveend` event.
#### New `moveTolerance` option in `ol.Map`
Some touch devices do not play well with OpenLayers's way of detecting clicks. To overcome this, a new `moveTolerance` option was introduced, so users can override the 1 pixel threshold above which a touch-release sequence won't be considered a click any more.
#### Support for multiple layers in `ol.format.TopoJSON`
With the new `layerName` and `layers` options, applications can extract the layer as additional attribute for vector features from `ol.format.TopoJSON`. This can especially be useful for styling vector tile layers.
#### New `tileJSON` option for `ol.source.TileJSON`
Like `ol.source.TileUTFGrid`, `ol.source.TileJSON` now also has a `tileJSON` option to configue it with inline TileJSON instead of a TileJSON URL.
#### New `ol.format.filter.during` filter
Although OpenLayers has no support for WFS v2.0, we added `ol.format.filter.during` for the `During` temporal operator.
#### Improved vector tile rendering at non-native resolutions
The vector tile renderer now uses an internal tile grid for all resolutions to cache pre-rendered tiles, even if the tile source does not have tiles for the viewed resolution. This improves rendering quality and performance.
#### New `insertVertexCondition` for `ol.interaction.Modify`
Applications can now control whether a vertex will be inserted into the modified geometry. This makes it easier to modify custom geometries.
#### New `callback` option for `ol.View#fit()`
To allow applications to perform custom actions when an animation associated with `ol.View#fit()` is completed, that method now has a new `callback` option.
#### New `ol.View#getInteracting()` getter
Like `ol.View#getAnimating()` returns `true` during a view animation, `ol.View#getInteracting()` returns `true` while users are interacting with the view.
#### New `hasZ` option for `ol.format.WFS#writeTransaction()`
When the new `hasZ` option is set to `true`, 3D coordinates will be preserved and encoded when writing a WFS transaction.
#### New `wrapX` option for `ol.source.Stamen`
Like other tile sources, `ol.source.Stamen` now also has a `wrapX` option, which allows applications to turn off wrapping the world in x direction.
#### Label support for `ol.Graticule`
The `ol.Graticule` component has several new options to add and control the output of labels. To turn on labelling, configure `ol.Graticule` with `showLabels: true`. The new options to control label formatting are `lonLabelFormatter`, `latLabelFormatter`, `lonLabelPosition` and `latLabelPosition`.
#### Return values of two `ol.style.RegularShape` getters have changed
To provide a more consistent behaviour the following getters now return the same value that was given to constructor:
`ol.style.RegularShape#getPoints` does not return the double amount of points anymore if a radius2 is set.
`ol.style.RegularShape#getRadius2` will return `undefined` if no radius2 is set.
## Detailed changes
* [#6912](https://github.com/openlayers/openlayers/pull/6912) - Use class instead of style for Translate cursor ([@ahocevar](https://github.com/ahocevar))
* [#6890](https://github.com/openlayers/openlayers/pull/6890) - Add a movestart event ([@ahocevar](https://github.com/ahocevar))
* [#6910](https://github.com/openlayers/openlayers/pull/6910) - Avoid duplicates in Observables list ([@ahocevar](https://github.com/ahocevar))
* [#6902](https://github.com/openlayers/openlayers/pull/6902) - Require minimum duration for kinetic animation ([@ahocevar](https://github.com/ahocevar))
* [#6904](https://github.com/openlayers/openlayers/pull/6904) - chore(package): update sinon to version 2.3.4 ([@openlayers](https://github.com/openlayers))
* [#6901](https://github.com/openlayers/openlayers/pull/6901) - Added release note for changed methods of ol.style.regularShape ([@KlausBenndorf](https://github.com/KlausBenndorf))
* [#6886](https://github.com/openlayers/openlayers/pull/6886) - Make ol.source.Cluster extensible ([@gberaudo](https://github.com/gberaudo))
* [#6887](https://github.com/openlayers/openlayers/pull/6887) - Disable rotation for views with enableRotation: false ([@ahocevar](https://github.com/ahocevar))
* [#6900](https://github.com/openlayers/openlayers/pull/6900) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6897](https://github.com/openlayers/openlayers/pull/6897) - ProjectionLike in proj.getPointResolution ([@probins](https://github.com/probins))
* [#6888](https://github.com/openlayers/openlayers/pull/6888) - Add note about custom functions to getPointResolution ([@probins](https://github.com/probins))
* [#6893](https://github.com/openlayers/openlayers/pull/6893) - Fix decimals options when writing features ([@tchandelle](https://github.com/tchandelle))
* [#6892](https://github.com/openlayers/openlayers/pull/6892) - Accept a ol.ProjectionLike instead of ol.proj.Projection ([@fredj](https://github.com/fredj))
* [#6883](https://github.com/openlayers/openlayers/pull/6883) - Remove unused ol.pointer.EventSource#getMapping function ([@fredj](https://github.com/fredj))
* [#6870](https://github.com/openlayers/openlayers/pull/6870) - Center map on proper earth, not one to the left ([@kannes](https://github.com/kannes))
* [#6872](https://github.com/openlayers/openlayers/pull/6872) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6876](https://github.com/openlayers/openlayers/pull/6876) - Only test ol.interaction.DragAndDrop if FileReader is supported ([@fredj](https://github.com/fredj))
* [#6874](https://github.com/openlayers/openlayers/pull/6874) - Remove unused var from ol.proj ([@probins](https://github.com/probins))
* [#6875](https://github.com/openlayers/openlayers/pull/6875) - chore(package): update sinon to version 2.3.2 ([@openlayers](https://github.com/openlayers))
* [#6867](https://github.com/openlayers/openlayers/pull/6867) - add getArea to api ([@cs09g](https://github.com/cs09g))
* [#6863](https://github.com/openlayers/openlayers/pull/6863) - change size to optional ([@cs09g](https://github.com/cs09g))
* [#6864](https://github.com/openlayers/openlayers/pull/6864) - fix(package): update closure-util to version 1.21.0 ([@openlayers](https://github.com/openlayers))
* [#6856](https://github.com/openlayers/openlayers/pull/6856) - Fix creation of new URL in readSharedStyle_ and readSharedStyleMap_ ([@oterral](https://github.com/oterral))
* [#6852](https://github.com/openlayers/openlayers/pull/6852) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6851](https://github.com/openlayers/openlayers/pull/6851) - Register/unregister listeners in setActive ([@ahocevar](https://github.com/ahocevar))
* [#6832](https://github.com/openlayers/openlayers/pull/6832) - Force state of error tiles when usInterimTilesOnError is false ([@oterral](https://github.com/oterral))
* [#6849](https://github.com/openlayers/openlayers/pull/6849) - Create URL object only when we can ([@oterral](https://github.com/oterral))
* [#6845](https://github.com/openlayers/openlayers/pull/6845) - Snap on circles ([@tchandelle](https://github.com/tchandelle))
* [#6842](https://github.com/openlayers/openlayers/pull/6842) - add condition to check if active ([@cs09g](https://github.com/cs09g))
* [#6844](https://github.com/openlayers/openlayers/pull/6844) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6841](https://github.com/openlayers/openlayers/pull/6841) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6839](https://github.com/openlayers/openlayers/pull/6839) - Update async to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6838](https://github.com/openlayers/openlayers/pull/6838) - fix(package): update handlebars to version 4.0.10 ([@openlayers](https://github.com/openlayers))
* [#6817](https://github.com/openlayers/openlayers/pull/6817) - Multiple layers in TopoJSON vector tiles ([@ahocevar](https://github.com/ahocevar))
* [#6833](https://github.com/openlayers/openlayers/pull/6833) - Fix geojson-vt example for line and point geometries ([@oterral](https://github.com/oterral))
* [#6829](https://github.com/openlayers/openlayers/pull/6829) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6819](https://github.com/openlayers/openlayers/pull/6819) - Adjust/fix API for working with vector tile features ([@ahocevar](https://github.com/ahocevar))
* [#6818](https://github.com/openlayers/openlayers/pull/6818) - Add tileJSON option to ol.source.TileJSON ([@ahocevar](https://github.com/ahocevar))
* [#6805](https://github.com/openlayers/openlayers/pull/6805) - Display country name on click select ([@fredj](https://github.com/fredj))
* [#6813](https://github.com/openlayers/openlayers/pull/6813) - Prepend the version with a v ([@tschaub](https://github.com/tschaub))
* [#6806](https://github.com/openlayers/openlayers/pull/6806) - Add note about features with the same id ([@drnextgis](https://github.com/drnextgis))
* [#6802](https://github.com/openlayers/openlayers/pull/6802) - Remove unused setFeatures and getFormat methods ([@ahocevar](https://github.com/ahocevar))
* [#6801](https://github.com/openlayers/openlayers/pull/6801) - Add getId method for ol.render.Feature ([@ahocevar](https://github.com/ahocevar))
* [#6778](https://github.com/openlayers/openlayers/pull/6778) - Add a small tolerance when testing pointer event positions ([@fredj](https://github.com/fredj))
* [#6798](https://github.com/openlayers/openlayers/pull/6798) - chore(package): update clean-css-cli to version 4.1.2 ([@openlayers](https://github.com/openlayers))
* [#6795](https://github.com/openlayers/openlayers/pull/6795) - Fix ol.DrawGeometryFunctionType coordinates argument type ([@fredj](https://github.com/fredj))
* [#6797](https://github.com/openlayers/openlayers/pull/6797) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6779](https://github.com/openlayers/openlayers/pull/6779) - Decouple source and rendered tile grid of vector tile sources ([@ahocevar](https://github.com/ahocevar))
* [#6785](https://github.com/openlayers/openlayers/pull/6785) - Add insertVertexCondition to ol.interaction.Modify options ([@fredj](https://github.com/fredj))
* [#6792](https://github.com/openlayers/openlayers/pull/6792) - Create intermediate canvas when resolutions have changed ([@ahocevar](https://github.com/ahocevar))
* [#6790](https://github.com/openlayers/openlayers/pull/6790) - Update resemblejs to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6784](https://github.com/openlayers/openlayers/pull/6784) - chore(package): update clean-css-cli to version 4.1.0 ([@openlayers](https://github.com/openlayers))
* [#6775](https://github.com/openlayers/openlayers/pull/6775) - Update closure-util to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6774](https://github.com/openlayers/openlayers/pull/6774) - Update fs-extra to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6770](https://github.com/openlayers/openlayers/pull/6770) - Enforce the "no missing requires" rule ([@tschaub](https://github.com/tschaub))
* [#6772](https://github.com/openlayers/openlayers/pull/6772) - Remove html tag from shortdesc ([@fredj](https://github.com/fredj))
* [#6769](https://github.com/openlayers/openlayers/pull/6769) - Update handlebars to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6757](https://github.com/openlayers/openlayers/pull/6757) - Fix crashing on creation of snap-interaction, if Circle is among the features to snap to. ([@hajjimurad](https://github.com/hajjimurad))
* [#6766](https://github.com/openlayers/openlayers/pull/6766) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6765](https://github.com/openlayers/openlayers/pull/6765) - Add new callback function to view.FitOptions ([@fredj](https://github.com/fredj))
* [#6764](https://github.com/openlayers/openlayers/pull/6764) - Added View#getInteracting() to the api ([@mblinsitu](https://github.com/mblinsitu))
* [#6760](https://github.com/openlayers/openlayers/pull/6760) - Update handlebars to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6761](https://github.com/openlayers/openlayers/pull/6761) - Update async to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6751](https://github.com/openlayers/openlayers/pull/6751) - Update coveralls to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6750](https://github.com/openlayers/openlayers/pull/6750) - Update fs-extra to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6741](https://github.com/openlayers/openlayers/pull/6741) - Allow user selection in overlay container ([@fredj](https://github.com/fredj))
* [#6744](https://github.com/openlayers/openlayers/pull/6744) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6730](https://github.com/openlayers/openlayers/pull/6730) - Update metalsmith-layouts to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6732](https://github.com/openlayers/openlayers/pull/6732) - Use firefox < 53 in travis ([@fredj](https://github.com/fredj))
* [#6677](https://github.com/openlayers/openlayers/pull/6677) - Add an option to writeTransaction to support 3D geometries ([@Jenselme](https://github.com/Jenselme))
* [#6727](https://github.com/openlayers/openlayers/pull/6727) - Add default value in doc for the hitTolerance option ([@fredj](https://github.com/fredj))
* [#6724](https://github.com/openlayers/openlayers/pull/6724) - Add wrapX option to Stamen source ([@fredj](https://github.com/fredj))
The new `ol.Sphere.getArea()` and `ol.Sphere.getLength()` methods can be used to calculate spherical measures on geometries. This is the recommended over using the `geometry.getArea()` or `geometry.getLength()` methods.
Bad:
```js
geometry.getArea();
```
Good:
```js
ol.Sphere.getArea(geometry);
```
#### `ol.interaction.DragAndDrop` can be configured with a vector source
It is now possible to configure the drag and drop interaction with a vector source:
With this configuration, all features on the source are eligible for modification while the interaction is active.
#### `ol.interaction.Modify` deletes with `alt` key only
To delete features with the modify interaction, press the `alt` key while clicking on an existing vertex. If you want to configure the modify interaction with a different delete condition, use the `deleteCondition` option. For example, to allow deletion on a single click with no modifier keys, configure the interaction like this:
The motivation for this change is to make the modify, draw, and snap interactions all work well together. Previously, the use of these interactions with the default configuration would make it so you couldn't reliably add new vertices (click with no modifier) and delete existing vertices (click with no modifier).
#### `ol.source.VectorTile` no longer requires a `tileGrid` option
By default, the `ol.source.VectorTile` constructor creates an XYZ tile grid (in Web Mercator) for 512 pixel tiles and assumes a max zoom level of 22. If you were creating a vector tile source with an explicit `tileGrid` option, you can now remove this.
If you need to change the max zoom level, you can pass the source a `maxZoom` option. If you need to change the tile size, you can pass the source a `tileSize` option. If you need a completely custom tile grid, you can still pass the source a `tileGrid` option.
#### `ol.source.VectorTile` no longer has a `tilePixelRatio` option
The `tilePixelRatio` option was only used for tiles in projections with `tile-pixels` as units. For tiles read with `ol.format.MVT` and the default tile loader, or tiles with the default pixel size of 4096 pixels, no changes are necessary. For the very rare cases that do not fall under these categories, a custom `tileLoadFunction` now needs to be configured on the `ol.source.VectorTile`. In addition to calling `tile.setFeatures()` and `tile.setProjection()`, it also needs to contain code like the following:
#### `ol.animate` now takes the shortest arc for rotation animation
Usually rotation animations should animate along the shortest arc. There are rare occasions where a spinning animation effect is desired. So if you previously had something like
```js
map.getView().animate({
rotation:2*Math.PI,
duration:2000
});
```
we recommend to split the animation into two parts and use different easing functions. The code below results in the same effect as the snippet above did with previous versions:
```js
map.getView().animate({
rotation:Math.PI,
easing:ol.easing.easeIn
},{
rotation:2*Math.PI,
easing:ol.easing.easeOut
});
```
## Full List of Changes
* [#7117](https://github.com/openlayers/openlayers/pull/7117) - Sensible default tilegrid for vector tiles ([@tschaub](https://github.com/tschaub))
* [#7116](https://github.com/openlayers/openlayers/pull/7116) - fix(package): update rollup to version 0.47.2 ([@openlayers](https://github.com/openlayers))
* [#7111](https://github.com/openlayers/openlayers/pull/7111) - Remove broken wrapX handling from ol.Graticule ([@ahocevar](https://github.com/ahocevar))
* [#7107](https://github.com/openlayers/openlayers/pull/7107) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7106](https://github.com/openlayers/openlayers/pull/7106) - Update proj4 to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7105](https://github.com/openlayers/openlayers/pull/7105) - Functions for spherical calculations ([@tschaub](https://github.com/tschaub))
* [#7104](https://github.com/openlayers/openlayers/pull/7104) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6807](https://github.com/openlayers/openlayers/pull/6807) - Initialize hasZ in the constructor of GML3 ([@Jenselme](https://github.com/Jenselme))
* [#7102](https://github.com/openlayers/openlayers/pull/7102) - Allow drag and drop interaction to be configured with a source ([@tschaub](https://github.com/tschaub))
* [#6825](https://github.com/openlayers/openlayers/pull/6825) - Read/write Tessellate tag in KML format ([@oterral](https://github.com/oterral))
* [#7098](https://github.com/openlayers/openlayers/pull/7098) - Use fractional coordinates for CSS positioning ([@ahocevar](https://github.com/ahocevar))
* [#7064](https://github.com/openlayers/openlayers/pull/7064) - Do not use Array.prototype.forEach when dealing with potentially large arrays ([@ahocevar](https://github.com/ahocevar))
* [#7093](https://github.com/openlayers/openlayers/pull/7093) - Allow modify interaction to be configured with a source ([@tschaub](https://github.com/tschaub))
* [#7096](https://github.com/openlayers/openlayers/pull/7096) - Add new Map#getFeaturesAtPixel method ([@ahocevar](https://github.com/ahocevar))
* [#7087](https://github.com/openlayers/openlayers/pull/7087) - Fix scale line for EPSG:4326 maps ([@ahocevar](https://github.com/ahocevar))
* [#7088](https://github.com/openlayers/openlayers/pull/7088) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7085](https://github.com/openlayers/openlayers/pull/7085) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7084](https://github.com/openlayers/openlayers/pull/7084) - Fix a typo in the street-labels example ([@ahocevar](https://github.com/ahocevar))
* [#7082](https://github.com/openlayers/openlayers/pull/7082) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7079](https://github.com/openlayers/openlayers/pull/7079) - Optimize custom renderer code, examples and API ([@ahocevar](https://github.com/ahocevar))
* [#7080](https://github.com/openlayers/openlayers/pull/7080) - Update jsdoc to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7078](https://github.com/openlayers/openlayers/pull/7078) - Fix return type annotation of ol.layer.VectorTile.getSource ([@geosense](https://github.com/geosense))
* [#7073](https://github.com/openlayers/openlayers/pull/7073) - Make ol.layer.Group change handling consistent ([@gberaudo](https://github.com/gberaudo))
* [#7075](https://github.com/openlayers/openlayers/pull/7075) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7072](https://github.com/openlayers/openlayers/pull/7072) - Improve API docs for ol.VectorTile ([@ahocevar](https://github.com/ahocevar))
* [#7070](https://github.com/openlayers/openlayers/pull/7070) - Get tilePixelRatio from MVT tiles ([@ahocevar](https://github.com/ahocevar))
* [#7069](https://github.com/openlayers/openlayers/pull/7069) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7068](https://github.com/openlayers/openlayers/pull/7068) - Update fs-extra to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7066](https://github.com/openlayers/openlayers/pull/7066) - Fix ol.interaction.Extent event type and documentation ([@ahocevar](https://github.com/ahocevar))
* [#7065](https://github.com/openlayers/openlayers/pull/7065) - Only use API functions in example ([@ahocevar](https://github.com/ahocevar))
* [#7022](https://github.com/openlayers/openlayers/pull/7022) - Allow styles to configure a custom renderer ([@ahocevar](https://github.com/ahocevar))
* [#7061](https://github.com/openlayers/openlayers/pull/7061) - Update docs and issue and pull request instructions ([@ahocevar](https://github.com/ahocevar))
* [#7059](https://github.com/openlayers/openlayers/pull/7059) - Allow to configure Extent interaction with an extent ([@ahocevar](https://github.com/ahocevar))
* [#7034](https://github.com/openlayers/openlayers/pull/7034) - Move non-build dependencies to devDependencies ([@probins](https://github.com/probins))
* [#7050](https://github.com/openlayers/openlayers/pull/7050) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6976](https://github.com/openlayers/openlayers/pull/6976) - Example - Earthquake Clusters - Change evt.type of interaction ([@ehanoj](https://github.com/ehanoj))
* [#7048](https://github.com/openlayers/openlayers/pull/7048) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7041](https://github.com/openlayers/openlayers/pull/7041) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7042](https://github.com/openlayers/openlayers/pull/7042) - Line dash offset ([@gkresic](https://github.com/gkresic))
* [#6980](https://github.com/openlayers/openlayers/pull/6980) - Added tileClass to TileWMS ([@ZachTRice](https://github.com/ZachTRice))
* [#7028](https://github.com/openlayers/openlayers/pull/7028) - Fix Graticule use of incorrect min/maxLon values ([@greggian](https://github.com/greggian))
* [#7021](https://github.com/openlayers/openlayers/pull/7021) - Update fs-extra to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7018](https://github.com/openlayers/openlayers/pull/7018) - Update jsdoc to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7015](https://github.com/openlayers/openlayers/pull/7015) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7014](https://github.com/openlayers/openlayers/pull/7014) - Update jsdoc to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7013](https://github.com/openlayers/openlayers/pull/7013) - Remove ol.sphere.WGS84 and ol.sphere.NORMAL ([@tschaub](https://github.com/tschaub))
* [#6981](https://github.com/openlayers/openlayers/pull/6981) - Render transparent vector layers to an intermediate canvas ([@gberaudo](https://github.com/gberaudo))
* [#6899](https://github.com/openlayers/openlayers/pull/6899) - Use number literal for sphere radius ([@probins](https://github.com/probins))
* [#7011](https://github.com/openlayers/openlayers/pull/7011) - Update jsdoc to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7008](https://github.com/openlayers/openlayers/pull/7008) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7007](https://github.com/openlayers/openlayers/pull/7007) - fix(package): update rollup to version 0.45.0 ([@openlayers](https://github.com/openlayers))
* [#6996](https://github.com/openlayers/openlayers/pull/6996) - 6987: Memory leak with WMS time source with reprojection ([@ch08532](https://github.com/ch08532))
* [#7003](https://github.com/openlayers/openlayers/pull/7003) - Update jsdoc to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7004](https://github.com/openlayers/openlayers/pull/7004) - Use https for bing and stamen attributions ([@fredj](https://github.com/fredj))
* [#6998](https://github.com/openlayers/openlayers/pull/6998) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6999](https://github.com/openlayers/openlayers/pull/6999) - Make VectorTile source work with multiple layers ([@ahocevar](https://github.com/ahocevar))
* [#6988](https://github.com/openlayers/openlayers/pull/6988) - Add missing type annotations ([@ahocevar](https://github.com/ahocevar))
* [#6984](https://github.com/openlayers/openlayers/pull/6984) - Update closure-util to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6970](https://github.com/openlayers/openlayers/pull/6970) - Fix Bug when adding/removing layer with no cache ([@cmortazavi](https://github.com/cmortazavi))
* [#6973](https://github.com/openlayers/openlayers/pull/6973) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6971](https://github.com/openlayers/openlayers/pull/6971) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6966](https://github.com/openlayers/openlayers/pull/6966) - Add getResolutionForZoom method for ol.View ([@ahocevar](https://github.com/ahocevar))
* [#6965](https://github.com/openlayers/openlayers/pull/6965) - Use shortest rotation delta for animation ([@ahocevar](https://github.com/ahocevar))
* [#6967](https://github.com/openlayers/openlayers/pull/6967) - Add RoadOnDemand imagery set to Bing example ([@ahocevar](https://github.com/ahocevar))
* [#6955](https://github.com/openlayers/openlayers/pull/6955) - Update async to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6916](https://github.com/openlayers/openlayers/pull/6916) - Upgrade eslint to v4.0.0 ([@marcjansen](https://github.com/marcjansen))
* [#6943](https://github.com/openlayers/openlayers/pull/6943) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6939](https://github.com/openlayers/openlayers/pull/6939) - Abort loading when tile is disposed ([@ahocevar](https://github.com/ahocevar))
* [#6930](https://github.com/openlayers/openlayers/pull/6930) - Handle setActive(false) on an interaction without map ([@openlayers](https://github.com/openlayers))
* [#6936](https://github.com/openlayers/openlayers/pull/6936) - Do not stop the render loop when all wanted tiles are aborted ([@ahocevar](https://github.com/ahocevar))
* [#6920](https://github.com/openlayers/openlayers/pull/6920) - Fix minor type strength inconsistency ([@klokantech](https://github.com/klokantech))
* [#6935](https://github.com/openlayers/openlayers/pull/6935) - Use transparent image from canvas context ([@ahocevar](https://github.com/ahocevar))
* [#6931](https://github.com/openlayers/openlayers/pull/6931) - Make sure we use the default featurePrefix ([@bartvde](https://github.com/bartvde))
* [#6928](https://github.com/openlayers/openlayers/pull/6928) - Only adjust resolution when center within projection extent ([@ahocevar](https://github.com/ahocevar))
* [#6923](https://github.com/openlayers/openlayers/pull/6923) - Load tasks/build-ext.js in strict mode ([@fredj](https://github.com/fredj))
* [#7120](https://github.com/openlayers/openlayers/pull/7120) - Fix hit detection for overzoomed vector tiles ([@ahocevar](https://github.com/ahocevar))
* [#7114](https://github.com/openlayers/openlayers/pull/7114) - Immediate WebGL text renderer and other improvements ([@GaborFarkas](https://github.com/GaborFarkas))
The 4.4.0 release includes features and fixes from 80 pull requests, including first time contributions from @EduardoNogueira, @ath0mas, @f7o, @trevorblades, @viethang, and @wb14123. There are some really nice rendering enhancements included in this release. It is now possible to render labels along lines (see [#7239](https://github.com/openlayers/openlayers/pull/7239) for more detail) and polygon labels are only rendered if they fit within the polygon ([#7292](https://github.com/openlayers/openlayers/pull/7292)). In addition, we now render tiles with an opacity transition, so tiled layers more gracefully fade in ([#7267](https://github.com/openlayers/openlayers/pull/7267)).
### Upgrade notes
#### Behavior change for polygon labels
Polygon labels are now only rendered when the label does not exceed the polygon at the label position. To get the old behavior, configure your `ol.style.Text` with `exceedLength: true`.
#### Minor change for custom `tileLoadFunction` with `ol.source.VectorTile`
It is no longer necessary to set the projection on the tile. Instead, the `readFeatures` method must be called with the tile's extent as `extent` option and the view's projection as `featureProjection`.
Before:
```js
tile.setLoader(function(){
vardata=// ... fetch data
varformat=tile.getFormat();
tile.setFeatures(format.readFeatures(data));
tile.setProjection(format.readProjection(data));
// uncomment the line below for ol.format.MVT only
//tile.setExtent(format.getLastExtent());
});
```
After:
```js
tile.setLoader(function(){
vardata=// ... fetch data
varformat=tile.getFormat();
tile.setFeatures(format.readFeatures(data,{
featureProjection:map.getView().getProjection(),
// uncomment the line below for ol.format.MVT only
//extent: tile.getExtent()
}));
);
```
#### Deprecation of `ol.DeviceOrientation`
`ol.DeviceOrientation` is deprecated and will be removed in the next major version.
The device-orientation example has been updated to use the (gyronorm.js)[https://github.com/dorukeker/gyronorm.js] library.
* [#7287](https://github.com/openlayers/openlayers/pull/7287) - Fix vertical stroke/fill alignment for text along lines ([@ahocevar](https://github.com/ahocevar))
* [#7285](https://github.com/openlayers/openlayers/pull/7285) - Convert pointerId to string for object lookups ([@tschaub](https://github.com/tschaub))
* [#7280](https://github.com/openlayers/openlayers/pull/7280) - Updated docs for deleteCondition ([@EduardoNogueira](https://github.com/EduardoNogueira))
* [#7274](https://github.com/openlayers/openlayers/pull/7274) - Add ability to change the loader of a vector source ([@bartvde](https://github.com/bartvde))
* [#7259](https://github.com/openlayers/openlayers/pull/7259) - Add missing param doc tag for ol.format.WKT.prototype.writeFeatures ([@fredj](https://github.com/fredj))
* [#7258](https://github.com/openlayers/openlayers/pull/7258) - Revert changes made in #7098. ([@ahocevar](https://github.com/ahocevar))
* [#7220](https://github.com/openlayers/openlayers/pull/7220) - Mark ol.format.filter.Spatial as abstract class ([@fredj](https://github.com/fredj))
* [#7249](https://github.com/openlayers/openlayers/pull/7249) - Script to rename files so the case matches the module name ([@ahocevar](https://github.com/ahocevar))
* [#7252](https://github.com/openlayers/openlayers/pull/7252) - fix osmxml to read ways before the definition of nodes ([@wb14123](https://github.com/wb14123))
* [#7253](https://github.com/openlayers/openlayers/pull/7253) - Nicer wording in the issue template ([@openlayers](https://github.com/openlayers))
* [#7236](https://github.com/openlayers/openlayers/pull/7236) - reusing images in ol.style.Icon#clone ([@KlausBenndorf](https://github.com/KlausBenndorf))
* [#7246](https://github.com/openlayers/openlayers/pull/7246) - Compare measured lengths with a tolerance ([@marcjansen](https://github.com/marcjansen))
* [#7247](https://github.com/openlayers/openlayers/pull/7247) - Raise tolerance of rendering tests to pass on Firefox 55 (GNU/Linux) ([@marcjansen](https://github.com/marcjansen))
* [#7239](https://github.com/openlayers/openlayers/pull/7239) - Render text along lines ([@ahocevar](https://github.com/ahocevar))
* [#7242](https://github.com/openlayers/openlayers/pull/7242) - Use EMPTY and LOADED state properly on ol.VectorImageTile ([@ahocevar](https://github.com/ahocevar))
* [#7234](https://github.com/openlayers/openlayers/pull/7234) - Fix abort handling of tileload events ([@ahocevar](https://github.com/ahocevar))
* [#7221](https://github.com/openlayers/openlayers/pull/7221) - update zoomify source to accept tileIndex placeholders and handle iip… ([@thhomas](https://github.com/thhomas))
* [#6871](https://github.com/openlayers/openlayers/pull/6871) - Correct controls position in Center example ([@ath0mas](https://github.com/ath0mas))
* [#7229](https://github.com/openlayers/openlayers/pull/7229) - Fix JSDoc paths for custom builds ([@ahocevar](https://github.com/ahocevar))
* [#7230](https://github.com/openlayers/openlayers/pull/7230) - Remove unused context handling for ol.Image ([@ahocevar](https://github.com/ahocevar))
* [#7225](https://github.com/openlayers/openlayers/pull/7225) - Fix hit detection for image layers ([@ahocevar](https://github.com/ahocevar))
* [#7219](https://github.com/openlayers/openlayers/pull/7219) - Change cartodb domain from cartodb.com to carto.com ([@fredj](https://github.com/fredj))
* [#7210](https://github.com/openlayers/openlayers/pull/7210) - Avoid unnecessary calculations for a zoom factor of 2 ([@tschaub](https://github.com/tschaub))
* [#7201](https://github.com/openlayers/openlayers/pull/7201) - Prerender text to images ([@ahocevar](https://github.com/ahocevar))
* [#7208](https://github.com/openlayers/openlayers/pull/7208) - Do not calculate coverage when running tests locally ([@ahocevar](https://github.com/ahocevar))
* [#7206](https://github.com/openlayers/openlayers/pull/7206) - Only load source tiles that intersect the source tile grid's extent ([@ahocevar](https://github.com/ahocevar))
* [#7203](https://github.com/openlayers/openlayers/pull/7203) - Enable Edge tests on SauceLabs ([@ahocevar](https://github.com/ahocevar))
* [#7172](https://github.com/openlayers/openlayers/pull/7172) - added clear method to vectortile source ([@f7o](https://github.com/f7o))
* [#7196](https://github.com/openlayers/openlayers/pull/7196) - renderSync() to make sure overlay is initially visible ([@ahocevar](https://github.com/ahocevar))
* [#7193](https://github.com/openlayers/openlayers/pull/7193) - Fix KML links for documents created locally in Safari ([@ahocevar](https://github.com/ahocevar))
* [#6977](https://github.com/openlayers/openlayers/pull/6977) - Fixed modify feature test ([@KlausBenndorf](https://github.com/KlausBenndorf))
* [#7190](https://github.com/openlayers/openlayers/pull/7190) - Use jsts version 1.4.0 in example ([@openlayers](https://github.com/openlayers))
* [#7191](https://github.com/openlayers/openlayers/pull/7191) - Fix provide/require for autogenerated shader files ([@ahocevar](https://github.com/ahocevar))
* [#7187](https://github.com/openlayers/openlayers/pull/7187) - Simpler tile pixel handling and faster parsing for ol.format.MVT vector tiles ([@ahocevar](https://github.com/ahocevar))
* [#7182](https://github.com/openlayers/openlayers/pull/7182) - Avoid instanceof checks in global test extensions ([@tschaub](https://github.com/tschaub))
* [#7168](https://github.com/openlayers/openlayers/pull/7168) - Exclude greenkeeper merges from changelog ([@gberaudo](https://github.com/gberaudo))
* [#7162](https://github.com/openlayers/openlayers/pull/7162) - Bring back coverage ([@marcjansen](https://github.com/marcjansen))
* [#7165](https://github.com/openlayers/openlayers/pull/7165) - More assorted test fixes ([@tschaub](https://github.com/tschaub))
* [#7142](https://github.com/openlayers/openlayers/pull/7142) - Adds unit test to test the projection inside the geometry of esriJson ([@Sol1du2](https://github.com/Sol1du2))
* [#7138](https://github.com/openlayers/openlayers/pull/7138) - Improvements to the new test setup ([@ahocevar](https://github.com/ahocevar))
* [#7140](https://github.com/openlayers/openlayers/pull/7140) - Export ol.Sphere.getLength and ol.Sphere.getArea ([@openlayers](https://github.com/openlayers))
* [#7131](https://github.com/openlayers/openlayers/pull/7131) - Print ES6 import hint on each doc page ([@ahocevar](https://github.com/ahocevar))
* [#6953](https://github.com/openlayers/openlayers/pull/6953) - Run tests in real browsers with Karma ([@tschaub](https://github.com/tschaub))
* [#7127](https://github.com/openlayers/openlayers/pull/7127) - Use static GeoJSON instead of Overpass query for faster loading ([@ahocevar](https://github.com/ahocevar))
* [#7125](https://github.com/openlayers/openlayers/pull/7125) - Do not try to render error tiles from VectorTile source ([@ahocevar](https://github.com/ahocevar))
* [#7120](https://github.com/openlayers/openlayers/pull/7120) - Fix hit detection for overzoomed vector tiles ([@ahocevar](https://github.com/ahocevar))
* [#7114](https://github.com/openlayers/openlayers/pull/7114) - Immediate WebGL text renderer and other improvements ([@GaborFarkas](https://github.com/GaborFarkas))
Additionally a number of updates where made to our dependencies:
* [#7307](https://github.com/openlayers/openlayers/pull/7307) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7302](https://github.com/openlayers/openlayers/pull/7302) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7298](https://github.com/openlayers/openlayers/pull/7298) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7295](https://github.com/openlayers/openlayers/pull/7295) - chore(package): update coveralls to version 3.0.0 ([@openlayers](https://github.com/openlayers))
* [#7291](https://github.com/openlayers/openlayers/pull/7291) - Update pbf to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7290](https://github.com/openlayers/openlayers/pull/7290) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7281](https://github.com/openlayers/openlayers/pull/7281) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7273](https://github.com/openlayers/openlayers/pull/7273) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7272](https://github.com/openlayers/openlayers/pull/7272) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7269](https://github.com/openlayers/openlayers/pull/7269) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7265](https://github.com/openlayers/openlayers/pull/7265) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7263](https://github.com/openlayers/openlayers/pull/7263) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7254](https://github.com/openlayers/openlayers/pull/7254) - Update closure-util to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7257](https://github.com/openlayers/openlayers/pull/7257) - Update jsdoc to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7251](https://github.com/openlayers/openlayers/pull/7251) - Update fs-extra to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7243](https://github.com/openlayers/openlayers/pull/7243) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7240](https://github.com/openlayers/openlayers/pull/7240) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7238](https://github.com/openlayers/openlayers/pull/7238) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7212](https://github.com/openlayers/openlayers/pull/7212) - chore(package): update clean-css-cli to version 4.1.9 ([@openlayers](https://github.com/openlayers))
* [#7213](https://github.com/openlayers/openlayers/pull/7213) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7207](https://github.com/openlayers/openlayers/pull/7207) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7188](https://github.com/openlayers/openlayers/pull/7188) - fix(package): update rollup to version 0.49.1 ([@openlayers](https://github.com/openlayers))
* [#7166](https://github.com/openlayers/openlayers/pull/7166) - fix(package): update rollup to version 0.48.1 ([@openlayers](https://github.com/openlayers))
* [#7161](https://github.com/openlayers/openlayers/pull/7161) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7144](https://github.com/openlayers/openlayers/pull/7144) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7135](https://github.com/openlayers/openlayers/pull/7135) - Update closure-util to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7126](https://github.com/openlayers/openlayers/pull/7126) - Update phantomjs-prebuilt to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
The v4.4.2 release fixes a number of rendering issues in the 4.4 releases.
## Fixes
* [#7327](https://github.com/openlayers/openlayers/pull/7327) - Prune the tile cache after updating a source's URL ([@tschaub](https://github.com/tschaub))
* [#7341](https://github.com/openlayers/openlayers/pull/7341) - Proper rendering of raster sources when there is a tile transition ([@tschaub](https://github.com/tschaub))
* [#7339](https://github.com/openlayers/openlayers/pull/7339) - Use correct text stroke on HiDPI devices ([@ahocevar](https://github.com/ahocevar))
* [#7345](https://github.com/openlayers/openlayers/pull/7345) - Handle different lineWidth scaling in Safari ([@ahocevar](https://github.com/ahocevar))
* [#7346](https://github.com/openlayers/openlayers/pull/7346) - Pre-render text images for configured scale ([@ahocevar](https://github.com/ahocevar))
* [#7350](https://github.com/openlayers/openlayers/pull/7350) - Calculate correct text box size ([@ahocevar](https://github.com/ahocevar))
The 4.5 release includes enhancements and fixes from 50 or so pull requests. Headlining this release, vector layers got a new `declutter` option that can be used to avoid overlapping labels. See the [street labels example](http://openlayers.org/en/latest/examples/street-labels.html) for a demonstration of this feature.
Please note that if you are using `closure-util` to build your OpenLayers based application, it is time to migrate to using the [`ol` package](https://www.npmjs.com/package/ol) and a module bundler like webpack. OpenLayers has not had a dependency on the Closure Library since the [3.19 release](https://github.com/openlayers/openlayers/releases/tag/v3.19.0); and with the 5.0 release we will be moving completely away from `goog.require` and `goog.provide`, dropping support for `closure-util`, and going with ES modules for our sources.
We will be adding details to the wiki about upcoming changes in 5.0 and tips on how to upgrade. We'll likely have a few more 4.x releases before the 5.0 release. But if you're interested in continuing to get feature enhancements in future releases, migrating to the `ol` package now will make the transition easier.
### Upgrade notes
#### Removed GeoJSON crs workaround for GeoServer
Previous version of GeoServer returned invalid crs in GeoJSON output. The workaround in `ol.format.GeoJSON` used to read this crs code is now removed.
#### Deprecation of `ol.Attribution`
`ol.Attribution` is deprecated and will be removed in the next major version. Instead, you can construct a source with a string attribution or an array of strings. For dynamic attributions, you can provide a function that gets called with the current frame state.
Before:
```js
varsource=newol.source.XYZ({
attributions:[
newol.Attribution({html:'some attribution'})
]
});
```
After:
```js
varsource=newol.source.XYZ({
attributions:'some attribution'
});
```
In addition to passing a string or an array of strings for the `attributions` option, you can also pass a function that will get called with the current frame state.
```js
varsource=newol.source.XYZ({
attributions:function(frameState){
// inspect the frame state and return attributions
return'some attribution';// or ['multiple', 'attributions'] or null
}
});
```
## Detailed changes
See below for the full list of changes.
* [#7456](https://github.com/openlayers/openlayers/pull/7456) - Retry if sauce connect fails ([@tschaub](https://github.com/tschaub))
* [#7440](https://github.com/openlayers/openlayers/pull/7440) - Attempt to make font loading tests more stable ([@ahocevar](https://github.com/ahocevar))
* [#7433](https://github.com/openlayers/openlayers/pull/7433) - Don't use getHints if it's not needed ([@fredj](https://github.com/fredj))
* [#7362](https://github.com/openlayers/openlayers/pull/7362) - Added option to the ol.format.GeoJSON to allow the reading of the geometry_name from the geojson ([@Alexandre27](https://github.com/Alexandre27))
* [#7423](https://github.com/openlayers/openlayers/pull/7423) - Get rendered features by coordinate when wrapping ([@tschaub](https://github.com/tschaub))
* [#7421](https://github.com/openlayers/openlayers/pull/7421) - Keep longitude between -180 and 180 ([@tschaub](https://github.com/tschaub))
* [#7420](https://github.com/openlayers/openlayers/pull/7420) - Fix MapGuide example resolves #7325 ([@TDesjardins](https://github.com/TDesjardins))
* [#7340](https://github.com/openlayers/openlayers/pull/7340) - Clear label cache when fonts become available ([@ahocevar](https://github.com/ahocevar))
* [#7414](https://github.com/openlayers/openlayers/pull/7414) - Only split text at line angle changes ([@ahocevar](https://github.com/ahocevar))
* [#7411](https://github.com/openlayers/openlayers/pull/7411) - Add getLayers and setLayers functions to ol.format.WMSGetFeatureInfo ([@fredj](https://github.com/fredj))
* [#7328](https://github.com/openlayers/openlayers/pull/7328) - Declutter text and images ([@ahocevar](https://github.com/ahocevar))
* [#7406](https://github.com/openlayers/openlayers/pull/7406) - Add option to Zoomify source for setting custom extent ([@lasselaakkonen](https://github.com/lasselaakkonen))
* [#7410](https://github.com/openlayers/openlayers/pull/7410) - Add getFeatureType and setFeatureType functions to ol.format.WFS ([@fredj](https://github.com/fredj))
* [#7379](https://github.com/openlayers/openlayers/pull/7379) - Add support for custom tile size to Zoomify source ([@lasselaakkonen](https://github.com/lasselaakkonen))
* [#7376](https://github.com/openlayers/openlayers/pull/7376) - changed visibility of overlay properties to protected ([@virtualcitySYSTEMS](https://github.com/virtualcitySYSTEMS))
* [#7377](https://github.com/openlayers/openlayers/pull/7377) - Add support to specify CSS class name when creating ol.Overlay ([@notnotse](https://github.com/notnotse))
* [#7375](https://github.com/openlayers/openlayers/pull/7375) - Read 'Abstract', 'AccessConstraints' and 'Fees' in ol.format.OWS ([@fredj](https://github.com/fredj))
* [#7378](https://github.com/openlayers/openlayers/pull/7378) - Fix incorrect docs about ol.source.Raster ([@notnotse](https://github.com/notnotse))
* [#7371](https://github.com/openlayers/openlayers/pull/7371) - Add @api annotation to ol.VectorTile.getExtent ([@notnotse](https://github.com/notnotse))
* [#7369](https://github.com/openlayers/openlayers/pull/7369) - Always request the Bing API with the 'culture' value ([@fredj](https://github.com/fredj))
* [#7364](https://github.com/openlayers/openlayers/pull/7364) - Remove GeoJSON workaround for GeoServer ([@fredj](https://github.com/fredj))
* [#7355](https://github.com/openlayers/openlayers/pull/7355) - Pass pixel tolerance as a parameter to constructor of ol.interaction.Extent ([@marcosox](https://github.com/marcosox))
* [#7356](https://github.com/openlayers/openlayers/pull/7356) - Fix documentation for target option in the controls ([@EduardoNogueira](https://github.com/EduardoNogueira))
* [#7359](https://github.com/openlayers/openlayers/pull/7359) - Rename entry to input - regarding options to rollup lib - Issue #7358 ([@akkumar](https://github.com/akkumar))
* [#7350](https://github.com/openlayers/openlayers/pull/7350) - Calculate correct text box size ([@ahocevar](https://github.com/ahocevar))
* [#7349](https://github.com/openlayers/openlayers/pull/7349) - Do not use tileUrlFunction for renderer tile coordinates ([@ahocevar](https://github.com/ahocevar))
* [#7305](https://github.com/openlayers/openlayers/pull/7305) - Fix #7304: Re-calculate the resolution when the WMS source is reprojected ([@oterral](https://github.com/oterral))
* [#7346](https://github.com/openlayers/openlayers/pull/7346) - Pre-render text images for configured scale ([@ahocevar](https://github.com/ahocevar))
* [#7345](https://github.com/openlayers/openlayers/pull/7345) - Handle different lineWidth scaling in Safari ([@ahocevar](https://github.com/ahocevar))
* [#7344](https://github.com/openlayers/openlayers/pull/7344) - Make text height detection independent of css settings ([@ahocevar](https://github.com/ahocevar))
* [#7341](https://github.com/openlayers/openlayers/pull/7341) - Proper rendering of raster sources when there is a tile transition ([@tschaub](https://github.com/tschaub))
* [#7339](https://github.com/openlayers/openlayers/pull/7339) - Use correct text stroke on HiDPI devices ([@ahocevar](https://github.com/ahocevar))
* [#7327](https://github.com/openlayers/openlayers/pull/7327) - Prune the tile cache after updating a source's URL ([@tschaub](https://github.com/tschaub))
* [#7333](https://github.com/openlayers/openlayers/pull/7333) - Pluggable Map/Layers - function calls to handles and create ([@waxenegger](https://github.com/waxenegger))
* [#7337](https://github.com/openlayers/openlayers/pull/7337) - Always create a new blank image to avoid CSP violations ([@ahocevar](https://github.com/ahocevar))
* [#7330](https://github.com/openlayers/openlayers/pull/7330) - Add upgrade notes to 4.4.0 changelog ([@tschaub](https://github.com/tschaub))
Additionally a number of updates where made to our dependencies:
<details>
<summary>Click to expand</summary>
<ul>
<li><a href="https://github.com/openlayers/openlayers/pull/7455">#7455</a> - Update eslint to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
<li><a href="https://github.com/openlayers/openlayers/pull/7447">#7447</a> - chore(package): update rollup-plugin-commonjs to version 8.2.6 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
<li><a href="https://github.com/openlayers/openlayers/pull/7448">#7448</a> - chore(package): update debounce to version 1.1.0 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
<li><a href="https://github.com/openlayers/openlayers/pull/7451">#7451</a> - chore(package): update karma to version 1.7.1 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
<li><a href="https://github.com/openlayers/openlayers/pull/7446">#7446</a> - fix(package): update rollup to version 0.51.3 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
<li><a href="https://github.com/openlayers/openlayers/pull/7428">#7428</a> - Update sinon to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
<li><a href="https://github.com/openlayers/openlayers/pull/7425">#7425</a> - Update async to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
<li><a href="https://github.com/openlayers/openlayers/pull/7418">#7418</a> - Update sinon to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
<li><a href="https://github.com/openlayers/openlayers/pull/7416">#7416</a> - Update sinon to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
<li><a href="https://github.com/openlayers/openlayers/pull/7417">#7417</a> - Update phantomjs-prebuilt to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
<li><a href="https://github.com/openlayers/openlayers/pull/7399">#7399</a> - Update eslint to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
<li><a href="https://github.com/openlayers/openlayers/pull/7395">#7395</a> - Update closure-util to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
<li><a href="https://github.com/openlayers/openlayers/pull/7392">#7392</a> - Update sinon to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
<li><a href="https://github.com/openlayers/openlayers/pull/7380">#7380</a> - Update rollup-plugin-cleanup to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
<li><a href="https://github.com/openlayers/openlayers/pull/7366">#7366</a> - Update handlebars to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
<li><a href="https://github.com/openlayers/openlayers/pull/7360">#7360</a> - Update eslint to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
<li><a href="https://github.com/openlayers/openlayers/pull/7354">#7354</a> - Update closure-util to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
<li><a href="https://github.com/openlayers/openlayers/pull/7319">#7319</a> - Update closure-util to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
<li><a href="https://github.com/openlayers/openlayers/pull/7314">#7314</a> - Update mocha to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
The 4.6 release includes enhancements and fixes from 30 or so pull requests. Headlining this release, vector layers got new `textBackgroundFill`, `textBackgroundStroke` and `padding` options that can be used to render background boxes for text. `ol.source.ImageVector` is now deprecated and replaced by a more convenient way to render vectors as images: by simply setting `renderMode: 'image'` on the vector layer.
Please note that if you are using `closure-util` to build your OpenLayers based application, it is time to migrate to using the [`ol` package](https://www.npmjs.com/package/ol) and a module bundler like webpack. OpenLayers has not had a dependency on the Closure Library since the [3.19 release](https://github.com/openlayers/openlayers/releases/tag/v3.19.0); and with the 5.0 release we will be moving completely away from `goog.require` and `goog.provide`, dropping support for `closure-util`, and going with ES modules for our sources.
See the [wiki](https://github.com/openlayers/openlayers/wiki/OpenLayers-v5.x) about upcoming changes in 5.0 and tips on how to upgrade. We likely won't have another 4.x release before the 5.0 release. If you're interested in continuing to get feature enhancements in future releases, migrating to the `ol` package now will make the transition easier.
### Upgrade notes
#### Renamed `exceedLength` option of `ol.style.Text` to `overflow`
To update your applications, simply replace `exceedLength` with `overflow`.
#### Deprecation of `ol.source.ImageVector`
Rendering vector sources as image is now directly supported by `ol.layer.Vector` with the new `renderMode: 'image'` configuration option. Change code like this:
```js
newol.layer.Image({
source:newol.source.ImageVector({
style:myStyle,
source:newol.source.Vector({
url:'my/data.json',
format:newol.format.GeoJSON()
})
})
});
```
to:
```js
newol.layer.Vector({
renderMode:'image',
style:myStyle,
source:newol.source.Vector({
url:'my/data.json',
format:newol.format.GeoJSON()
})
});
```
## Detailed changes
See below for the full list of changes.
* [#7538](https://github.com/openlayers/openlayers/pull/7538) - removeFromLoadedExtents to remove extents that failed to load ([@ahocevar](https://github.com/ahocevar))
* [#7537](https://github.com/openlayers/openlayers/pull/7537) - Fix Draw.removeLastPoint exception when no points to remove ([@walkermatt](https://github.com/walkermatt))
* [#7461](https://github.com/openlayers/openlayers/pull/7461) - Use the matrixSet projection by default ([@oterral](https://github.com/oterral))
* [#5883](https://github.com/openlayers/openlayers/pull/5883) - Fixes setUrl() for WMTS sources (ol.source.WMTS) ([@bylexus](https://github.com/bylexus))
* [#7531](https://github.com/openlayers/openlayers/pull/7531) - Update the ol package readme ([@ahocevar](https://github.com/ahocevar))
* [#7372](https://github.com/openlayers/openlayers/pull/7372) - Add method to set max cache size in ol.style.IconImageCache ([@notnotse](https://github.com/notnotse))
* [#7530](https://github.com/openlayers/openlayers/pull/7530) - Check forward/back 1 world if wrapping ([@raiyni](https://github.com/raiyni))
* [#7526](https://github.com/openlayers/openlayers/pull/7526) - Allow clicks to be stopped while drawing ([@tschaub](https://github.com/tschaub))
* [#7524](https://github.com/openlayers/openlayers/pull/7524) - Snap view center to pixel ([@ahocevar](https://github.com/ahocevar))
* [#7519](https://github.com/openlayers/openlayers/pull/7519) - Reuse declutter tree for hit detection ([@ahocevar](https://github.com/ahocevar))
* [#7499](https://github.com/openlayers/openlayers/pull/7499) - Remove attributions from olx.FrameState instances ([@openlayers](https://github.com/openlayers))
* [#7501](https://github.com/openlayers/openlayers/pull/7501) - Option to render vector layers as images ([@ahocevar](https://github.com/ahocevar))
* [#7516](https://github.com/openlayers/openlayers/pull/7516) - Deprecate exceedLength and replace with overflow ([@ahocevar](https://github.com/ahocevar))
* [#7510](https://github.com/openlayers/openlayers/pull/7510) - Do not fade the states layer ([@ahocevar](https://github.com/ahocevar))
* [#7513](https://github.com/openlayers/openlayers/pull/7513) - Make strokeKey safer ([@ahocevar](https://github.com/ahocevar))
* [#7514](https://github.com/openlayers/openlayers/pull/7514) - Prune the label cache less aggressively ([@ahocevar](https://github.com/ahocevar))
* [#7505](https://github.com/openlayers/openlayers/pull/7505) - Remove ol.DeviceOrientation link from API index ([@fredj](https://github.com/fredj))
* [#7497](https://github.com/openlayers/openlayers/pull/7497) - Use getGeometry ([@nicholas-l](https://github.com/nicholas-l))
* [#7495](https://github.com/openlayers/openlayers/pull/7495) - Remove layer renderers when viewport is removed ([@ahocevar](https://github.com/ahocevar))
* [#7492](https://github.com/openlayers/openlayers/pull/7492) - Remove unneeded type cast from examples ([@fredj](https://github.com/fredj))
* [#7489](https://github.com/openlayers/openlayers/pull/7489) - Allow string to be passed as ol.interaction.Draw type ([@fredj](https://github.com/fredj))
* [#7445](https://github.com/openlayers/openlayers/pull/7445) - Load css rules from full-screen.css in examples ([@fredj](https://github.com/fredj))
* [#7481](https://github.com/openlayers/openlayers/pull/7481) - Make zoom to extent control extensible ([@gberaudo](https://github.com/gberaudo))
* [#7477](https://github.com/openlayers/openlayers/pull/7477) - Make text states available for replay time ([@ahocevar](https://github.com/ahocevar))
* [#7482](https://github.com/openlayers/openlayers/pull/7482) - Reset rotation after rendering ([@ahocevar](https://github.com/ahocevar))
* [#7480](https://github.com/openlayers/openlayers/pull/7480) - Create a new image when loading tile after an error ([@ahocevar](https://github.com/ahocevar))
* [#7476](https://github.com/openlayers/openlayers/pull/7476) - Reset text measurements when available fonts change ([@ahocevar](https://github.com/ahocevar))
* [#7454](https://github.com/openlayers/openlayers/pull/7454) - Add text background rendering and text padding ([@ahocevar](https://github.com/ahocevar))
* [#7468](https://github.com/openlayers/openlayers/pull/7468) - Add new API-key for HERE example ([@chrismayer](https://github.com/chrismayer))
* [#7465](https://github.com/openlayers/openlayers/pull/7465) - Export ol.proj.Projection#getAxisOrientation function ([@fredj](https://github.com/fredj))
* [#7462](https://github.com/openlayers/openlayers/pull/7462) - Respect metersPerUnit in ScaleLine control ([@ahocevar](https://github.com/ahocevar))
Additionally a number of updates where made to our dependencies:
* [#7536](https://github.com/openlayers/openlayers/pull/7536) - Update fs-extra to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7533](https://github.com/openlayers/openlayers/pull/7533) - Update marked to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7527](https://github.com/openlayers/openlayers/pull/7527) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7511](https://github.com/openlayers/openlayers/pull/7511) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7512](https://github.com/openlayers/openlayers/pull/7512) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7484](https://github.com/openlayers/openlayers/pull/7484) - Update closure-util to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
The v4.6.1 release fixes a number of issues in the 4.6 releases.
## Fixes
* [#7543](https://github.com/openlayers/openlayers/pull/7543) - Donut polygon labels do not get a chance to get rendered ([@ahocevar](https://github.com/ahocevar))
* [#7542](https://github.com/openlayers/openlayers/pull/7542) - Still respect deprecated exceedLength option ([@ahocevar](https://github.com/ahocevar))
* [#7541](https://github.com/openlayers/openlayers/pull/7541) - Fix case of vectorrendertype.js ([@ahocevar](https://github.com/ahocevar))
The v4.6.3 release fixes a performance issue when `renderMode: 'image'` is set on an `ol.layer.Vector`.
## Fixes
* [#7554](https://github.com/openlayers/openlayers/pull/7554) - Only compose image vector frame when the replay group has changed ([@ahocevar](https://github.com/ahocevar))
The v4.6.4 release fixes a feature selection issue when `renderMode: 'image'` is set on an `ol.layer.Vector`.
## Fixes
* [#7559](https://github.com/openlayers/openlayers/pull/7559) - Handle skipping and unskipping features with renderMode: 'image' ([@ahocevar](https://github.com/ahocevar))
The v4.6.5 release fixes a hit detection issue when `declutter: true` is set on an `ol.layer.VectorTile`.
## Fixes
* [#7669](https://github.com/openlayers/openlayers/pull/7559) - Use declutter tree only for text and image replays ([@ahocevar](https://github.com/ahocevar))
The main theme of the v5.0.0 release is an improved developer/user experience with OpenLayers. Toward this end, we have reworked the library as a set of ES Modules, completely removing any dependency on the Closure Compiler, and improving compatibility with mainstream module bundlers.
See the [hosted examples](https://openlayers.org/en/latest/examples/), [API docs](https://openlayers.org/en/latest/apidoc/), and [bundle tutorial](https://openlayers.org/en/latest/doc/tutorials/bundle.html) for the new syntax, but basic usage looks like this:
```js
import'ol/ol.css';
import{Map,View}from'ol';
importTileLayerfrom'ol/layer/Tile';
importOSMfrom'ol/source/OSM';
constmap=newMap({
target:'map',
layers:[
newTileLayer({
source:newOSM()
})
],
view:newView({
center:[0,0],
zoom:0
})
});
```
See below for specific notes on upgrading from 4.x releases. We'll be working on updating the website with improved documentation and examples. Take a look at the issue tracker if you're interested in contributing.
### Upgrade Notes
#### Renamed `ol/source/TileUTFGrid` to `ol/source/UTFGrid`
The module name is now `ol/source/UTFGrid` (`ol.source.UTFGrid` in the full build).
#### Renaming of the `defaultDataProjection` in the options and property of the `ol/format/Feature` class and its subclasses
The `defaultDataProjection` option is now named `dataProjection`. The protected property available on the class is also renamed.
#### `transition` option of `ol/source/VectorTile` is ignored
The `transition` option to get an opacity transition to fade in tiles has been disabled for `ol/source/VectorTile`. Vector tiles are now always rendered without an opacity transition.
#### `ol/style/Fill` with `CanvasGradient` or `CanvasPattern`
The origin for gradients and patterns has changed from the top-left corner of the extent of the geometry being filled to 512 css pixel increments from map coordinate `[0, 0]`. This allows repeat patterns to be aligned properly with vector tiles. For seamless repeat patterns, width and height of the pattern image must be a factor of two (2, 4, 8, ..., 512).
#### Removal of the renderer option for maps
The `renderer` option has been removed from the `Map` constructor. The purpose of this change is to avoid bundling code in your application that you do not need. Previously, code for both the Canvas and WebGL renderers was included in all applications - even though most people only use one renderer. The `Map` constructor now gives you a Canvas (2D) based renderer. If you want to try the WebGL renderer, you can import the constructor from `ol/WebGLMap`.
Old code:
```js
importMapfrom'ol/Map';
constcanvasMap=newMap({
renderer:['canvas']
// other options...
});
constwebglMap=newMap({
renderer:['webgl']
// other options...
});
```
New code:
```js
importMapfrom'ol/Map';
importWebGLMapfrom'ol/WebGLMap';
constcanvasMap=newMap({
// options...
});
constwebglMap=newWebGLMap({
// options...
});
```
#### Removal of ol.FeatureStyleFunction
The signature of the vector style function passed to the feature has changed. The function now always takes the `feature` and the `resolution` as arguments, the `feature` is no longer bound to `this`.
Old code:
```js
feature.setStyle(function(resolution){
vartext=this.get('name');
...
});
```
New code:
```js
feature.setStyle(function(feature,resolution){
vartext=feature.get('name');
...
});
```
#### Changed behavior of the `Draw` interaction
For better drawing experience, two changes were made to the behavior of the Draw interaction:
1. On long press, the current vertex can be dragged to its desired position.
2. On touch move (e.g. when panning the map on a mobile device), no draw cursor is shown, and the geometry being drawn is not updated. But because of 1., the draw cursor will appear on long press. Mouse moves are not affected by this change.
#### Changes in proj4 integration
Because relying on a globally available proj4 is not practical with ES modules, we have made a change to the way we integrate proj4:
* The `setProj4()` function from the `ol/proj` module was removed.
* A new `ol/proj/proj4` module with a `register()` function was added. Regardless of whether the application imports `proj4` or uses a global `proj4`, this function needs to be called with the proj4 instance as argument whenever projection definitions were added to proj4's registry with (`proj4.defs`).
It is also recommended to no longer use a global `proj4`. Instead,
npm install proj4
and import it:
```js
importproj4from'proj4';
```
Applications can be updated by importing the `register` function from the `ol/proj/proj4` module
```js
import{register}from'ol/proj/proj4'
```
and calling it before using projections, and any time the proj4 registry was changed by `proj4.defs()` calls:
```js
register(proj4);
```
#### Removal of logos
The map and sources no longer accept a `logo` option. Instead, if you wish to append a logo to your map, add the desired markup directly in your HTML. In addition, you can use the `attributions` property of a source to display arbitrary markup per-source with the attribution control.
#### Replacement of `ol/Sphere` constructor with `ol/sphere` functions
The `ol/Sphere` constructor has been removed. If you were using the `getGeodesicArea` method, use the `getArea` function instead. If you were using the `haversineDistance` method, use the `getDistance` function instead.
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).
#### `Map#forEachLayerAtPixel` parameters have changed
If you are using the layer filter, please note that you now have to pass in the layer filter via an `AtPixelOptions` object. If you are not using the layer filter the usage has not changed.
To bind a function to a this, please use the bind method of the function (See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).
This change is due to the introduction of the `hitTolerance` parameter which can be passed in via this `AtPixelOptions` object, too.
### New Features and Fixes
* [#8314](https://github.com/openlayers/openlayers/pull/8314) - Accept hitTolerance in map.forEachLayerAtPixel() ([@simonseyock](https://github.com/simonseyock))
* [#7750](https://github.com/openlayers/openlayers/pull/7750) - Don't assume fill for canvas polygon hit detection. ([@schmidtk](https://github.com/schmidtk))
* [#8305](https://github.com/openlayers/openlayers/pull/8305) - Update quickstart and tutorials for v5 ([@ahocevar](https://github.com/ahocevar))
* [#8301](https://github.com/openlayers/openlayers/pull/8301) - Do not render vectors in image mode ([@ahocevar](https://github.com/ahocevar))
* [#8299](https://github.com/openlayers/openlayers/pull/8299) - Make classes in ol/ available as named exports from ol ([@ahocevar](https://github.com/ahocevar))
* [#8298](https://github.com/openlayers/openlayers/pull/8298) - Add README for ol package ([@ahocevar](https://github.com/ahocevar))
* [#8295](https://github.com/openlayers/openlayers/pull/8295) - Prepare for building/publishing v5 ([@ahocevar](https://github.com/ahocevar))
* [#8294](https://github.com/openlayers/openlayers/pull/8294) - Remove non-functional type checks from testing ([@ahocevar](https://github.com/ahocevar))
* [#8292](https://github.com/openlayers/openlayers/pull/8292) - Remove now unneeded single quotes in examples ([@fredj](https://github.com/fredj))
* [#8287](https://github.com/openlayers/openlayers/pull/8287) - Rename ol/source/TileUTFGrid to ol/source/UTFGrid ([@fredj](https://github.com/fredj))
* [#8286](https://github.com/openlayers/openlayers/pull/8286) - Fix class name property in Overlay documentation ([@fredj](https://github.com/fredj))
* [#8281](https://github.com/openlayers/openlayers/pull/8281) - Rename default data projection ([@gberaudo](https://github.com/gberaudo))
* [#8283](https://github.com/openlayers/openlayers/pull/8283) - Remove references to tutorials/custom-builds.html ([@fredj](https://github.com/fredj))
* [#8280](https://github.com/openlayers/openlayers/pull/8280) - Add missing property in VectorTile options, remove params from createRenderer ([@fredj](https://github.com/fredj))
* [#8277](https://github.com/openlayers/openlayers/pull/8277) - Fix code block in comment ([@ahocevar](https://github.com/ahocevar))
* [#8273](https://github.com/openlayers/openlayers/pull/8273) - Remove the externs/ directory ([@ahocevar](https://github.com/ahocevar))
* [#8246](https://github.com/openlayers/openlayers/pull/8246) - Don't go back to not moving when dragging ([@ahocevar](https://github.com/ahocevar))
* [#8258](https://github.com/openlayers/openlayers/pull/8258) - Use Webpack 4 for tests (and examples) ([@ahocevar](https://github.com/ahocevar))
* [#8250](https://github.com/openlayers/openlayers/pull/8250) - Fix various jsdoc types ([@fredj](https://github.com/fredj))
* [#8245](https://github.com/openlayers/openlayers/pull/8245) - Fix vector tile docs and types ([@ahocevar](https://github.com/ahocevar))
* [#8233](https://github.com/openlayers/openlayers/pull/8233) - Use rollup instead of webpack for the full build ([@ahocevar](https://github.com/ahocevar))
* [#8231](https://github.com/openlayers/openlayers/pull/8231) - Fix JSTS usage with OL classes injected ([@bjornharrtell](https://github.com/bjornharrtell))
* [#8229](https://github.com/openlayers/openlayers/pull/8229) - Support layers instead of renderers for ol/source/Raster ([@ahocevar](https://github.com/ahocevar))
* [#8225](https://github.com/openlayers/openlayers/pull/8225) - renderMode: 'image' fixes for ol/layer/Vector ([@ahocevar](https://github.com/ahocevar))
* [#8226](https://github.com/openlayers/openlayers/pull/8226) - Accept renderers as sources for the Raster source ([@ahocevar](https://github.com/ahocevar))
* [#8210](https://github.com/openlayers/openlayers/pull/8210) - Align patterns and gradients to a grid ([@ahocevar](https://github.com/ahocevar))
* [#8201](https://github.com/openlayers/openlayers/pull/8201) - Remove babelrc, transform using babel-core ([@ahocevar](https://github.com/ahocevar))
* [#8203](https://github.com/openlayers/openlayers/pull/8203) - Type checking complete ([@ahocevar](https://github.com/ahocevar))
* [#8204](https://github.com/openlayers/openlayers/pull/8204) - Document ol/control~defaults in the right place ([@ahocevar](https://github.com/ahocevar))
* [#8200](https://github.com/openlayers/openlayers/pull/8200) - Set textAlign to the canvas context ([@fredj](https://github.com/fredj))
* [#8189](https://github.com/openlayers/openlayers/pull/8189) - More apidoc fixes ([@ahocevar](https://github.com/ahocevar))
* [#8191](https://github.com/openlayers/openlayers/pull/8191) - Do not scale text outline width ([@ahocevar](https://github.com/ahocevar))
* [#8187](https://github.com/openlayers/openlayers/pull/8187) - Hide attribution control if there are no attributions ([@tschaub](https://github.com/tschaub))
* [#8186](https://github.com/openlayers/openlayers/pull/8186) - Updates to get the examples building ([@tschaub](https://github.com/tschaub))
* [#8180](https://github.com/openlayers/openlayers/pull/8180) - Fix some JSDoc issues ([@ahocevar](https://github.com/ahocevar))
* [#8175](https://github.com/openlayers/openlayers/pull/8175) - More typing fixes ([@fredj](https://github.com/fredj))
* [#8177](https://github.com/openlayers/openlayers/pull/8177) - Remove documentation related to the closure compiler ([@gberaudo](https://github.com/gberaudo))
* [#8174](https://github.com/openlayers/openlayers/pull/8174) - Fix typo in ol/style/Image~Options typedef ([@fredj](https://github.com/fredj))
* [#8172](https://github.com/openlayers/openlayers/pull/8172) - Ignore 'this' type in function typedef ([@fredj](https://github.com/fredj))
* [#8173](https://github.com/openlayers/openlayers/pull/8173) - Fix typing in ol/xml module ([@fredj](https://github.com/fredj))
* [#8169](https://github.com/openlayers/openlayers/pull/8169) - Shorter module paths for default exports ([@fredj](https://github.com/fredj))
* [#8132](https://github.com/openlayers/openlayers/pull/8132) - Add minZoom to the createResolutionConstraint function return type ([@fredj](https://github.com/fredj))
* [#8129](https://github.com/openlayers/openlayers/pull/8129) - Fix some types ([@ahocevar](https://github.com/ahocevar))
* [#8127](https://github.com/openlayers/openlayers/pull/8127) - Move RasterOperationType into ol/source/Raster ([@fredj](https://github.com/fredj))
* [#8123](https://github.com/openlayers/openlayers/pull/8123) - More Jsdoc module fixes ([@fredj](https://github.com/fredj))
* [#8125](https://github.com/openlayers/openlayers/pull/8125) - Shorter module paths for default exports ([@ahocevar](https://github.com/ahocevar))
* [#8121](https://github.com/openlayers/openlayers/pull/8121) - More Jsdoc module fixes ([@fredj](https://github.com/fredj))
* [#8117](https://github.com/openlayers/openlayers/pull/8117) - Re-export style constructors from ol/style ([@tschaub](https://github.com/tschaub))
* [#8115](https://github.com/openlayers/openlayers/pull/8115) - Re-export layer constructors from ol/layer ([@tschaub](https://github.com/tschaub))
* [#8114](https://github.com/openlayers/openlayers/pull/8114) - Re-export interaction constructors from ol/interaction ([@tschaub](https://github.com/tschaub))
* [#8116](https://github.com/openlayers/openlayers/pull/8116) - Re-export source constructors from ol/source ([@tschaub](https://github.com/tschaub))
* [#8113](https://github.com/openlayers/openlayers/pull/8113) - Re-export geometry constructors from ol/geom ([@tschaub](https://github.com/tschaub))
* [#8112](https://github.com/openlayers/openlayers/pull/8112) - Re-export format constructors from ol/format ([@tschaub](https://github.com/tschaub))
* [#8111](https://github.com/openlayers/openlayers/pull/8111) - Re-export control constructors ([@tschaub](https://github.com/tschaub))
* [#8118](https://github.com/openlayers/openlayers/pull/8118) - Use list for cloak entries ([@tschaub](https://github.com/tschaub))
* [#8109](https://github.com/openlayers/openlayers/pull/8109) - Make any falsey undefinedHTML retain the mouse position ([@tschaub](https://github.com/tschaub))
* [#8103](https://github.com/openlayers/openlayers/pull/8103) - Fix some jsdoc path types ([@ahocevar](https://github.com/ahocevar))
* [#7784](https://github.com/openlayers/openlayers/pull/7784) - Adds option to retain MousePosition when pointer leaves viewport ([@pedros007](https://github.com/pedros007))
* [#8101](https://github.com/openlayers/openlayers/pull/8101) - More Jsdoc module fixes ([@fredj](https://github.com/fredj))
* [#7908](https://github.com/openlayers/openlayers/pull/7908) - ScaleLine fix for non-degree based units ([@hyperknot](https://github.com/hyperknot))
* [#8099](https://github.com/openlayers/openlayers/pull/8099) - More Jsdoc module fixes ([@openlayers](https://github.com/openlayers))
* [#8098](https://github.com/openlayers/openlayers/pull/8098) - Remove externs/olx.js and src/ol/typedefs.js ([@tschaub](https://github.com/tschaub))
* [#8081](https://github.com/openlayers/openlayers/pull/8081) - Move olx.render.* and related typedefs to ol/render/* ([@pfirpfel](https://github.com/pfirpfel))
* [#8087](https://github.com/openlayers/openlayers/pull/8087) - Move various typedefs out of typdefs.js ([@pfirpfel](https://github.com/pfirpfel))
* [#8052](https://github.com/openlayers/openlayers/pull/8052) - More Jsdoc module fixes ([@fredj](https://github.com/fredj))
* [#8048](https://github.com/openlayers/openlayers/pull/8048) - Remove all comments from shaders ([@fredj](https://github.com/fredj))
* [#8088](https://github.com/openlayers/openlayers/pull/8088) - Correct type for TextPlacement (jsdoc) ([@camptocamp](https://github.com/camptocamp))
* [#8083](https://github.com/openlayers/openlayers/pull/8083) - Move structs typedefs to ol/structs/* ([@pfirpfel](https://github.com/pfirpfel))
* [#8077](https://github.com/openlayers/openlayers/pull/8077) - Add hasFeature method to ol.source.Vector ([@icholy](https://github.com/icholy))
* [#8080](https://github.com/openlayers/openlayers/pull/8080) - #8079 Mark functions setRotateWithView and setSnapToPixel of ol/style/Image with @api ([@iagafonov](https://github.com/iagafonov))
* [#8084](https://github.com/openlayers/openlayers/pull/8084) - Move ol.Reproj* typedefs to ol/reproj ([@pfirpfel](https://github.com/pfirpfel))
* [#8076](https://github.com/openlayers/openlayers/pull/8076) - Move olx.style.* and ol.Style* to ol/style/* ([@pfirpfel](https://github.com/pfirpfel))
* [#8075](https://github.com/openlayers/openlayers/pull/8075) - Move olx.tilegrid.* to ol/tilegrid/* ([@pfirpfel](https://github.com/pfirpfel))
* [#8073](https://github.com/openlayers/openlayers/pull/8073) - Remove dependency on deprecated sinon@5 ([@tschaub](https://github.com/tschaub))
* [#7863](https://github.com/openlayers/openlayers/pull/7863) - Add note about null geom in VectorSource.forEachFeature ([@fredj](https://github.com/fredj))
* [#8055](https://github.com/openlayers/openlayers/pull/8055) - Mark optional property with square brackets ([@fredj](https://github.com/fredj))
* [#8054](https://github.com/openlayers/openlayers/pull/8054) - Generate correct includes list for `build-index` script on windows hosts. ([@lilliputten](https://github.com/lilliputten))
* [#8053](https://github.com/openlayers/openlayers/pull/8053) - Don't import from 'functions' multiple times ([@fredj](https://github.com/fredj))
* [#8003](https://github.com/openlayers/openlayers/pull/8003) - Add an example showing Chaikins smoothing algorithm ([@marcjansen](https://github.com/marcjansen))
* [#8044](https://github.com/openlayers/openlayers/pull/8044) - Rename constructor options typedef to 'Options' ([@fredj](https://github.com/fredj))
* [#8042](https://github.com/openlayers/openlayers/pull/8042) - Only process loaded tiles ([@ahocevar](https://github.com/ahocevar))
* [#8036](https://github.com/openlayers/openlayers/pull/8036) - Move the temporary arrays to the module level ([@fredj](https://github.com/fredj))
* [#8032](https://github.com/openlayers/openlayers/pull/8032) - Start removing externs for `ol/source` ([@romanzoller](https://github.com/romanzoller))
* [#8038](https://github.com/openlayers/openlayers/pull/8038) - Fix ZoomToExtent default tipLabel value ([@fredj](https://github.com/fredj))
* [#8034](https://github.com/openlayers/openlayers/pull/8034) - More Jsdoc module fixes ([@fredj](https://github.com/fredj))
* [#8029](https://github.com/openlayers/openlayers/pull/8029) - More Jsdoc module fixes ([@fredj](https://github.com/fredj))
* [#8030](https://github.com/openlayers/openlayers/pull/8030) - Set `user-select: text` for .ol-selectable ([@walkermatt](https://github.com/walkermatt))
* [#8025](https://github.com/openlayers/openlayers/pull/8025) - Move olx.layer.* to ol/layer/* ([@romanzoller](https://github.com/romanzoller))
* [#8023](https://github.com/openlayers/openlayers/pull/8023) - Module type changes for ol.webgl ([@fredj](https://github.com/fredj))
* [#8021](https://github.com/openlayers/openlayers/pull/8021) - Move olx.ViewState to ol/View ([@fredj](https://github.com/fredj))
* [#8012](https://github.com/openlayers/openlayers/pull/8012) - More Jsdoc module fixes ([@fredj](https://github.com/fredj))
* [#8015](https://github.com/openlayers/openlayers/pull/8015) - Remove some typedefs from src/ol/typedefs.js ([@fredj](https://github.com/fredj))
* [#8016](https://github.com/openlayers/openlayers/pull/8016) - Move olx.layer.BaseOptions to ol/layer/Base ([@romanzoller](https://github.com/romanzoller))
* [#8005](https://github.com/openlayers/openlayers/pull/8005) - Add vector tile selection example ([@chrismayer](https://github.com/chrismayer))
* [#7999](https://github.com/openlayers/openlayers/pull/7999) - More Jsdoc module fixes ([@fredj](https://github.com/fredj))
* [#7998](https://github.com/openlayers/openlayers/pull/7998) - More Jsdoc module fixes ([@fredj](https://github.com/fredj))
* [#7992](https://github.com/openlayers/openlayers/pull/7992) - Fix freeze on export PDF example ([@trenneman](https://github.com/trenneman))
* [#7973](https://github.com/openlayers/openlayers/pull/7973) - Remove setAttributeNS function from ol/xml ([@fredj](https://github.com/fredj))
* [#7971](https://github.com/openlayers/openlayers/pull/7971) - Use module syntax for type annotations ([@tschaub](https://github.com/tschaub))
* [#7968](https://github.com/openlayers/openlayers/pull/7968) - More types in the right places ([@tschaub](https://github.com/tschaub))
* [#7966](https://github.com/openlayers/openlayers/pull/7966) - Remove namespaces from olx.js ([@tschaub](https://github.com/tschaub))
* [#7965](https://github.com/openlayers/openlayers/pull/7965) - Redistribute types from externs/olx.js ([@tschaub](https://github.com/tschaub))
* [#7608](https://github.com/openlayers/openlayers/pull/7608) - Facilitate the removal of externs/olx.js ([@tschaub](https://github.com/tschaub))
* [#7964](https://github.com/openlayers/openlayers/pull/7964) - Coordinate type typo ([@tschaub](https://github.com/tschaub))
* [#7961](https://github.com/openlayers/openlayers/pull/7961) - Correct type for style ([@tschaub](https://github.com/tschaub))
* [#7958](https://github.com/openlayers/openlayers/pull/7958) - miscellaneous fixes to the types annotation ([@fredj](https://github.com/fredj))
* [#7953](https://github.com/openlayers/openlayers/pull/7953) - Get rid of externs/olx.js and src/ol/typedefs.js typedefs for ol/ and ol/events/ ([@ahocevar](https://github.com/ahocevar))
* [#7956](https://github.com/openlayers/openlayers/pull/7956) - Make sure namespaces are populated after they were created ([@ahocevar](https://github.com/ahocevar))
* [#7952](https://github.com/openlayers/openlayers/pull/7952) - Fix typo in jsdoc type ([@fredj](https://github.com/fredj))
* [#7948](https://github.com/openlayers/openlayers/pull/7948) - Better type definition ([@fredj](https://github.com/fredj))
* [#7946](https://github.com/openlayers/openlayers/pull/7946) - New typedef syntax and module path types for some modules ([@ahocevar](https://github.com/ahocevar))
* [#7944](https://github.com/openlayers/openlayers/pull/7944) - Make wrap work with points in the vector-labels example ([@ahocevar](https://github.com/ahocevar))
* [#7904](https://github.com/openlayers/openlayers/pull/7904) - Add focus condition, e.g. for wheel zoom ([@ahocevar](https://github.com/ahocevar))
* [#7902](https://github.com/openlayers/openlayers/pull/7902) - Add a unicode symbol for symbol font detection ([@ahocevar](https://github.com/ahocevar))
* [#7899](https://github.com/openlayers/openlayers/pull/7899) - Use nomnom@1.8.1 ([@tschaub](https://github.com/tschaub))
* [#7888](https://github.com/openlayers/openlayers/pull/7888) - Rework away static members from pointer related classes ([@bjornharrtell](https://github.com/bjornharrtell))
* [#7880](https://github.com/openlayers/openlayers/pull/7880) - Named exports from ol/style/Style ([@tschaub](https://github.com/tschaub))
* [#7872](https://github.com/openlayers/openlayers/pull/7872) - More named export ([@fredj](https://github.com/fredj))
* [#7874](https://github.com/openlayers/openlayers/pull/7874) - Cleaning up exports ([@tschaub](https://github.com/tschaub))
* [#7842](https://github.com/openlayers/openlayers/pull/7842) - Allow setting the label cache size ([@ahocevar](https://github.com/ahocevar))
* [#7791](https://github.com/openlayers/openlayers/pull/7791) - Named exports from ol/tilecoord ([@marcjansen](https://github.com/marcjansen))
* [#7835](https://github.com/openlayers/openlayers/pull/7835) - Add and use a constant for the collapsed CSS class ([@marcjansen](https://github.com/marcjansen))
* [#7834](https://github.com/openlayers/openlayers/pull/7834) - Named exports from ol/transform ([@marcjansen](https://github.com/marcjansen))
* [#7831](https://github.com/openlayers/openlayers/pull/7831) - Add new maxTilesLoading option to ol/PluggableMap ([@fredj](https://github.com/fredj))
* [#7833](https://github.com/openlayers/openlayers/pull/7833) - Fix createEmptyTexture function call in ol/webgl/Context ([@fredj](https://github.com/fredj))
* [#7832](https://github.com/openlayers/openlayers/pull/7832) - Webgl Layer and Context named exports ([@fgravin](https://github.com/fgravin))
* [#7826](https://github.com/openlayers/openlayers/pull/7826) - Better code indentation and modules renaming ([@fredj](https://github.com/fredj))
* [#7821](https://github.com/openlayers/openlayers/pull/7821) - Add new canvas instruction array in ol/render/canvas/Instruction ([@fredj](https://github.com/fredj))
* [#7817](https://github.com/openlayers/openlayers/pull/7817) - Remove more private static members ([@tschaub](https://github.com/tschaub))
* [#7814](https://github.com/openlayers/openlayers/pull/7814) - Remove more private static members ([@tschaub](https://github.com/tschaub))
* [#7816](https://github.com/openlayers/openlayers/pull/7816) - Use toString instead of asString in asColorLike ([@openlayers](https://github.com/openlayers))
* [#7811](https://github.com/openlayers/openlayers/pull/7811) - Remove ol.FeatureStyleFunction support ([@fredj](https://github.com/fredj))
* [#7815](https://github.com/openlayers/openlayers/pull/7815) - Remove private statics from webgl related modules ([@bjornharrtell](https://github.com/bjornharrtell))
* [#7803](https://github.com/openlayers/openlayers/pull/7803) - Remove private static members from constructors ([@tschaub](https://github.com/tschaub))
* [#7808](https://github.com/openlayers/openlayers/pull/7808) - Make sure the requested image size matches the desired ratio ([@ahocevar](https://github.com/ahocevar))
* [#7807](https://github.com/openlayers/openlayers/pull/7807) - Run typecheck after tests, because of its current verbosity ([@ahocevar](https://github.com/ahocevar))
* [#7805](https://github.com/openlayers/openlayers/pull/7805) - Remove private static members from constructors ([@fredj](https://github.com/fredj))
* [#7771](https://github.com/openlayers/openlayers/pull/7771) - Named exports from loadingstrategy ([@marcjansen](https://github.com/marcjansen))
* [#7772](https://github.com/openlayers/openlayers/pull/7772) - Named exports from filter module ([@marcjansen](https://github.com/marcjansen))
* [#7770](https://github.com/openlayers/openlayers/pull/7770) - Rename _ol_render_Box_ to RenderBox ([@marcjansen](https://github.com/marcjansen))
* [#7763](https://github.com/openlayers/openlayers/pull/7763) - Use the temporary extent in VectorTileLayer ([@fredj](https://github.com/fredj))
* [#7765](https://github.com/openlayers/openlayers/pull/7765) - Named exports from events condition ([@marcjansen](https://github.com/marcjansen))
* [#7767](https://github.com/openlayers/openlayers/pull/7767) - Transformation functions: Fix spelling and use the symbol × ([@marcjansen](https://github.com/marcjansen))
* [#7764](https://github.com/openlayers/openlayers/pull/7764) - Named exports from ol/has ([@tschaub](https://github.com/tschaub))
* [#7761](https://github.com/openlayers/openlayers/pull/7761) - Rename _ol_render_canvas_Instruction_ to CanvasInstruction ([@fredj](https://github.com/fredj))
* [#7749](https://github.com/openlayers/openlayers/pull/7749) - Check if the sketch feature is defined in finishDrawing ([@fredj](https://github.com/fredj))
* [#7745](https://github.com/openlayers/openlayers/pull/7745) - More named exports ([@fredj](https://github.com/fredj))
* [#7743](https://github.com/openlayers/openlayers/pull/7743) - Set enableHighAccuracy in geolocation example ([@fredj](https://github.com/fredj))
* [#7738](https://github.com/openlayers/openlayers/pull/7738) - Named exports from ol/events ([@tschaub](https://github.com/tschaub))
* [#7711](https://github.com/openlayers/openlayers/pull/7711) - Do not use (I)CLA anymore ([@bartvde](https://github.com/bartvde))
* [#7709](https://github.com/openlayers/openlayers/pull/7709) - More named export ([@fredj](https://github.com/fredj))
* [#7705](https://github.com/openlayers/openlayers/pull/7705) - More renaming ([@fredj](https://github.com/fredj))
* [#7700](https://github.com/openlayers/openlayers/pull/7700) - Fix ScaleLine control for Projections in degrees ([@pedros007](https://github.com/pedros007))
* [#7697](https://github.com/openlayers/openlayers/pull/7697) - Use const and let ([@tschaub](https://github.com/tschaub))
* [#7695](https://github.com/openlayers/openlayers/pull/7695) - More renaming ([@tschaub](https://github.com/tschaub))
* [#7693](https://github.com/openlayers/openlayers/pull/7693) - More import renaming ([@fredj](https://github.com/fredj))
* [#7686](https://github.com/openlayers/openlayers/pull/7686) - More import renaming ([@tschaub](https://github.com/tschaub))
* [#7669](https://github.com/openlayers/openlayers/pull/7669) - Use declutter tree only for text and image replays ([@ahocevar](https://github.com/ahocevar))
* [#7683](https://github.com/openlayers/openlayers/pull/7683) - Move IGCZ enum to src/ol/format/IGC.js ([@fredj](https://github.com/fredj))
* [#7682](https://github.com/openlayers/openlayers/pull/7682) - Add new condition to MouseWheelZoom interaction ([@fredj](https://github.com/fredj))
* [#7676](https://github.com/openlayers/openlayers/pull/7676) - Check fonts against two reference fonts ([@ahocevar](https://github.com/ahocevar))
* [#7668](https://github.com/openlayers/openlayers/pull/7668) - Hit detect text background ([@ahocevar](https://github.com/ahocevar))
* [#7661](https://github.com/openlayers/openlayers/pull/7661) - Background fill stroke ([@ahocevar](https://github.com/ahocevar))
* [#7654](https://github.com/openlayers/openlayers/pull/7654) - Add named export for transformWithOptions function ([@fredj](https://github.com/fredj))
* [#7652](https://github.com/openlayers/openlayers/pull/7652) - More renaming ([@fredj](https://github.com/fredj))
* [#7649](https://github.com/openlayers/openlayers/pull/7649) - Named Map export for ol/Map ([@raiyni](https://github.com/raiyni))
* [#7646](https://github.com/openlayers/openlayers/pull/7646) - Named export for Polyline format and SimpleGeometry ([@openlayers](https://github.com/openlayers))
* [#7650](https://github.com/openlayers/openlayers/pull/7650) - Rename _ol_PluggableMap_ to PluggableMap ([@fredj](https://github.com/fredj))
* [#7642](https://github.com/openlayers/openlayers/pull/7642) - Don't store private function into GPX ([@fredj](https://github.com/fredj))
* [#7643](https://github.com/openlayers/openlayers/pull/7643) - Replace ol/Sphere with ol/sphere ([@tschaub](https://github.com/tschaub))
* [#7644](https://github.com/openlayers/openlayers/pull/7644) - Named exports from ol/math module ([@raiyni](https://github.com/raiyni))
* [#7636](https://github.com/openlayers/openlayers/pull/7636) - Named exports from the ol/array module ([@marcjansen](https://github.com/marcjansen))
* [#7614](https://github.com/openlayers/openlayers/pull/7614) - Remove opt_this from the API ([@KlausBenndorf](https://github.com/KlausBenndorf))
* [#7640](https://github.com/openlayers/openlayers/pull/7640) - Remove unneeded and already skipped test ([@openlayers](https://github.com/openlayers))
* [#7637](https://github.com/openlayers/openlayers/pull/7637) - Named exports from the ol/color module ([@marcjansen](https://github.com/marcjansen))
* [#7639](https://github.com/openlayers/openlayers/pull/7639) - Don't store private function into GeoJSON ([@fredj](https://github.com/fredj))
* [#7635](https://github.com/openlayers/openlayers/pull/7635) - More module renaming ([@fredj](https://github.com/fredj))
* [#7632](https://github.com/openlayers/openlayers/pull/7632) - Named exports from ol/css module ([@marcjansen](https://github.com/marcjansen))
* [#7634](https://github.com/openlayers/openlayers/pull/7634) - Rename _ol_layer_Tile_ to TileLayer ([@marcjansen](https://github.com/marcjansen))
* [#7633](https://github.com/openlayers/openlayers/pull/7633) - Import assert function directly ([@marcjansen](https://github.com/marcjansen))
* [#7631](https://github.com/openlayers/openlayers/pull/7631) - More named export and rename ([@fredj](https://github.com/fredj))
* [#7627](https://github.com/openlayers/openlayers/pull/7627) - Nicer import name ([@fredj](https://github.com/fredj))
* [#7622](https://github.com/openlayers/openlayers/pull/7622) - Named export ([@fredj](https://github.com/fredj))
* [#7563](https://github.com/openlayers/openlayers/pull/7563) - Use full precision for the declutter box ([@ahocevar](https://github.com/ahocevar))
* [#7559](https://github.com/openlayers/openlayers/pull/7559) - Handle skipping and unskipping features with renderMode: 'image' ([@ahocevar](https://github.com/ahocevar))
* [#7554](https://github.com/openlayers/openlayers/pull/7554) - Only compose image vector frame when the replay group has changed ([@ahocevar](https://github.com/ahocevar))
* [#7550](https://github.com/openlayers/openlayers/pull/7550) - Update examples to d3.js v4 ([@fredj](https://github.com/fredj))
* [#7548](https://github.com/openlayers/openlayers/pull/7548) - Fix pull request link ([@openlayers](https://github.com/openlayers))
* [#7543](https://github.com/openlayers/openlayers/pull/7543) - Donut polygon labels do not get a chance to get rendered ([@ahocevar](https://github.com/ahocevar))
* [#7542](https://github.com/openlayers/openlayers/pull/7542) - Still respect deprecated exceedLength option ([@ahocevar](https://github.com/ahocevar))
* [#7541](https://github.com/openlayers/openlayers/pull/7541) - Fix case of vectorrendertype.js ([@ahocevar](https://github.com/ahocevar))
<details>
<summary>Dependency Updates</summary>
* [#8315](https://github.com/openlayers/openlayers/pull/8315) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8309](https://github.com/openlayers/openlayers/pull/8309) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8311](https://github.com/openlayers/openlayers/pull/8311) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8310](https://github.com/openlayers/openlayers/pull/8310) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8297](https://github.com/openlayers/openlayers/pull/8297) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8293](https://github.com/openlayers/openlayers/pull/8293) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8285](https://github.com/openlayers/openlayers/pull/8285) - Update google-closure-compiler to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8275](https://github.com/openlayers/openlayers/pull/8275) - Update serve to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8271](https://github.com/openlayers/openlayers/pull/8271) - chore(package): update google-closure-compiler to version 20180610.0.1 ([@openlayers](https://github.com/openlayers))
* [#8270](https://github.com/openlayers/openlayers/pull/8270) - chore(package): update rollup to version 0.60.7 ([@openlayers](https://github.com/openlayers))
* [#8266](https://github.com/openlayers/openlayers/pull/8266) - chore(package): update rollup to version 0.60.4 ([@openlayers](https://github.com/openlayers))
* [#8261](https://github.com/openlayers/openlayers/pull/8261) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8260](https://github.com/openlayers/openlayers/pull/8260) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8252](https://github.com/openlayers/openlayers/pull/8252) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8248](https://github.com/openlayers/openlayers/pull/8248) - Update serve to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8247](https://github.com/openlayers/openlayers/pull/8247) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8241](https://github.com/openlayers/openlayers/pull/8241) - Update recast to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8230](https://github.com/openlayers/openlayers/pull/8230) - Update serve to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8208](https://github.com/openlayers/openlayers/pull/8208) - Update marked to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8205](https://github.com/openlayers/openlayers/pull/8205) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8179](https://github.com/openlayers/openlayers/pull/8179) - Update google-closure-compiler to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8146](https://github.com/openlayers/openlayers/pull/8146) - Update coveralls to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8145](https://github.com/openlayers/openlayers/pull/8145) - Update fs-extra to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8140](https://github.com/openlayers/openlayers/pull/8140) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8131](https://github.com/openlayers/openlayers/pull/8131) - Update babel-plugin-jsdoc-closure to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8130](https://github.com/openlayers/openlayers/pull/8130) - Update babel-plugin-jsdoc-closure to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8128](https://github.com/openlayers/openlayers/pull/8128) - Update babel-plugin-jsdoc-closure to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8124](https://github.com/openlayers/openlayers/pull/8124) - Update babel-plugin-jsdoc-closure to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8102](https://github.com/openlayers/openlayers/pull/8102) - Update babel-plugin-jsdoc-closure to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8095](https://github.com/openlayers/openlayers/pull/8095) - Update babel-plugin-jsdoc-closure to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8094](https://github.com/openlayers/openlayers/pull/8094) - Update babel-plugin-jsdoc-closure to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8093](https://github.com/openlayers/openlayers/pull/8093) - chore(package): update serve to version 6.5.5 ([@openlayers](https://github.com/openlayers))
* [#8090](https://github.com/openlayers/openlayers/pull/8090) - chore(package): update url-polyfill to version 1.0.13 ([@openlayers](https://github.com/openlayers))
* [#8091](https://github.com/openlayers/openlayers/pull/8091) - chore(package): update karma-firefox-launcher to version 1.1.0 ([@openlayers](https://github.com/openlayers))
* [#8085](https://github.com/openlayers/openlayers/pull/8085) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8071](https://github.com/openlayers/openlayers/pull/8071) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8060](https://github.com/openlayers/openlayers/pull/8060) - Update google-closure-compiler to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8039](https://github.com/openlayers/openlayers/pull/8039) - Update google-closure-compiler to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8028](https://github.com/openlayers/openlayers/pull/8028) - Update marked to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8019](https://github.com/openlayers/openlayers/pull/8019) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8017](https://github.com/openlayers/openlayers/pull/8017) - Update marked to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8018](https://github.com/openlayers/openlayers/pull/8018) - Update recast to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8014](https://github.com/openlayers/openlayers/pull/8014) - Update recast to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8009](https://github.com/openlayers/openlayers/pull/8009) - chore(package): update sinon to version 5.0.0 ([@openlayers](https://github.com/openlayers))
* [#8008](https://github.com/openlayers/openlayers/pull/8008) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8000](https://github.com/openlayers/openlayers/pull/8000) - Update karma-webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7990](https://github.com/openlayers/openlayers/pull/7990) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7984](https://github.com/openlayers/openlayers/pull/7984) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7981](https://github.com/openlayers/openlayers/pull/7981) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7977](https://github.com/openlayers/openlayers/pull/7977) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7972](https://github.com/openlayers/openlayers/pull/7972) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7963](https://github.com/openlayers/openlayers/pull/7963) - chore(package): update url-polyfill to version 1.0.11 ([@openlayers](https://github.com/openlayers))
* [#7962](https://github.com/openlayers/openlayers/pull/7962) - chore(package): update serve to version 6.5.2 ([@openlayers](https://github.com/openlayers))
* [#7959](https://github.com/openlayers/openlayers/pull/7959) - Update babel-plugin-jsdoc-closure to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7957](https://github.com/openlayers/openlayers/pull/7957) - Update recast to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7950](https://github.com/openlayers/openlayers/pull/7950) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7945](https://github.com/openlayers/openlayers/pull/7945) - Update babel-plugin-jsdoc-closure to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7943](https://github.com/openlayers/openlayers/pull/7943) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7940](https://github.com/openlayers/openlayers/pull/7940) - Update babel-plugin-jsdoc-closure to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7938](https://github.com/openlayers/openlayers/pull/7938) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7925](https://github.com/openlayers/openlayers/pull/7925) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7921](https://github.com/openlayers/openlayers/pull/7921) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7916](https://github.com/openlayers/openlayers/pull/7916) - chore(package): update html-webpack-plugin to version 3.0.1 ([@openlayers](https://github.com/openlayers))
* [#7905](https://github.com/openlayers/openlayers/pull/7905) - Update karma-webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7903](https://github.com/openlayers/openlayers/pull/7903) - Update marked to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7901](https://github.com/openlayers/openlayers/pull/7901) - Update karma-webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7898](https://github.com/openlayers/openlayers/pull/7898) - chore(package): update karma-webpack to version 2.0.11 ([@openlayers](https://github.com/openlayers))
* [#7893](https://github.com/openlayers/openlayers/pull/7893) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7891](https://github.com/openlayers/openlayers/pull/7891) - chore(package): update recast to version 0.14.4 ([@openlayers](https://github.com/openlayers))
* [#7886](https://github.com/openlayers/openlayers/pull/7886) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7882](https://github.com/openlayers/openlayers/pull/7882) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7876](https://github.com/openlayers/openlayers/pull/7876) - Update recast to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7877](https://github.com/openlayers/openlayers/pull/7877) - Update webpack-merge to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7865](https://github.com/openlayers/openlayers/pull/7865) - Update marked to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7866](https://github.com/openlayers/openlayers/pull/7866) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7867](https://github.com/openlayers/openlayers/pull/7867) - Update recast to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7858](https://github.com/openlayers/openlayers/pull/7858) - Update recast to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7850](https://github.com/openlayers/openlayers/pull/7850) - Update marked to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7849](https://github.com/openlayers/openlayers/pull/7849) - Update recast to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7848](https://github.com/openlayers/openlayers/pull/7848) - Update nomnom to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7847](https://github.com/openlayers/openlayers/pull/7847) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7845](https://github.com/openlayers/openlayers/pull/7845) - chore(package): update marked to version 0.3.14 ([@openlayers](https://github.com/openlayers))
* [#7822](https://github.com/openlayers/openlayers/pull/7822) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7813](https://github.com/openlayers/openlayers/pull/7813) - Update recast to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7809](https://github.com/openlayers/openlayers/pull/7809) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7812](https://github.com/openlayers/openlayers/pull/7812) - chore(package): update sinon to version 4.3.0 ([@openlayers](https://github.com/openlayers))
* [#7777](https://github.com/openlayers/openlayers/pull/7777) - Update babel-minify-webpack-plugin to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7759](https://github.com/openlayers/openlayers/pull/7759) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7746](https://github.com/openlayers/openlayers/pull/7746) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7735](https://github.com/openlayers/openlayers/pull/7735) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7729](https://github.com/openlayers/openlayers/pull/7729) - Update jquery to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7732](https://github.com/openlayers/openlayers/pull/7732) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7731](https://github.com/openlayers/openlayers/pull/7731) - Update webpack-dev-server to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7728](https://github.com/openlayers/openlayers/pull/7728) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7720](https://github.com/openlayers/openlayers/pull/7720) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7712](https://github.com/openlayers/openlayers/pull/7712) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7702](https://github.com/openlayers/openlayers/pull/7702) - Update webpack-dev-server to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7701](https://github.com/openlayers/openlayers/pull/7701) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7691](https://github.com/openlayers/openlayers/pull/7691) - Update webpack-dev-server to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7688](https://github.com/openlayers/openlayers/pull/7688) - Update marked to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7685](https://github.com/openlayers/openlayers/pull/7685) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7681](https://github.com/openlayers/openlayers/pull/7681) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7680](https://github.com/openlayers/openlayers/pull/7680) - Update webpack-dev-server to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7667](https://github.com/openlayers/openlayers/pull/7667) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7656](https://github.com/openlayers/openlayers/pull/7656) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7655](https://github.com/openlayers/openlayers/pull/7655) - Update marked to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7651](https://github.com/openlayers/openlayers/pull/7651) - Update karma to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7647](https://github.com/openlayers/openlayers/pull/7647) - Update rbush to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7596](https://github.com/openlayers/openlayers/pull/7596) - Update karma-webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7589](https://github.com/openlayers/openlayers/pull/7589) - chore(package): update karma-webpack to version 2.0.8 ([@openlayers](https://github.com/openlayers))
* [#7571](https://github.com/openlayers/openlayers/pull/7571) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7567](https://github.com/openlayers/openlayers/pull/7567) - Update fs-extra to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7558](https://github.com/openlayers/openlayers/pull/7558) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7552](https://github.com/openlayers/openlayers/pull/7552) - Update jscodeshift to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#7551](https://github.com/openlayers/openlayers/pull/7551) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
The v5.0.1 release helps reduce bundle sizes for bundlers that support the `"sideEffects": "false"`option in `package.json`, and fixes website documentation regarding cdn locations and debug build which has been replaced by source maps.
## Fixes
* [#8341](https://github.com/openlayers/openlayers/pull/8341) - Set sideEffects: false flag ([@ahocevar](https://github.com/ahocevar))
* [#8342](https://github.com/openlayers/openlayers/pull/8342) - Fix links and description in quickstart tutorial ([@ahocevar](https://github.com/ahocevar))
* [#8371](https://github.com/openlayers/openlayers/pull/8371) - Skip rendering when there is no replay group ([@ahocevar](https://github.com/ahocevar))
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](https://github.com/openlayers/openlayers/pull/8409) - Add abstract translate to ol/geom/Geometry ([@pjeweb](https://github.com/pjeweb))
* [#8405](https://github.com/openlayers/openlayers/pull/8405) - Minor type fixes ([@tschaub](https://github.com/tschaub))
* [#8401](https://github.com/openlayers/openlayers/pull/8401) - Make webpack's css loader work ([@ahocevar](https://github.com/ahocevar))
* [#8399](https://github.com/openlayers/openlayers/pull/8399) - Copy ol.css to build dir when building package ([@ahocevar](https://github.com/ahocevar))
* [#8368](https://github.com/openlayers/openlayers/pull/8368) - Make render listeners work with image render mode ([@ahocevar](https://github.com/ahocevar))
* [#8376](https://github.com/openlayers/openlayers/pull/8376) - copy ZM values to polygon in makeRegular ([@virtualcitySYSTEMS](https://github.com/virtualcitySYSTEMS))
* [#8371](https://github.com/openlayers/openlayers/pull/8371) - Skip rendering when there is no replay group ([@ahocevar](https://github.com/ahocevar))
* [#8352](https://github.com/openlayers/openlayers/pull/8352) - Set `sideEffects` to `false` instead of `"false"` ([@tschaub](https://github.com/tschaub))
* [#8351](https://github.com/openlayers/openlayers/pull/8351) - Fix typo in release notes ([@ahocevar](https://github.com/ahocevar))
* [#8350](https://github.com/openlayers/openlayers/pull/8350) - Updates for v5.0.2 ([@ahocevar](https://github.com/ahocevar))
* [#8342](https://github.com/openlayers/openlayers/pull/8342) - Fix links and description in quickstart tutorial ([@ahocevar](https://github.com/ahocevar))
* [#8344](https://github.com/openlayers/openlayers/pull/8344) - Updated issue and pr templates ([@tschaub](https://github.com/tschaub))
* [#8341](https://github.com/openlayers/openlayers/pull/8341) - Set sideEffects: false flag ([@ahocevar](https://github.com/ahocevar))
* [#8333](https://github.com/openlayers/openlayers/pull/8333) - Fix wrong return type for readHref function ([@openlayers](https://github.com/openlayers))
* [#8319](https://github.com/openlayers/openlayers/pull/8319) - Remove reference to setProj4 function in documentation ([@fredj](https://github.com/fredj))
<details>
<summary>Dependency Updates</summary>
* [#8410](https://github.com/openlayers/openlayers/pull/8410) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8408](https://github.com/openlayers/openlayers/pull/8408) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8386](https://github.com/openlayers/openlayers/pull/8386) - Update fs-extra to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8382](https://github.com/openlayers/openlayers/pull/8382) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8373](https://github.com/openlayers/openlayers/pull/8373) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8355](https://github.com/openlayers/openlayers/pull/8355) - Update recast to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8354](https://github.com/openlayers/openlayers/pull/8354) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8348](https://github.com/openlayers/openlayers/pull/8348) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8338](https://github.com/openlayers/openlayers/pull/8338) - Update recast to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8332](https://github.com/openlayers/openlayers/pull/8332) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8326](https://github.com/openlayers/openlayers/pull/8326) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8321](https://github.com/openlayers/openlayers/pull/8321) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8318](https://github.com/openlayers/openlayers/pull/8318) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
The 5.1.1 release is a patch to include the readme in the package. See the [5.1.0 notes](https://github.com/openlayers/openlayers/releases/tag/v5.1.0) for detail on the 5.1 release.
The 5.1.2 release is a patch to fix the API docs. See the [5.1.0 notes](https://github.com/openlayers/openlayers/releases/tag/v5.1.0) for detail on the 5.1 release.
* [#8413](https://github.com/openlayers/openlayers/pull/8413) - Remove extra curly in type ([@tschaub](https://github.com/tschaub))
The 5.1.3 release is a patch to fix the API docs and the legacy full build. See the [5.1.0 notes](https://github.com/openlayers/openlayers/releases/tag/v5.1.0) for detail on the 5.1 release.
* [#8417](https://github.com/openlayers/openlayers/pull/8417) - Minor doc updates ([@tschaub](https://github.com/tschaub))
* [#8418](https://github.com/openlayers/openlayers/pull/8418) - Set api annotation on classdesc, not constructor ([@ahocevar](https://github.com/ahocevar))
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](https://github.com/openlayers/openlayers/pull/8511) - Update IGN API key ([@openlayers](https://github.com/openlayers))
* [#8547](https://github.com/openlayers/openlayers/pull/8547) - Fix port number in developing doc ([@pgiraud](https://github.com/pgiraud))
* [#8546](https://github.com/openlayers/openlayers/pull/8546) - Update projection FAQ for v5 ([@ahocevar](https://github.com/ahocevar))
* [#8481](https://github.com/openlayers/openlayers/pull/8481) - Expose some internal functions ([@gberaudo](https://github.com/gberaudo))
* [#8510](https://github.com/openlayers/openlayers/pull/8510) - Fix WMTS URLs with dimensions ([@gberaudo](https://github.com/gberaudo))
* [#8524](https://github.com/openlayers/openlayers/pull/8524) - Fix compatiblity with XHTML content type ([@NeoRaider](https://github.com/NeoRaider))
* [#8529](https://github.com/openlayers/openlayers/pull/8529) - Update link to base class in docs ([@TDesjardins](https://github.com/TDesjardins))
* [#8528](https://github.com/openlayers/openlayers/pull/8528) - Update link to base class in docs ([@TDesjardins](https://github.com/TDesjardins))
* [#8525](https://github.com/openlayers/openlayers/pull/8525) - Re-export Projection from ol/proj for convenience ([@tschaub](https://github.com/tschaub))
* [#8499](https://github.com/openlayers/openlayers/pull/8499) - Round center in viewState to pixels ([@ahocevar](https://github.com/ahocevar))
* [#8520](https://github.com/openlayers/openlayers/pull/8520) - Remove redundant if block ([@openlayers](https://github.com/openlayers))
* [#8515](https://github.com/openlayers/openlayers/pull/8515) - More convenient select and sketch layer management ([@ahocevar](https://github.com/ahocevar))
* [#8490](https://github.com/openlayers/openlayers/pull/8490) - WMTS getCapabilities readCoodinates more than one whitespace delimiter ([@MarquesDeAzevedo](https://github.com/MarquesDeAzevedo))
* [#8489](https://github.com/openlayers/openlayers/pull/8489) - Use .prototype. only where necessary ([@ahocevar](https://github.com/ahocevar))
* [#8478](https://github.com/openlayers/openlayers/pull/8478) - Check font availability with multiple font weights ([@ahocevar](https://github.com/ahocevar))
* [#8483](https://github.com/openlayers/openlayers/pull/8483) - Don't create Polygon with null coordinates ([@fredj](https://github.com/fredj))
* [#8471](https://github.com/openlayers/openlayers/pull/8471) - Add getUrl and getImageExtent to ImageStatic API ([@samuel-girard](https://github.com/samuel-girard))
* [#8470](https://github.com/openlayers/openlayers/pull/8470) - Update Tile loading API docs ([@scroach](https://github.com/scroach))
* [#8477](https://github.com/openlayers/openlayers/pull/8477) - Expose original getGutter ([@gberaudo](https://github.com/gberaudo))
* [#8466](https://github.com/openlayers/openlayers/pull/8466) - Add onFocusOnly option to interaction defaults ([@ahocevar](https://github.com/ahocevar))
* [#8465](https://github.com/openlayers/openlayers/pull/8465) - Do not prevent default on pointermove ([@ahocevar](https://github.com/ahocevar))
* [#8452](https://github.com/openlayers/openlayers/pull/8452) - Remove extra translate function in Geometry, add missing api tag ([@fredj](https://github.com/fredj))
* [#8450](https://github.com/openlayers/openlayers/pull/8450) - Mark properties of ReadOptions and WriteOptions as optional ([@fredj](https://github.com/fredj))
* [#8439](https://github.com/openlayers/openlayers/pull/8439) - Fewer dots in types ([@tschaub](https://github.com/tschaub))
* [#8441](https://github.com/openlayers/openlayers/pull/8441) - Fix loaded script for the example-verbatim examples ([@fredj](https://github.com/fredj))
* [#8435](https://github.com/openlayers/openlayers/pull/8435) - Call setCoordinates on the point instance ([@fredj](https://github.com/fredj))
* [#8428](https://github.com/openlayers/openlayers/pull/8428) - Type name on same line as type ([@tschaub](https://github.com/tschaub))
* [#8422](https://github.com/openlayers/openlayers/pull/8422) - Improve JSDoc such that `ng build --prod` with angular/cli 6.0.8 succeeds again ([@jkoelewijn](https://github.com/jkoelewijn))
* [#8417](https://github.com/openlayers/openlayers/pull/8417) - Minor doc updates ([@tschaub](https://github.com/tschaub))
* [#8418](https://github.com/openlayers/openlayers/pull/8418) - Set api annotation on classdesc, not constructor ([@ahocevar](https://github.com/ahocevar))
* [#8414](https://github.com/openlayers/openlayers/pull/8414) - Updates for 5.1.2 ([@tschaub](https://github.com/tschaub))
* [#8413](https://github.com/openlayers/openlayers/pull/8413) - Remove extra curly in type ([@tschaub](https://github.com/tschaub))
* [#8412](https://github.com/openlayers/openlayers/pull/8412) - Changes for 5.1.1. ([@tschaub](https://github.com/tschaub))
<details>
<summary>Dependency Updates</summary>
* [#8543](https://github.com/openlayers/openlayers/pull/8543) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8541](https://github.com/openlayers/openlayers/pull/8541) - Update proj4 to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8542](https://github.com/openlayers/openlayers/pull/8542) - Update rollup-plugin-commonjs to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8533](https://github.com/openlayers/openlayers/pull/8533) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8530](https://github.com/openlayers/openlayers/pull/8530) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8522](https://github.com/openlayers/openlayers/pull/8522) - Update marked to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8505](https://github.com/openlayers/openlayers/pull/8505) - Update karma to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8501](https://github.com/openlayers/openlayers/pull/8501) - Update rollup-plugin-commonjs to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8495](https://github.com/openlayers/openlayers/pull/8495) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8493](https://github.com/openlayers/openlayers/pull/8493) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8491](https://github.com/openlayers/openlayers/pull/8491) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8486](https://github.com/openlayers/openlayers/pull/8486) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8476](https://github.com/openlayers/openlayers/pull/8476) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8475](https://github.com/openlayers/openlayers/pull/8475) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8469](https://github.com/openlayers/openlayers/pull/8469) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8453](https://github.com/openlayers/openlayers/pull/8453) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8447](https://github.com/openlayers/openlayers/pull/8447) - Update rollup-plugin-commonjs to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8426](https://github.com/openlayers/openlayers/pull/8426) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
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](https://github.com/openlayers/openlayers/pull/8642) - Fixes for optional key passing, issue #8067 for tile sources ([@dimin](https://github.com/dimin))
* [#8885](https://github.com/openlayers/openlayers/pull/8885) - Move GeolocationProperty into Geolocation ([@fredj](https://github.com/fredj))
* [#8881](https://github.com/openlayers/openlayers/pull/8881) - Remove custom styles in drag-and-drop examples ([@fredj](https://github.com/fredj))
* [#8858](https://github.com/openlayers/openlayers/pull/8858) - Add condition for viewParams and TypeScript related option ([@webgeodatavore](https://github.com/webgeodatavore))
* [#8879](https://github.com/openlayers/openlayers/pull/8879) - Build with CircleCI ([@openlayers](https://github.com/openlayers))
* [#8862](https://github.com/openlayers/openlayers/pull/8862) - Legacy build and apidoc improvements ([@ahocevar](https://github.com/ahocevar))
* [#8867](https://github.com/openlayers/openlayers/pull/8867) - Fix example builder ([@ahocevar](https://github.com/ahocevar))
* [#8852](https://github.com/openlayers/openlayers/pull/8852) - Improve link handling in API docs ([@ahocevar](https://github.com/ahocevar))
* [#8853](https://github.com/openlayers/openlayers/pull/8853) - Make rendercomplete work with vector sources without loader ([@ahocevar](https://github.com/ahocevar))
* [#8851](https://github.com/openlayers/openlayers/pull/8851) - Use typescript types for RBush ([@fredj](https://github.com/fredj))
* [#8850](https://github.com/openlayers/openlayers/pull/8850) - Remove old TODO in ol/Graticule ([@fredj](https://github.com/fredj))
* [#8847](https://github.com/openlayers/openlayers/pull/8847) - Fix API docs ([@ahocevar](https://github.com/ahocevar))
* [#8845](https://github.com/openlayers/openlayers/pull/8845) - Remove RenderType enum from vector layer ([@tschaub](https://github.com/tschaub))
* [#8843](https://github.com/openlayers/openlayers/pull/8843) - Fix ts typing for fullscreen button ([@tonio](https://github.com/tonio))
* [#8841](https://github.com/openlayers/openlayers/pull/8841) - Use super.method instead of prototype.method.call ([@fredj](https://github.com/fredj))
* [#8842](https://github.com/openlayers/openlayers/pull/8842) - Change target type from Element to HTMLElement ([@fredj](https://github.com/fredj))
* [#8840](https://github.com/openlayers/openlayers/pull/8840) - Remove unneeded code in VectorTile renderer ([@elemoine](https://github.com/elemoine))
* [#8844](https://github.com/openlayers/openlayers/pull/8844) - Set crossOrigin to anonymous in mapbox-streets-v6-style ([@elemoine](https://github.com/elemoine))
* [#8776](https://github.com/openlayers/openlayers/pull/8776) - Use setTimeout without the window namespace ([@ahocevar](https://github.com/ahocevar))
* [#8837](https://github.com/openlayers/openlayers/pull/8837) - Re-export MousePosition from ol/control ([@fredj](https://github.com/fredj))
* [#8832](https://github.com/openlayers/openlayers/pull/8832) - Remove source foreachfeatureatcoordinate from ol/renderer/webgl/ImageLayer ([@fredj](https://github.com/fredj))
* [#8833](https://github.com/openlayers/openlayers/pull/8833) - Fix wrong filename in type annotation ([@fredj](https://github.com/fredj))
* [#8827](https://github.com/openlayers/openlayers/pull/8827) - Removed unused forEachFeatureAtCoordinate from ol/source/Source ([@schmidtk](https://github.com/schmidtk))
* [#8830](https://github.com/openlayers/openlayers/pull/8830) - Type annotation fixes in ol/control/ ([@fredj](https://github.com/fredj))
* [#8829](https://github.com/openlayers/openlayers/pull/8829) - Change getUid return type from number to string ([@fredj](https://github.com/fredj))
* [#8828](https://github.com/openlayers/openlayers/pull/8828) - Re-export VectorTile from ol/source ([@elemoine](https://github.com/elemoine))
* [#8806](https://github.com/openlayers/openlayers/pull/8806) - Preserve button class name list in full screen control on toggle ([@notnotse](https://github.com/notnotse))
* [#8817](https://github.com/openlayers/openlayers/pull/8817) - Clarify format option for ol/source/WMTS ([@romanzoller](https://github.com/romanzoller))
* [#8824](https://github.com/openlayers/openlayers/pull/8824) - Fix TypeScript errors in ol/format/GML ([@schmidtk](https://github.com/schmidtk))
* [#8519](https://github.com/openlayers/openlayers/pull/8519) - GML Format Improvements #8516#8517#8518 ([@NielsCharlier](https://github.com/NielsCharlier))
* [#8711](https://github.com/openlayers/openlayers/pull/8711) - Fix TypeScript errors in ol/format/GML ([@schmidtk](https://github.com/schmidtk))
* [#8818](https://github.com/openlayers/openlayers/pull/8818) - Fix the way zoom comes from ([@cs09g](https://github.com/cs09g))
* [#8804](https://github.com/openlayers/openlayers/pull/8804) - Add possibility to disable collapsible attributions from Source ([@notnotse](https://github.com/notnotse))
* [#8787](https://github.com/openlayers/openlayers/pull/8787) - Replace instanceof checks with other logic ([@ahocevar](https://github.com/ahocevar))
* [#8808](https://github.com/openlayers/openlayers/pull/8808) - Fix format and version properties in ol/source/WMTS Options typedef ([@fredj](https://github.com/fredj))
* [#8798](https://github.com/openlayers/openlayers/pull/8798) - Use unpkg.com instead of rawgit.com ([@fredj](https://github.com/fredj))
* [#8805](https://github.com/openlayers/openlayers/pull/8805) - Do not draw image with width or height < 0.5 ([@notnotse](https://github.com/notnotse))
* [#8803](https://github.com/openlayers/openlayers/pull/8803) - Handle zoom slider position with floating point numbers ([@notnotse](https://github.com/notnotse))
* [#8789](https://github.com/openlayers/openlayers/pull/8789) - Spelling and indentation fixes ([@fredj](https://github.com/fredj))
* [#8781](https://github.com/openlayers/openlayers/pull/8781) - Fix type check errors ([@schmidtk](https://github.com/schmidtk))
* [#8779](https://github.com/openlayers/openlayers/pull/8779) - Fix additional type check errors ([@schmidtk](https://github.com/schmidtk))
* [#8753](https://github.com/openlayers/openlayers/pull/8753) - Fix type check in ol/PluggableMap.js ([@wallw-bits](https://github.com/wallw-bits))
* [#8762](https://github.com/openlayers/openlayers/pull/8762) - Fix type errors from interaction event handlers ([@schmidtk](https://github.com/schmidtk))
* [#8763](https://github.com/openlayers/openlayers/pull/8763) - Fix type check for ol/events ([@wallw-bits](https://github.com/wallw-bits))
* [#8774](https://github.com/openlayers/openlayers/pull/8774) - Fix type check errors in ol/renderer/webgl ([@schmidtk](https://github.com/schmidtk))
* [#8768](https://github.com/openlayers/openlayers/pull/8768) - Fix type check errors in ol/interaction/Select ([@schmidtk](https://github.com/schmidtk))
* [#8764](https://github.com/openlayers/openlayers/pull/8764) - Fix TypeScript errors in ol/interaction/Draw ([@schmidtk](https://github.com/schmidtk))
* [#8767](https://github.com/openlayers/openlayers/pull/8767) - Fix type check errors in ol/interaction/Modify ([@schmidtk](https://github.com/schmidtk))
* [#8773](https://github.com/openlayers/openlayers/pull/8773) - Fix type check errors in ol/renderer/canvas ([@schmidtk](https://github.com/schmidtk))
* [#8769](https://github.com/openlayers/openlayers/pull/8769) - Fix type check errors in ol/render/canvas ([@schmidtk](https://github.com/schmidtk))
* [#8770](https://github.com/openlayers/openlayers/pull/8770) - Fix type check errors in ol/render/webgl ([@schmidtk](https://github.com/schmidtk))
* [#8744](https://github.com/openlayers/openlayers/pull/8744) - Fix type checks in VectorTileSource ([@wallw-bits](https://github.com/wallw-bits))
* [#8740](https://github.com/openlayers/openlayers/pull/8740) - Increase linestring textalign test tolerance to be Firefox compliant. ([@benVigie](https://github.com/benVigie))
* [#8738](https://github.com/openlayers/openlayers/pull/8738) - Cast to parent type to fix TS errors ([@schmidtk](https://github.com/schmidtk))
* [#8737](https://github.com/openlayers/openlayers/pull/8737) - Flag optional param to fix TS error ([@schmidtk](https://github.com/schmidtk))
* [#8742](https://github.com/openlayers/openlayers/pull/8742) - Fix type checks in Vector source ([@wallw-bits](https://github.com/wallw-bits))
* [#8743](https://github.com/openlayers/openlayers/pull/8743) - Fix type check in Raster source ([@wallw-bits](https://github.com/wallw-bits))
* [#8733](https://github.com/openlayers/openlayers/pull/8733) - Fix TypeScript errors in ol/format/WFS ([@schmidtk](https://github.com/schmidtk))
* [#8735](https://github.com/openlayers/openlayers/pull/8735) - Fix TypeScript errors in ol/format/WKT ([@schmidtk](https://github.com/schmidtk))
* [#8730](https://github.com/openlayers/openlayers/pull/8730) - Fix TypeScript errors in ol/format/KML ([@schmidtk](https://github.com/schmidtk))
* [#8732](https://github.com/openlayers/openlayers/pull/8732) - Fix type check in ol/source/Tile ([@wallw-bits](https://github.com/wallw-bits))
* [#8731](https://github.com/openlayers/openlayers/pull/8731) - Dispatch a GeolocationError in Geolocation ([@fredj](https://github.com/fredj))
* [#8729](https://github.com/openlayers/openlayers/pull/8729) - Move functions out of the PointerEvent class ([@fredj](https://github.com/fredj))
* [#8717](https://github.com/openlayers/openlayers/pull/8717) - Fix type checks in TileArcGISRest ([@fredj](https://github.com/fredj))
* [#8718](https://github.com/openlayers/openlayers/pull/8718) - Fix TypeScript errors in ol/format/GPX ([@schmidtk](https://github.com/schmidtk))
* [#8706](https://github.com/openlayers/openlayers/pull/8706) - Use EsriJSON types from @types/arcgis-rest-api ([@schmidtk](https://github.com/schmidtk))
* [#8709](https://github.com/openlayers/openlayers/pull/8709) - Fix TypeScript errors in ol/format/GeoJSON ([@schmidtk](https://github.com/schmidtk))
* [#8708](https://github.com/openlayers/openlayers/pull/8708) - Fix type checks in ImageCanvas source ([@wallw-bits](https://github.com/wallw-bits))
* [#8710](https://github.com/openlayers/openlayers/pull/8710) - Fix type checks in ImageArcGISRest ([@wallw-bits](https://github.com/wallw-bits))
* [#8697](https://github.com/openlayers/openlayers/pull/8697) - Remove unused properties from Cluster and Image options ([@fredj](https://github.com/fredj))
* [#8688](https://github.com/openlayers/openlayers/pull/8688) - Fix PointerEventHandler event type ([@fredj](https://github.com/fredj))
* [#8686](https://github.com/openlayers/openlayers/pull/8686) - Remove extra imports in jsdoc ([@fredj](https://github.com/fredj))
* [#8681](https://github.com/openlayers/openlayers/pull/8681) - Check the type of the source before using it ([@wallw-bits](https://github.com/wallw-bits))
* [#8692](https://github.com/openlayers/openlayers/pull/8692) - Type check fixes for Cluster source ([@wallw-bits](https://github.com/wallw-bits))
* [#8677](https://github.com/openlayers/openlayers/pull/8677) - Type check fixes for VectorSource ([@wallw-bits](https://github.com/wallw-bits))
* [#8684](https://github.com/openlayers/openlayers/pull/8684) - Define BingMapsImageryMetadataResponse type ([@wallw-bits](https://github.com/wallw-bits))
* [#8690](https://github.com/openlayers/openlayers/pull/8690) - Fix type checks in CartoDB ([@wallw-bits](https://github.com/wallw-bits))
* [#8693](https://github.com/openlayers/openlayers/pull/8693) - Fix type check errors for Image source ([@wallw-bits](https://github.com/wallw-bits))
* [#8672](https://github.com/openlayers/openlayers/pull/8672) - Fix source type in Raster source ([@fredj](https://github.com/fredj))
* [#8665](https://github.com/openlayers/openlayers/pull/8665) - Fix type check errors in RBush ([@wallw-bits](https://github.com/wallw-bits))
* [#8680](https://github.com/openlayers/openlayers/pull/8680) - TypeScript fixes for ol/events ([@schmidtk](https://github.com/schmidtk))
* [#8678](https://github.com/openlayers/openlayers/pull/8678) - Ensure image is Image or Video before settings src ([@wallw-bits](https://github.com/wallw-bits))
* [#8676](https://github.com/openlayers/openlayers/pull/8676) - Cast tileGrid to WMTSTileGrid for type check ([@wallw-bits](https://github.com/wallw-bits))
* [#8679](https://github.com/openlayers/openlayers/pull/8679) - Type check fixes in Triangulation ([@wallw-bits](https://github.com/wallw-bits))
* [#8638](https://github.com/openlayers/openlayers/pull/8638) - Fix event type in hasListener check ([@ahocevar](https://github.com/ahocevar))
* [#8618](https://github.com/openlayers/openlayers/pull/8618) - Use TopoJSON types from @types/topojson ([@fredj](https://github.com/fredj))
* [#8619](https://github.com/openlayers/openlayers/pull/8619) - Remove wrong Geometry type in KML format ([@fredj](https://github.com/fredj))
* [#8627](https://github.com/openlayers/openlayers/pull/8627) - Fix several type imports ([@ahocevar](https://github.com/ahocevar))
* [#8629](https://github.com/openlayers/openlayers/pull/8629) - Enable circle primitive in draw-shapes example ([@megawac](https://github.com/megawac))
* [#8626](https://github.com/openlayers/openlayers/pull/8626) - Better type annotations / type casts ([@marcjansen](https://github.com/marcjansen))
* [#8610](https://github.com/openlayers/openlayers/pull/8610) - Sensible touch behavior of the MousePosition control ([@ahocevar](https://github.com/ahocevar))
* [#8607](https://github.com/openlayers/openlayers/pull/8607) - Listener return is boolean or void ([@tschaub](https://github.com/tschaub))
* [#8595](https://github.com/openlayers/openlayers/pull/8595) - Optional arguments and typedef properties ([@tschaub](https://github.com/tschaub))
* [#8594](https://github.com/openlayers/openlayers/pull/8594) - Remove extra imports in jsdoc ([@fredj](https://github.com/fredj))
* [#8596](https://github.com/openlayers/openlayers/pull/8596) - Add types for the UTFGrid and TileJSON JSON responses ([@tschaub](https://github.com/tschaub))
* [#8591](https://github.com/openlayers/openlayers/pull/8591) - Add missing properties in TextState typedef ([@fredj](https://github.com/fredj))
* [#8569](https://github.com/openlayers/openlayers/pull/8569) - Make proj~get simpler and faster ([@ahocevar](https://github.com/ahocevar))
* [#8567](https://github.com/openlayers/openlayers/pull/8567) - Use 'Element' type instead of 'Node' ([@fredj](https://github.com/fredj))
* [#8558](https://github.com/openlayers/openlayers/pull/8558) - Fix default zIndex value and documentation for layer options ([@fredj](https://github.com/fredj))
* [#8555](https://github.com/openlayers/openlayers/pull/8555) - Do not minify examples that inject code into workers ([@ahocevar](https://github.com/ahocevar))
* [#8557](https://github.com/openlayers/openlayers/pull/8557) - Fix typo in release notes ([@ahocevar](https://github.com/ahocevar))
<details>
<summary>Dependency Updates</summary>
* [#8884](https://github.com/openlayers/openlayers/pull/8884) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8880](https://github.com/openlayers/openlayers/pull/8880) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8872](https://github.com/openlayers/openlayers/pull/8872) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8860](https://github.com/openlayers/openlayers/pull/8860) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8855](https://github.com/openlayers/openlayers/pull/8855) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8838](https://github.com/openlayers/openlayers/pull/8838) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8834](https://github.com/openlayers/openlayers/pull/8834) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8799](https://github.com/openlayers/openlayers/pull/8799) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8796](https://github.com/openlayers/openlayers/pull/8796) - Update rollup-plugin-commonjs to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8793](https://github.com/openlayers/openlayers/pull/8793) - Update rollup-plugin-buble to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8794](https://github.com/openlayers/openlayers/pull/8794) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8788](https://github.com/openlayers/openlayers/pull/8788) - Update front-matter to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8785](https://github.com/openlayers/openlayers/pull/8785) - chore(package): update rollup to version 0.66.4 ([@openlayers](https://github.com/openlayers))
* [#8719](https://github.com/openlayers/openlayers/pull/8719) - Update marked to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8714](https://github.com/openlayers/openlayers/pull/8714) - chore(package): update webpack to version 4.20.2 ([@openlayers](https://github.com/openlayers))
* [#8703](https://github.com/openlayers/openlayers/pull/8703) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8646](https://github.com/openlayers/openlayers/pull/8646) - Update mustache to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8645](https://github.com/openlayers/openlayers/pull/8645) - Update rollup-plugin-uglify to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8685](https://github.com/openlayers/openlayers/pull/8685) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8683](https://github.com/openlayers/openlayers/pull/8683) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8656](https://github.com/openlayers/openlayers/pull/8656) - chore(package): update rollup-plugin-commonjs to version 9.1.8 ([@openlayers](https://github.com/openlayers))
* [#8667](https://github.com/openlayers/openlayers/pull/8667) - chore(package): update uglifyjs-webpack-plugin to version 2.0.1 ([@openlayers](https://github.com/openlayers))
* [#8661](https://github.com/openlayers/openlayers/pull/8661) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8644](https://github.com/openlayers/openlayers/pull/8644) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8631](https://github.com/openlayers/openlayers/pull/8631) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8630](https://github.com/openlayers/openlayers/pull/8630) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8617](https://github.com/openlayers/openlayers/pull/8617) - chore(package): update webpack to version 4.18.0 ([@openlayers](https://github.com/openlayers))
* [#8589](https://github.com/openlayers/openlayers/pull/8589) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8581](https://github.com/openlayers/openlayers/pull/8581) - Update rollup-plugin-node-resolve to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8585](https://github.com/openlayers/openlayers/pull/8585) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8578](https://github.com/openlayers/openlayers/pull/8578) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8563](https://github.com/openlayers/openlayers/pull/8563) - Update rollup-plugin-uglify to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#8561](https://github.com/openlayers/openlayers/pull/8561) - Update rollup-plugin-uglify to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
<td><p>A [map](ol.Map.html) is made of [layers](ol.layer.html), a [view](ol.View.html) to visualize them, [interactions](ol.interaction.html) to modify map content and [controls](ol.control.html) with UI components.</p>
[Overview](ol.Map.html)<br>
[Creation](ol.Map.html#Map)<br>
[Events](ol.MapBrowserEvent.html)</td>
<td><p>A <a href="module-ol_Map-Map.html">map</a> is made of <a href="module-ol_layer_Base-BaseLayer.html">layers</a>, a <a href="module-ol_View-View.html">view</a> to visualize them, <a href="module-ol_interaction_Interaction-Interaction.html">interactions</a> to modify map content and <a href="module-ol_control_Control-Control.html">controls</a> with UI components.</p>
<tr><td><p>All coordinates and extents need to be provided in view projection (default: EPSG:3857). To transform, use [ol.proj.transform()](ol.proj.html#.transform) and [ol.proj.transformExtent()](ol.proj.html#.transformExtent).</p>
[ol.proj](ol.proj.html)</td>
<td><p>Changes to all [ol.Objects](ol.Object.html) can observed by calling the [object.on('propertychange')](ol.Object.html#on) method. Listeners receive an [ol.Object.Event](ol.Object.Event.html) with information on the changed property and old value.</p>
<tr><td><p>All coordinates and extents need to be provided in view projection (default: EPSG:3857). To transform, use <a href="module-ol_proj.html#.transform">ol/proj#transform()</a> and <a href="module-ol_proj.html#.transformExtent">ol/proj#transformExtent()</a>.</p>
<a href="module-ol_proj.html">ol/proj</a></td>
<td><p>Changes to all <a href="module-ol_Object-BaseObject.html">ol/Object</a>s can be observed by calling the <a href="module-ol_Object-BaseObject.html#on">object.on('propertychange')</a> method. Listeners receive an <a href="module-ol_Object-ObjectEvent.html">ol/Object.ObjectEvent</a> with information on the changed property and old value.</p>
Note the value of the `@event` annotation. The text before the hash refers to the event class that the event belongs to, and the text after the hash is the type of the event.
To export event properties, they need to be defined in `externs/oli.js` (also see `readme.md` in `externs/`) and marked with an @api annotation:
```js
/** @interface */
oli.MapBrowserEvent;
/**
* @type {ol.Coordinate}
* @api
*/
oli.MapBrowserEvent.prototype.coordinate;
// ...
};
```
To document which events are fired by a class or method, the `@fires` annotation is used:
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */
// "types": [], /* Type declaration files to be included in compilation. */
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
The default `geometryFunction` can only handle `ol.geom.Point` geometries.
The default `geometryFunction` can only handle `ol/geom/Point` geometries.
### 11
@@ -111,7 +111,7 @@ Features for `updates` must have an id set by the feature reader or `ol.Feature#
### 28
`renderMode` must be `'image'`,`'hybrid'` or `'vector'`.
`renderMode` must be `'image'` or`'hybrid'`.
### 29
@@ -139,7 +139,7 @@ Invalid geometry layout. Must be `XY`, `XYZ`, `XYM` or `XYZM`.
### 36
Unknown SRS type. Expected `"name"` or `"EPSG"`.
Unknown SRS type. Expected `"name"`.
### 37
@@ -165,14 +165,6 @@ Expected an `ol.style.Style` or an array of `ol.style.Style`.
Expected `layers` to be an array or an `ol.Collection`.
### 44
`logo.href` should be a string.
### 45
`logo.src` should be a string.
### 46
Incorrect format for `renderer` option.
@@ -220,3 +212,19 @@ The `{-y}` placeholder requires a tile grid with extent.
### 57
At least 2 conditions are required.
### 58
Duplicate item added to a unique collection. For example, it may be that you tried to add the same layer to a map twice. Check for calls to `map.addLayer()` or other places where the map's layer collection is modified.
### 59
Invalid command found in the PBF. This indicates that the loaded vector tile may be corrupt.
### 60
Missing or invalid `size`.
### 61
Cannot determine IIIF Image API version from provided image information JSON.
console.log("Count right after construction: "+numFeatures);
```
@@ -288,9 +323,9 @@ been populated with features), you should use an event listener function on the
```javascript
vector.getSource().on('change',function(evt){
varsource=evt.target;
constsource=evt.target;
if(source.getState()==='ready'){
varnumFeatures=source.getFeatures().length;
constnumFeatures=source.getFeatures().length;
console.log("Count after change: "+numFeatures);
}
});
@@ -319,16 +354,17 @@ map.renderSync();
## Why are my features not found?
You are using `ol.Map#forEachFeatureAtPixel` or `ol.Map#hasFeatureAtPixel`, but
You are using `Map#forEachFeatureAtPixel` or `Map#hasFeatureAtPixel`, but
it sometimes does not work for large icons or labels? The *hit detection* only
checks features that are within a certain distance of the given position. For large
icons, the actual geometry of a feature might be too far away and is not considered.
In this case, set the `renderBuffer` property of `ol.layer.Vector` (the default
value is 100px):
In this case, set the `renderBuffer` property of `VectorLayer` (the default value is 100px):
```javascript
varvectorLayer=newol.layer.Vector({
importVectorLayerfrom'ol/layer/Vector';
constvectorLayer=newVectorLayer({
...
renderBuffer:200
});
@@ -336,36 +372,29 @@ var vectorLayer = new ol.layer.Vector({
The recommended value is the size of the largest symbol, line width or label.
## How do I create a custom build of OpenLayers?
## Why is zooming or clicking in the map off/inaccurate?
Please refer to the [official create custom builds tutorial](tutorials/custom-builds.html)
which explains how to create a custom build of OpenLayers with just those parts
included that you want.
OpenLayers does not update the map when the container element is resized. This can be caused by progressive updates
to CSS styles or manually resizing the map. When that happens, any interaction will become inaccurate: the map would zoom in and out, and end up not being centered on the pointer. This makes it hard to do certain interactions, e.g. selecting the desired feature.
There is currently no built-in way to react to element's size changes, as [Resize Observer API](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver) is only implemented in Chrome.
## Do I need to write my own code using Closure library?
There is however an easy to use [polyfill](https://github.com/que-etc/resize-observer-polyfill):
OpenLayers is built on top of the [Google Closure JavaScript
library](https://developers.google.com/closure/library/), but this
does not mean that you must use that library in your application code.
@@ -11,7 +11,7 @@ For a more in-depth overview of OpenLayers core concepts, check out the [tutoria
Make sure to also check out the [OpenLayers workshop](/workshop/).
Find additional reference material in the [API docs](../apidoc).
Find additional reference material in the [API docs](../apidoc) and [examples](../examples).
# Frequently Asked Questions (FAQ)
@@ -19,4 +19,4 @@ We have put together a document that lists [Frequently Asked Questions (FAQ)](fa
# More questions?
If you cannot find an answer in the documentation or the FAQ, you can ask your question on [Stack Overflow using the tag 'openlayers'](http://stackoverflow.com/questions/tagged/openlayers).
If you cannot find an answer in the documentation or the FAQ, you can search [Stack Overflow](http://stackoverflow.com/questions/tagged/openlayers). If you cannot find an answer there, ask a new question there, using the tag 'openlayers'.
This primer shows you how to put a simple map on a web page.
**For production, we strongly recommend bundling the application together with its dependencies, as explained in the [Building an OpenLayers Application](./tutorials/bundle.html) tutorial.**
## Put a map on a page
Below you'll find a complete working example. Create a new file, copy in the contents below, and open in a browser:
@@ -13,14 +18,14 @@ Below you'll find a complete working example. Create a new file, copy in the co
The first part is to include the JavaScript library. For the purpose of this tutorial, here we simply point to the openlayers.org website to get the whole library. In a production environment, we would build a custom version of the library including only the module needed for our application.
@@ -125,7 +130,7 @@ The `layers: [ ... ]` array is used to define the list of layers available in th
]
```
Layers in OpenLayers are defined with a type (Image, Tile or Vector) which contains a source. The source is the protocol used to get the map tiles. You can consult the list of [available layer sources here](/en/{{latest}}/apidoc/ol.source.html)
Layers in OpenLayers are defined with a type (Image, Tile or Vector) which contains a source. The source is the protocol used to get the map tiles.
The next part of the `Map` object is the `View`. The view allows to specify the center, resolution, and rotation of the map. The simplest way to define a view is to define a center point and a zoom level. Note that zoom level 0 is zoomed out.
OpenLayers is a modular, high-performance, feature-packed library for displaying and interacting with maps and geospatial data.
The library comes with built-in support for a wide range of commercial and free image and vector tile sources, and the most popular open and proprietary vector data formats. With OpenLayers's map projection support, data can be in any projection.
## Public API
OpenLayers is available as [`ol` npm package](https://npmjs.com/package/ol), which provides all modules of the officially supported [API](../../apidoc).
## Renderers and Browser Support
By default, OpenLayers uses a performance optimized Canvas renderer.
OpenLayers runs on all modern browsers that support [HTML5](https://html.spec.whatwg.org/multipage/) and [ECMAScript 5](http://www.ecma-international.org/ecma-262/5.1/). This includes Chrome, Firefox, Safari and Edge. For older browsers and platforms like Internet Explorer (down to version 9) and Android 4.x, [polyfills](http://polyfill.io), the application bundle needs to be transpiled (e.g. using [Babel](https://babeljs.io)) and bundled with polyfills for `requestAnimationFrame`, `Element.prototype.classList` and `URL`.
The library is intended for use on both desktop/laptop and mobile devices, and supports pointer and touch interactions.
## Module and Naming Conventions
OpenLayers modules with CamelCase names provide classes as default exports, and may contain additional constants or functions as named exports:
```js
importMapfrom'ol/Map';
importViewfrom'ol/View';
```
Class hierarchies grouped by their parent are provided in a subfolder of the package, e.g. `layer/`.
For convenience, these are also available as named exports, e.g.
```js
import{Map,View}from'ol';
import{Tile,Vector}from'ol/layer';
```
In addition to these re-exported classes, modules with lowercase names also provide constants or functions as named exports:
Modern JavaScript works best when using and authoring modules. The recommended way of using OpenLayers is installing the [`ol`](https://npmjs.com/package/ol) package. This tutorial walks you through setting up a simple dev environment, which requires [node](https://nodejs.org) for everything to work.
In this tutorial, we will be using [Parcel](https://parceljs.org) to bundle our application. There are several other options, some of which are linked from the [README](https://npmjs.com/package/ol).
## Initial steps
Create a new empty directory for your project and navigate to it by running `mkdir new-project && cd new-project`. Initialize your project with
npm init
This will create a `package.json` file in your working directory. Add OpenLayers as dependency to your application with
npm install ol
At this point you can ask NPM to add required development dependencies by running
npm install --save-dev parcel-bundler
## Application code and index.html
Place your application code in `index.js`. Here is a simple starting point:
```js
import'ol/ol.css';
import{Map,View}from'ol';
importTileLayerfrom'ol/layer/Tile';
importOSMfrom'ol/source/OSM';
constmap=newMap({
target:'map',
layers:[
newTileLayer({
source:newOSM()
})
],
view:newView({
center:[0,0],
zoom:0
})
});
```
You will also need an `index.html` file that will use your bundle. Here is a simple example:
```html
<!DOCTYPE html>
<html>
<head>
<metacharset="utf-8">
<title>Using Parcel with OpenLayers</title>
<style>
#map{
width:400px;
height:250px;
}
</style>
</head>
<body>
<divid="map"></div>
<scriptsrc="./index.js"></script>
</body>
</html>
```
## Creating a bundle
With two additional lines in `package.json` you can introduce the commands `npm run build` and `npm start` to manually build your bundle and watch for changes, respectively. The final `package.json` with the two additional commands `"start"` and `"build"` should look like this:
```json
{
"name":"test",
"version":"1.0.0",
"description":"",
"main":"index.js",
"scripts":{
"test":"echo \"Error: no test specified\" && exit 1",
"start":"parcel index.html",
"build":"parcel build --public-url . index.html"
},
"author":"",
"license":"ISC"
}
```
That's it. Now to run your application, enter
npm start
in your console. To test your application, open http://localhost:1234/ in your browser. Whenever you change something, the page will reload automatically to show the result of your changes.
Note that a single JavaScript file with all your application code and all dependencies used in your application has been created. From the OpenLayers package, it only contains the required components.
To create a production bundle of your application, simply type
npm run build
and copy the `dist/` folder to your production server.
The core component of OpenLayers is the map (`ol.Map`). It is rendered to a `target` container (e.g. a `div` element on the web page that contains the map). All map properties can either be configured at construction time, or by using setter methods, e.g. `setTarget()`.
The core component of OpenLayers is the map (`ol/Map`). It is rendered to a `target` container (e.g. a `div` element on the web page that contains the map). All map properties can either be configured at construction time, or by using setter methods, e.g. `setTarget()`.
The markup below could be used to create a `<div>` that contains your map.
The script below constructs a map that is rendered in the `<div>` above, using the `map` id of the element as a selector.
```js
import Map from 'ol/Map';
var map = new Map({target: 'map'});
```
## View
`ol.Map` is not responsible for things like center, zoom level and projection of the map. Instead, these are properties of an `ol.View` instance.
The map is not responsible for things like center, zoom level and projection of the map. Instead, these are properties of a `ol/View` instance.
```js
map.setView(new ol.View({
center: [0, 0],
zoom: 2
}));
import View from 'ol/View';
map.setView(new View({
center: [0, 0],
zoom: 2
}));
```
An `ol.View` also has a `projection`. The projection determines the coordinate system of the `center` and the units for map resolution calculations. If not specified (like in the above snippet), the default projection is Spherical Mercator (EPSG:3857), with meters as map units.
A `View` also has a `projection`. The projection determines the coordinate system of the `center` and the units for map resolution calculations. If not specified (like in the above snippet), the default projection is Spherical Mercator (EPSG:3857), with meters as map units.
The `zoom` option is a convenient way to specify the map resolution. The available zoom levels are determined by `maxZoom` (default: 28), `zoomFactor` (default: 2) and `maxResolution` (default is calculated in such a way that the projection's validity extent fits in a 256x256 pixel tile). Starting at zoom level 0 with a resolution of `maxResolution` units per pixel, subsequent zoom levels are calculated by dividing the previous zoom level's resolution by `zoomFactor`, until zoom level `maxZoom` is reached.
## Source
To get remote data for a layer, OpenLayers uses `ol.source.Source` subclasses. These are available for free and commercial map tile services like OpenStreetMap or Bing, for OGC sources like WMS or WMTS, and for vector data in formats like GeoJSON or KML.
To get remote data for a layer, OpenLayers uses `ol/source/Source` subclasses. These are available for free and commercial map tile services like OpenStreetMap or Bing, for OGC sources like WMS or WMTS, and for vector data in formats like GeoJSON or KML.
```js
var osmSource = new ol.source.OSM();
import OSM from 'ol/source/OSM';
var osmSource = OSM();
```
## Layer
A layer is a visual representation of data from a `source`. OpenLayers has three basic types of layers: `ol.layer.Tile`, `ol.layer.Image` and `ol.layer.Vector`.
`ol.layer.Tile` is for layer sources that provide pre-rendered, tiled images in grids that are organized by zoom levels for specific resolutions.
A layer is a visual representation of data from a `source`. OpenLayers has four basic types of layers:
`ol.layer.Image` is for server rendered images that are available for arbitrary extents and resolutions.
`ol.layer.Vector` is for vector data that is rendered client-side.
* `ol/layer/Tile` - Renders sources that provide tiled images in grids that are organized by zoom levels for specific resolutions.
* `ol/layer/Image` - Renders sources that provide map images at arbitrary extents and resolutions.
* `ol/layer/Vector` - Renders vector data client-side.
* `ol/layer/VectorTile` - Renders data that is provided as vector tiles.
```js
var osmLayer = new ol.layer.Tile({source: osmSource});
map.addLayer(osmLayer);
import TileLayer from 'ol/layer/Tile';
var osmLayer = new TileLayer({source: osmSource});
map.addLayer(osmLayer);
```
## Putting it all together
The above snippets can be combined into a single script that renders a map with a single tile layer:
The above snippets can be conflated to a self contained map configuration with view and layers:
OpenLayers is a big library providing a lot of functionality. So it is unlikely that an application will need and use all the functionality OpenLayers provides. This is why creating application-specific OpenLayers builds, with just the functionality your application needs, is often a good idea.
An alternative to creating custom builds is to compile your application code together with OpenLayers. See the [Compiling Application with Closure Compiler](closure.html) tutorial for more information.
This particular tutorial explains how to create custom builds of OpenLayers.
## Requirements
OpenLayers's build tools use Node and Java, so you need to have Node and Java installed on your machine. You can run `node --version` and `java -version` to test that Node and Java are installed, respectively. See [developing guide](https://github.com/openlayers/openlayers/blob/master/DEVELOPING.md) for minimum version numbers required.
## Download OpenLayers
Obviously, creating a custom build requires the OpenLayers source and specific build scripts.
To get the OpenLayers source and the build scripts you can clone the openlayers [repository](https://github.com/openlayers/openlayers), or you can download one of the release archives. You can also download the `openlayers` Node package from the Node package registry, using NPM (the Node Package Manager). This is the method we are going to use in this tutorial.
Create a directory:
$ mkdir openlayers
Download the OpenLayers distribution using NPM:
$ npm install openlayers
This will download the latest stable version of OpenLayers, and install it under `node_modules`. You can list the content of `node_modules` to verify that it effectively contains a directory named "openlayers".
The Node packages onto which the `openlayers` package depends are installed under `node_modules/openlayers/node_modules`. That directory should, for example, include `closure-util`, which is the utility library OpenLayers uses for Closure.
You should now have everything you need to create custom builds of OpenLayers!
## Create a build configuration file
Creating a custom build requires writing a build configuration file. The format of build configuration files is JSON. Here is a simple example of a build configuration file:
```json
{
"exports":[
"ol.Map",
"ol.View",
"ol.control.defaults",
"ol.layer.Tile",
"ol.source.OSM"
],
"compile":{
"externs":[
"externs/bingmaps.js",
"externs/closure-compiler.js",
"externs/geojson.js",
"externs/oli.js",
"externs/olx.js",
"externs/proj4js.js",
"externs/tilejson.js",
"externs/topojson.js"
],
"extra_annotation_name":[
"api","observable"
],
"compilation_level":"ADVANCED",
"manage_closure_dependencies":true,
"rewrite_polyfills":false
}
}
```
Create a file named `ol-custom.json` with that content, and save it under the `node_modules/openlayers/build` directory. (You can save it to any location really.)
The most relevant part of this configuration object is the `"exports"` array. This array declares the functions/constructors you use in your JavaScript code. For example, the above configuration file is what you'd use for the following JavaScript code:
```js
varmap=newol.Map({
target:'map',
layers:[
newol.layer.Tile({
source:newol.source.OSM()
})
],
controls:ol.control.defaults({
attributionOptions:{
collapsible:false
}
}),
view:newol.View({
center:[0,0],
zoom:4
})
});
```
Note that this JavaScript code corresponds to OpenLayers's [`simple`](https://openlayers.org/en/master/examples/simple.html) example.
You are now ready to create your first OpenLayers build. Use the following command to create the build:
The build command may take some time, but it should end with an output in the console such as the following:
info ol Parsing dependencies
info ol Compiling 364 sources
The build command should have created an `ol-custom.js` file in the `node_modules/openlayers/build` directory. You can verify that the file was created. You can even open it in your editor if you're curious.
As a test, you can use the following HTML file to verify that your custom build works as expected:
Closure allows you to define constants that can be set at compile time. The OpenLayers code defines several such values.
Setting some of these to `false` means that the portions of the code relating to this setting become "dead", i.e. are never executed. As Closure Compiler's `ADVANCED` mode removes dead code, this makes the size of the advanced compiled file smaller.
You might have noticed that the build file you've just created is considerably smaller than the full build, but it can be reduced further. This is because both renderers and other optional code are included by default. We only need one renderer, and we do not use the optional code, so can exclude what we don't use by setting properties with `define`s. So add a define section to the config above:
```
"define": [
"ol.ENABLE_WEBGL=false",
"ol.ENABLE_PROJ4JS=false",
"ol.ENABLE_RASTER_REPROJECTION=false"
],
```
and re-run the build script. The build size should now be smaller.
### Externs
The Closure documentation explains that "externs" are for external names used in the code being compiled. The compiler includes externs for built-ins such as `document`. The `externs` directory of the OpenLayers code includes files for all those used in some part of the library. For example, if you use Bing Maps, you should include the Bing externs file in the `externs` section of the config file.
`oli.js` and `olx.js` are externs files for the OpenLayers API. For example `olx.js` includes extern definitions for OpenLayers's constructor options. `closure-compiler.js` fixes any issues that may arise with a specific compiler version. You should always use these three files as externs when creating custom builds.
### Other compiler options
There are a couple of other compiler options in the config file above. `manage_closure_dependencies` and `rewrite_polyfills` should always be used.
You can specify any of the other compiler options here as needed, such as the renaming reports, output manifest, or source maps. There is a full list of available options in [closure-util](https://github.com/openlayers/closure-util/blob/master/compiler-options.txt).
Note that `build.js` currently requires you to enter an output file and will write the output from the compiler to it; it does not use the `js_output_file` compiler option. If you specify this in the config file, there will be no compiler output, so `build.js`'s output file will be empty.
## A more complicated example
Now let's try a more complicated example: [`heatmaps-earthquakes`](https://openlayers.org/en/master/examples/heatmap-earthquakes.html). The build configuration file looks like this:
```json
{
"exports":[
"ol.layer.Heatmap",
"ol.source.Vector",
"ol.format.KML",
"ol.layer.Heatmap#getSource",
"ol.source.Vector#on",
"ol.source.Vector.Event#feature",
"ol.Feature#get",
"ol.Feature#set",
"ol.layer.Tile",
"ol.source.Stamen",
"ol.Map",
"ol.View",
"ol.layer.Heatmap#setRadius",
"ol.layer.Heatmap#setBlur"
],
"compile":{
"externs":[
"externs/closure-compiler.js",
"externs/olx.js",
"externs/oli.js"
],
"define":[
"ol.ENABLE_WEBGL=false",
"ol.ENABLE_PROJ4JS=false",
"ol.ENABLE_RASTER_REPROJECTION=false"
],
"compilation_level":"ADVANCED",
"manage_closure_dependencies":true,
"rewrite_polyfills":false
}
}
```
The exports are given here in the order in which they occur in the `heatmaps-earthquakes` example's JavaScript code. In this example we not only use the `ol.` functions and constructors, but also `prototype` methods where the `ol` namespace is not directly used. In the code, we have for example `vector.getSource().on()`. This means we are using the `getSource` method of `layer.Heatmap` and the `on` method of `source.KML`, so this is what has to be exported. Similarly, `event.feature.get()` means we are using the `feature` property of `source.Vector.Event` and the `get` method of `Feature`. If any of these names are left out, the compile will complete successfully, but the missing names will be obfuscated and you will get a 'property undefined' error when you try and run the script.
## Maintaining the code
If you installed OpenLayers from the Node package, you can use `npm` to upgrade to the latest version. If you cloned the Github repo, simply pulling in the latest code may not be enough, as some of the packages used, for example, the compiler, may need upgrading too. Do this by using `npm install` rather than `npm update`.
## Conclusion
This tutorial should have given you the information you need to create custom builds, i.e. builds tailored to your application. See the [tasks readme](https://github.com/openlayers/openlayers/tree/master/tasks/readme.md) for more information on the build scripts and the properties you can use in the build configuration file.
With version 3, the OpenLayers web mapping library was fundamentally redesigned. The widely used version 2 dates from the early days of Javascript development, and was increasingly showing its age. So it has been rewritten from the ground up to use modern design patterns.
The initial release aims to support much of the functionality provided by version 2, with support for a wide range of commercial and free tile sources, and the most popular open-source vector data formats. As with version 2, data can be in any projection. The initial release also adds some additional functionality, such as the ability to easily rotate or animate maps.
It is also designed such that major new features, such as displaying 3D maps, or using WebGL to quickly display large vector data sets, can be added in later releases.
## Google Closure
OpenLayers was written in a way so it can be compiled with [__Closure Compiler__](https://developers.google.com/closure/compiler/). Its 'advanced' compilation mode offers a level of compression that exceeds anything else available.
## Public API
Using the advanced optimizations of the Closure Compiler means that properties and methods are renamed – `longMeaningfulName` might become `xB` – and so are effectively unusable in applications using the library. To be usable, they have to be explicitly `exported`. This means the exported names, those not renamed, effectively become the public API of the library. These __exportable__ properties and methods are marked in the source, and documented in the [API docs](../../apidoc). This is the officially supported API of the library. A build containing all these exportable names is known as a __full build__. A hosted version of this is available, which can be used by any application.
## Custom Builds
Unlike in, say, Node, where a module's exports are fixed in the source, with Closure Compiler, exports can be defined at compile time. This makes it easy to create builds that are customized to the needs of a particular site or application: a __custom build__ only exports those properties and methods needed by the site or application. As the full build is large, and will probably become larger as new features are added to the API, it's recommended that sites create a custom build for production software.
## Renderers and Browser Support
The library currently includes two renderers: Canvas and WebGL. Both of them support both raster data from tile/image servers, and vector data; WebGL however does not support labels. Clearly only those browsers that [support Canvas](http://caniuse.com/canvas) can use the Canvas renderer. Equally, the WebGL renderer can only be used on those devices and [browsers](http://caniuse.com/webgl) that support WebGL.
OpenLayers runs on all modern browsers that support [HTML5](https://html.spec.whatwg.org/multipage/) and [ECMAScript 5](http://www.ecma-international.org/ecma-262/5.1/). This includes Chrome, Firefox, Safari and Edge. For older browsers and platforms like Internet Explorer (down to version 9) and Android 4.x, [polyfills](http://polyfill.io) for `requestAnimationFrame` and `Element.prototype.classList` are required, and using the KML format requires a polyfill for `URL`.
The library is intended for use on both desktop/laptop and mobile devices.
## Objects and Naming Conventions
The top-level namespace is `ol` (basically, `var ol = {};`). Subdivisions of this are:
* further namespaces, such as `ol.layer`; these have a lower-case initial
* simple objects containing static properties and methods, such as `ol.easing`; these also have a lower-case initial
* types, which have an upper-case initial. These are mainly 'classes', which here means a constructor function with prototypal inheritance, such as `ol.Map` or `ol.layer.Vector` (the Vector class within the layer namespace). There are however other, simpler, types, such as `ol.Extent`, which is an array.
Class namespaces, such as `ol.layer` have a base class type with the same name, such as `ol.layer.Layer`. These are mainly abstract classes, from which the other subclasses inherit.
Source files are similarly organised, with a directory for each class namespace. Names are however all lower-case, for example, `ol/layer/vector.js`.
OpenLayers follows the convention that the names of private properties and methods, that is, those that are not part of the API, end in an underscore. In general, instance properties are private and accessed using accessors.
@@ -10,18 +10,22 @@ Transformation of the map projections of the image happens directly in a web bro
The view in any Proj4js supported coordinate reference system is possible and previously incompatible layers can now be combined and overlaid.
# Usage
The API usage is very simple. Just specify proper projection (using [EPSG](https://epsg.io) code) on `ol.View`:
``` javascript
var map = new ol.Map({
The API usage is very simple. Just specify proper projection (e.g. using [EPSG](https://epsg.io) code) on `ol/View`:
```js
import{Map,View}from'ol';
importTileLayerfrom'ol/layer/Tile';
importTileWMSfrom'ol/source/TileWMS';
varmap=newMap({
target:'map',
view: new ol.View({
view:newView({
projection:'EPSG:3857',//HERE IS THE VIEW PROJECTION
center:[0,0],
zoom:2
}),
layers:[
new ol.layer.Tile({
source: new ol.source.TileWMS({
new TileLayer({
source:newTileWMS({
projection:'EPSG:4326',//HERE IS THE DATA SOURCE PROJECTION
url:'http://demo.boundlessgeo.com/geoserver/wms',
params:{
@@ -32,7 +36,7 @@ var map = new ol.Map({
]
});
```
If a source (based on `ol.source.TileImage` or `ol.source.Image`) has a projection different from the current `ol.View`’s projection then the reprojection happens automatically under the hood.
If a source (based on `ol/source/TileImage` or `ol/source/Image`) has a projection different from the current `ol/View`’s projection then the reprojection happens automatically under the hood.
The easiest way to use a custom projection is to add the [Proj4js](http://proj4js.org/) library to your project and then define the projection using a proj4 definition string.
The easiest way to use a custom projection is to add the [Proj4js](http://proj4js.org/) library to your project and then define the projection using a proj4 definition string. It can be installed with
npm install proj4
Following example shows definition of a [British National Grid](https://epsg.io/27700):
To switch the projection used to display the map you have to set a new `ol.View` with selected projection on the `ol.Map`:
To switch the projection used to display the map you have to set a new `ol/View` with selected projection on the `ol/Map`:
``` javascript
map.setView(new ol.View({
map.setView(new View({
projection: 'EPSG:27700',
center: [400000, 650000],
zoom: 4
@@ -69,16 +76,16 @@ map.setView(new ol.View({
## TileGrid and Extents
When reprojection is needed, new tiles (in the target projection) are under the hood created from the original source tiles.
The TileGrid of the reprojected tiles is by default internally constructed using `ol.tilegrid.getForProjection(projection)`.
The TileGrid of the reprojected tiles is by default internally constructed using `ol/tilegrid~getForProjection(projection)`.
The projection should have extent defined (see above) for this to work properly.
Alternatively, a custom target TileGrid can be constructed manually and set on the source instance using `ol.source.TileImage#setTileGridForProjection(projection, tilegrid)`.
Alternatively, a custom target TileGrid can be constructed manually and set on the source instance using `ol/source/TileImage~setTileGridForProjection(projection, tilegrid)`.
This TileGrid will then be used when reprojecting to the specified projection instead of creating the default one.
In certain cases, this can be used to optimize performance (by tweaking tile sizes) or visual quality (by specifying resolutions).
# How it works
The reprojection process is based on triangles -- the target raster is divided into a limited number of triangles with vertices transformed using `ol.proj` capabilities ([proj4js](http://proj4js.org/) is usually utilized to define custom transformations).
The reprojection process is based on triangles -- the target raster is divided into a limited number of triangles with vertices transformed using `ol/proj` capabilities ([proj4js](http://proj4js.org/) is usually utilized to define custom transformations).
The reprojection of pixels inside the triangle is approximated with an affine transformation (with rendering hardware-accelerated by the canvas 2d context):
<img src="raster-reprojection-resources/how-it-works.jpg" alt="How it works" width="600" />
@@ -102,12 +109,8 @@ For debugging, rendering of the reprojection edges can be enabled by `ol.source.
# Advanced
### Disabling reprojection
In case you are creating a custom build of OpenLayers and do not need the reprojection code, you can reduce the build size by setting `ol.ENABLE_RASTER_REPROJECTION` to `false`, which completely disables the reprojection support.
See [Custom builds](custom-builds.html#defines) tutorial on how to do this.
### Triangulation precision threshold
The default [triangulation error threshold](#dynamic-triangulation) in pixels is given by `ol.DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD` (0.5 pixel).
The default [triangulation error threshold](#dynamic-triangulation) in pixels is given by `ERROR_THRESHOLD` (0.5 pixel).
In case a different threshold needs to be defined for different sources, the `reprojectionErrorThreshold` option can be passed when constructing the tile image source.
###Limiting visibility of reprojected map by extent
@@ -126,7 +129,7 @@ Setting such a limit is demonstrated in the [reprojection demo example](https://
### Resolution calculation
When determining source tiles to load, the ideal source resolution needs to be calculated.
The `ol.reproj.calculateSourceResolution(sourceProj, targetProj, targetCenter, targetResolution)` function calculates the ideal value in order to achieve pixel mapping as close as possible to 1:1 during reprojection, which is then used to select proper zoom level from the source.
The `ol/reproj~calculateSourceResolution(sourceProj, targetProj, targetCenter, targetResolution)` function calculates the ideal value in order to achieve pixel mapping as close as possible to 1:1 during reprojection, which is then used to select proper zoom level from the source.
It is, however, generally not practical to use the same source zoom level for the whole target zoom level -- different projections can have significantly different resolutions in different parts of the world (e.g. polar regions in EPSG:3857 vs EPSG:4326) and enforcing a single resolution for the whole zoom level would result in some tiles being scaled up/down, possibly requiring a huge number of source tiles to be loaded.
Therefore, the resolution mapping is calculated separately for each reprojected tile (in the middle of the tile extent).
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.