The goal of using a drawScale was to use the smallest possible canvas (i.e.
one that fits the tile pixel ratio instead of the view pixel ratio) when
composing rotated views. Instead, the drawScale caused a ridiculously
large canvas.
This method was composing a frame that was only accurate for devices
with a pixelRatio of 1. Now the canvas widths and heights are
multiplied beforehand by the pixelRatio. #5601
The update has been added to the docs for all 'forEachLayerAtPixel' definitions
and currently returns null for non-supporting definitions. ol.Color typeDef
was also updated to support Uint8Arrays & Uint8ClampedArrays as it is the
reference type for the addded argument #5586
This pull requests replaces type check hint assertions with type casts,
library sanity check assertions with conditional console.assert statements
in debug mode, and runtime sanity checks with assertions that throw an
ol.AssertionError with an error code for lookup outside the library.
If ol3 is included as part of a concatenated build and the script before it does
not end in a semi-colon, the IIFE is interpreted incorrectly (often resulting in
`TypeError: (intermediate value)`).
With this change, it's no longer possible to extend an array with
an "array like" object (an object with a 'length' property).
We were not using this feature in the library.
* Rename ol.vec.Mat4.fromMatrix to ol.vec.Mat4.fromTransform
* Make result from ol.vec.Mat4.fromTransform immutable by adding result
matrix as argument.
Now used only for 1 typedefs and 1 enum, it serves little purpose,
so the typedef is renamed in the ol namespace, and the enum moved to rastersource.js
New getResolutions() function created for ol.View. This function returns
the array of resolutions passed to the ol.View constructor, or undefined
if none were given.
These sub-sub-namespace typedefs are only used internally; some of them cause problems by creating a form of circular dependency. For example, ol.style.Atlas is created in style/atlasmanager.js; if ol.style.Atlas.Block is in a separate file, ol.style.Atlas is dependent on it, so the new file must precede ol.style.Atlas. However if it precedes it then it has to create the ol.style.Atlas namespace which should be created by atlasmanager.js. To get round this, these typedefs are renamed to remove the sub-sub-namespace.
Fortunately they are all non-api, so the rename should not affect anything.
This only compiles if there is goog.provide('ol.Extent') in the typedefs file, and goog.require('ol.Extent') in this file. An alternative is to add an assert statement, but this means an extra dependency.
With this change there is no longer a need for the change to tasks/build.js
This commit lets the user use an element object instead of a {src: href} object for an attribution logo when creating a map. This opens a lot of possibilities for that logo, for example setting the target to force the logo to open in a new tab when clicked.
* Add ol.source.ImageArcGISRest
ol.source.ImageArcGISRest is added so a single image can be retrieved
which is required when labelling is applied to the underlying map
service.
it's based on the approach used in ol.source.ImageWMS
* updating to remove as many good references as possible
changing so js passes lint checks
* fixing up so build and tests run
* putting back what was lost in the merge
* adding in an example
tidying up
The reporter for the standard tests is still 'spec'; the one for the
gathering of code coverage is set to 'dot' to not clutter the output
of the logfile on travis.
The function ol.proj.equivalent is used for comparing two projections,
but not exposed publicly. It should be accessible using a public API to
be able to compare projections in the same way as OpenLayers does.
A test for the ol.proj.equivalent function itself already exists in
https://github.com/openlayers/ol3/blob/master/test/spec/ol/proj/proj.test.js
github issue #4913
Provide an API to refresh a source and reload its data in an associated
layer, as for example already loaded tiles in a ol.source.Tile source
are not refreshed. Additionally a test for the new
ol.source.Source.refresh() function is provided.
Currently internal state is not cleaned up, e.g. already loaded tiles
in a `ol.source.Tile` source are still cached and not reloaded at all.
github issue #4867 (https://github.com/openlayers/ol3/issues/4867)
- Remove closure-util.json, we're now using the same library version as closure-util
- Disable analyzerChecks errors from closure-compiler
- Remove WheelEvent constants from externs (fixed upstream)
- Activate the unnecessaryCasts compiler check
Despite the dispatchEvent method accepting a hash with a "target" property of
"undefined", closure may still require the "target" property to be
explicit.
Instead of having `ol.events.Key` be a listener object or an array of listener objects, it should be less error prone to have it just be a single listener object.
To avoid using too many functions with multiple return types, the `ol.events.*` functions for registering and unregistering listeners no longer accept an array of event types (and only a single key is returned when registering).
To make it convenient for users to register multiple listeners at once, the `observable.on()` method accepts an array of event types. Internally in the library, we should use the less risky `ol.events.listen()`.
To make sure that our binarySearch implementation meets the requirements of
the library, I added more tests for ol.geom.flat.interpolate.lineString, only
to find out that it does not handle line strings with repeated vertices
properly, regardless of what binarySearch implementation is used.
When using tile sets with a high tilePixelRatio, the maximum pixel size can
trouble the browser. Instead, we now use replay rendering by tile size limits
instead of resolution ratio limits.
This option allows the format to read only features of a
given layer. This is useful if you wish to make a single
query to a WMS server with multiple layers in it.
In order to have the function returned by ol.source.UrlTile#getTileUrlFunction()
to return a url even when executed outside the context of the source, then it
should be bound to the source.
The compiler seems to have trouble with functions that can run with
different 'this' types. By moving the units handling to the callback, this
issue can be avoided.
When selecting an already selected feature, it will be on the Select
interaction's featureOverlay_. So we need to include that featureOverlay_
in the layer filter, regardless of what the user set as layer filter.
When in toggle mode, we need to make sure that we only select features that
are not already included in the selection.
Tile coordinate keys from ol.tilecoord.toString() are different than the ones
from Array.prototype.toString(). Both were used, potentially causing problems.
This change makes them consistent and removes the now unnecessary
ol.tileCoord.toString() function.
This only works when the device pixel ratio is 1. Labels are incorrectly
positioned and not at all rotated for other pixel ratios. I cannot find the
cause for this problem.
Because clip geometries are anti-aliased in most browsers, there will be tiny
gaps between tiles. If tiles are rendered to a tile canvas which is then drawn
to the map canvas upon composition, these gaps can be avoided. For rotated
views, it is stil necessary to clip the tile, but in this case a 1-pixel
buffer is used.
This change also brings a huge performance improvement for panning, because
the fully rendered tiles can be reused.
Because of the added cost of using drawImage in addition to replaying the tile
replay group, we fall back to directly drawing to the map canvas when the tile
canvas would be too large, or during interaction/animation when resolution or
rotation change.
By setting a device pixel ratio of 1.0 and increasing the tolerance for raster
reprojection tests, the render tests now also run from the console on OSX
devices with retina display.
This fixes a regression introduced by the goog.isDef removal.
From the HTML 5 spec: "The empty string is also a valid keyword, and
maps to the Anonymous state"
This fixes a regression introduced by the goog.isDef removal.
From the HTML 5 spec: "The empty string is also a valid keyword, and
maps to the Anonymous state"
The imageSize property was only used to determine the scale. It's usage was
never documented nor tested nor shown in an example, so I removed it because I
considered its presence a bug.
Add an optional notify argument to object set and setProperties methods.
If the argument is not provided, set and setProperties trigger an event.
If you update many objects or do so frequently and do not need notification, performance is improved by setting silent to true.
Expanded documentation on the url property of the
ol.source.Vector property to include information about
how data loaded remotely will always be run through an
attempt to translate to the view's projection so the
format object must have the proper value for
defaultDataProjection when the remote data doesn't
include a CRS property.
This pull request splits the developer documentation into `CONTRIBUTING.md` and
`DEVELOPING.md`. `CONTRIBUTING.md` now contains an additional paragraph,
instructing contributors to create an issue before submitting a pull request.
The introduction of this additional step was discussed at this year's FOSS4G
conference. This new step would also affect contributions from core developers.
"Unwrap" the coordinates obtained from transformations and utilize wrapX
capabilities of the sources to handle calculations of TileRanges and
unwrapped tile extents.
If we do this here, we can avoid some computations on triangles that will
be unused in the future anyway + reduce problems with non-global projections
without specified extents.
Changing. resetNorth_ function from O(n) to O(1).
To reproduce this issue, open the developer console and execute:
map.getView().setRotation(5000000000);
Then click on the rotation button. Before the commit, it takes a few
seconds, after this commit it is instantaneous.
In addition, due to limited floating point precision, the previous code
calculates a different value from this one.
This is a follow up of commit 761aa0ea5c.
That commit removed ol.control.Control.bindMouseOutFocusOutBlur function,
but forgot to remove this piece of code here.
Previously, {-y} only worked for the standard web mercator tile grid. Now
a tile grid with an extent is required (which we get from
ol.tilegrid.createXYZ() anyway), and then the y calculation for TMS style
tile grids works as expected.
Now that https://github.com/laurentj/slimerjs/issues/333 is properly fixed (see 911fcb671a) we can no longer read Slimer's exit code from a file. Instead, we can just use the process exit code, which simplifies the test-rendering.js script.
This commit removes an incorrect assertion from the modify interaction, which currently triggers when adding vertices to a line string. A new condition is added to the `if` statement to prevent a compilation error. In practice, `depth` and `segmentDataMatch.depth` are either both defined or both undefined.
The value we set context.fillStyle to should always be a string. This commit fixes a bug in circlestyle.js where we did set context.fillStyle to an array instead of a string.
By default, zooming in or out zooms using the mouse's location
as an anchor, which makes it possible to navigate the map
using scrolling only, and makes zooming in more intuitive.
This commit adds a new useAnchor option to the MouseWheelZoom
interaction. It is enabled by default, which changes nothing
to the current behavior of the interaction. When disabled,
the interaction stops registering its lastAnchor_ value. This
turns the zoom into a very basic one, that zooms to the center
of the screen.
To use the map center zoom, set the useAnchor option to
false when creating the MouseWheelZoomInteraction, or use its
setMouseAnchor function.
This commit allows setting a z-index property on the layers and uses
it in the canvas, WEBGL and DOM map renderers for ordering the layers
before rendering.
Default z-index is 0 for managed layers and 1000 for unmanaged ones.
It allows always on bottom, always on top and more complex layer layouts.
This commit adds an `extend` method to the draw interaction. This method makes it possible to extend (continue drawing) an existing line string feature. It only works on line string features, where this functionality makes the most sense.
Here's an example on how to use `extend`:
```js
var vectorSource = vectorLayer.getSource();
vectroSource.removeFeature(feature);
drawInteraction.extend(feature);
```
Added the getUrls method to get access to the url / urls property.
When using a tileUrlFunction, getUrls should return null.
This should fix issue #3886
Quoting from https://nodesecurity.io/advisories/marked_redos:
> Marked 0.3.3 and earlier is vulnerable to regular expression denial of
> service (ReDoS) when certain types of input are passed in to be parsed.
This allows features to be moved around the map. It works much like the Modify interaction, however it's significantly simpler. It uses the geometry's underlying `translate` function.
We currently rely on the renderer to load the styles it intents to use.
In Ol3-Cesium we want to allow different styles for 3D and for 2D.
This commit fixes the issue by allowing application code to explicitely
initiate the loading process.
This commit adds an `ol.format.KML.findStyle_` function to prevent creating a function for every call to `ol.format.KML.createFeatureStyleFunction_`, as suggested by @ahocevar in #3900.
Setting a feature geometry to null or undefined and triggering a hit
detection was throwing an exception.
This patch handles a batched feature without a geometry in the same
fashion as skipped features.
An equivalent patch has been applied to the canvas replay.
Setting a feature geometry to null or undefined and triggering a hit
detection was throwing an exception.
This patch handles a batched feature without a geometry in the same
fashion as skipped features.
It was a workaround added in #1761 to hide the button tooltip on
OSX / Chrome 32 and 33.
Because we're not using the tooltips anymore (see #2781) and this
version of chrome is deprecated this workaround can be removed.
The previous approach did not work on mobile devices where no `pointermove`
event is sent except from dragging.
Logic now is: Upon vertex creation due to `pointerdown` we will ignore
the next `singleclick` event unless there is a `pointerdrag` event, which will
not lead to a `singleclick` event following the vertex creation.
Resolves#3935
Where workers are not available, or if operations are trivial to run, the main UI thread can be used instead. This also adds tests that run in real browsers.
With this change, the generic 'change' event is properly documented, as
all other events. It is no longer necessary to annotate `@fires change` for
every ol.Observable subclass.
This fixes issues with ol.source.Vector being unable to use ol.ext.rbush,
but it also means that potential future external modules without node
module loader support will not work. If we ever depend on such a module,
we can replace "var define;" with a minimal AMD define shim.
In other map renderers, the precompose event is fired before preparing and
composing layer frames. In WebGL, it is fired in between. This change makes
it so the sequence of events is the same for all renderers.
Because the WebGL renderer creates the list of layers to render before the
precompose event, unmanaged layers are never rendered. This is also fixed
by dispatching the precompose event earlier.
To make unmanaged vector layers work like the removed ol.FeatureOverlay,
the layer filter for ol.Map#forEachFeatureAtPixel needs to ignore unmanaged
layers.
My comment on line 375 was too long, so I broke it up into multiple lines. Also I accidentally left a line out of the commit (line 384) when transcribing my changes into the web based editor.
Fit accepts either a geometry or an extent.
This combines two previously distinct functions
into one more flexible call.
Also brings the rotations support and options
previously available to fitGeometry to extents
Following [3827](https://github.com/openlayers/ol3/issues/3827),
handle CDATA XML nodes in attribute parsing of GML data. Currently
such data will be expected to be a geometry, and will fail to parse.
Treating the CDATA node as text is the easiest way to handle such
an attribute.
When creating the graticule use the extent from the vectorContext instead of the frameState to determine what parallels and meridians should be created. This will allow the graticule to be drawn correctly on views that wrap across the dateline.
* Skipped features need to be hit-detected on unmanaged layers.
* updateWhileAnimating and updateWhileInteracting are recommended to
achieve the same instant visual feedback that ol.FeatureOverlay had.
Using the term 'bottom-left' for origin and origins is misleading, because
many developers use -y-1 for the tile url's y in their tile url functions,
and the origin really only determines where tile coordinates start to
increase from left to right and from bottom to top.
By adding a getTileCoordForTileUrlFuction method like for ol.source.Tile,
we can now properly handle extent and resolution restrictions, and reuse
tiles on wrapped worlds. Also adds the missing wrapX option to
ol.source.TileVector.
When a layer is configured with a map, it will be added on top of other
layers, and not be managed in the map's features collection. The layerState
will have an 'unmanaged' flag for such layers. For vector layers, this flag
is used to not skip any features.
ol.layer.Vector can now manage both an RTree and a Collection of features.
The new useSpatialIndex option allows to opt out of RTree management, and
the new ol.Collection type of the features option allows to opt in for
Collection management.
This commit adds tests for `intersectsExtent` of Point, LineString, Polygon,
MultiPoint, MultiLineString, MultiPolygon and GeometryCollection.
It also adds a basic test for `getExtent` of MultiPolygon
This change allows us to remove some avoidable function calls (specifically
to goog.isDef(c) and c.toLowerCase()). Additionally, the new check is simpler
to read.
* Min and max number of points configurable for lines and polygons
* Polygons from custom geometryFunction now have a sketch line
* The example shows how to use a custom geometryFunction
This allows applications to control the geometry that is created from the
drawing sketch. Will e.g. be useful to create a regular polygon instead of
a circle when in Circle mode.
The `ol.extent.containsExtent` documentation had its arguments backwards
(or the implementation did).
The documentation said "the first extent is contained by or on the edge
of the second", but the function checked the opposite.
The wording was also a little strange, since from the name of the
function alone `containsExtent` I'd guess that the first argument would
be the (potential) container, and the second would be the (potentially)
contained. But the documentation has the wording "check if one extent is
*contained by* or on the edge of another", suggesting the first argument
is the contained and the second the container.
This patch keeps the current functionality but clarifies the
documentation.
The addition of full extent tile ranges also allows us to simplify wrapX
handling for tile layers. By limiting wrapX to true and false as possible
values, we can remove a lot of guessing logic.
These tests are taken from ol.tilegrid.XYZ, to make sure that
ol.tilegrid.TileGrid works the same way. The additional tests show that the
#getTileCoordForXYAndResolution_() method do not handle coordinates at
tile boundaries properly, so this is fixed.
This is to be able to use the dev server (`npm start`) to serve the hosted examples (located in the `build/hosted/<branch>` dir after `make host-examples`).
Change generate-requires.js to use the graceful-fs module instead of fs. This is to avoid EMFILE errors on OSX because the maximum number of file descriptors have been reached.
By using the frameState's focus, we can adjust extent and transform and
render it for the world of interest instead of wrapping it and rendering
for every visible world.
This is based on the assumptions that
* our examples always goog.require something ol.* (otherwise why have the example)
* our examples only goog.require exportable symbols or "namespaces" for exportable symbols (e.g. ol.control for the defaults function)
* we have an API doc page for each exportable symbol and each "namespace" that has exportable symbols (e.g. ol.Map.html and ol.control.html)
It may be that this assumption proves to be wrong, but it would be nice to avoid the extra network traffic and layout shifting when examples load.
When we create the examples, we know exactly which specific `ol.…` symbols
we `goog.require(…)`. We can create links to the API documentation of these
symbols automatically.
Please write blog posts, create tutorials, or develop workshops that show off cool ways to develop applications that use OL3. The examples should be kept very simple. This download functionality is neat, but it's really a gratuitous use of non-map related functionality. While it does demonstrate the use of `format.writeFeatures()`, this is buried in too much additional code that is not accessible (buried in resources/common.js) and not really related to mapping things. If we want to have examples that demonstrate how formats can be used to serialize features, a simple textarea would suffice as the target.
The `check-examples` target fails on Travis without this option. We get "SSL handshake failed" when loading resources via HTTPS with whatever the default SSL protocol is.
In addition, as a precaution, the --ignore-ssl-errors option is set to true in case anybody adds a resource with an invalid certificate. This option does not get around SSL handshake errors.
Method ol.proj.equivalent used only reference equality check ===
That doesn't work for basic checks of two strongly equal projections
For example, `EPSG:4326` and `EPSG:4326`
In this case method searches similar proj in ol.proj.transforms_ mapping
And it finds it if proj is default and not custom
But in case of custom proj `EPSG:3413` it doesn't find it
When finishing drawing, this PR dispatches the `drawend` event before adding
the feature to the source or collection.
This change allows user code to finish configuring the feature (setting style,
properties, ...).
It is useful since inserting a feature, or later on modifying it, may trigger
processing which only makes sense if the feature is ready. For example,
ol3-cesium will recreate a 3D counterpart.
Using an ol.Overlay as marker I put inside an SVG graphic element. As soon I move the mouse over the SVG the error appear.
In IE9 the SVG Element does not have the contains function so it throws the exception, on the contrary using goog.dom.contains it handles the cross-browser issues.
https://groups.google.com/forum/#!topic/ol3-dev/DBi2HCTqulU
This addition is related to the definition of olx.FrameState in olx.js. Without this alias and corresponding goog.provide in src/ol/vec/mat4.js we get this error when compiling an OpenLayers application:
ERR! compile node_modules/openlayers/externs/olx.js:6853: ERROR - Bad type annotation. Unknown type goog.vec.Mat4.Number
ERR! compile * coordinateToPixelMatrix: goog.vec.Mat4.Number,
Currently, the Closure Library does not have a goog.provide for goog.vec.Mat4.Number. If it did have this goog.provide then we wouldn't have the error.
This commit works around the issue by creating our own type alias (ol.vec.Mat4.Number) and adding a goog.provide for that type alias.
The augmentExamples just adds metadata to the example markup files. If we also want to support example markdown files, we can use the metalsmith-markdown plugin before this one.
By having the abstract methods in the base class, subclasses can simply
override the methods they actually provide.
Additionally, this change fixes a regression in webgl canvas immediate.
Handle MultiPoint, MultiLineString, MultiPolygon.
LinearRing properties are not handled.
An 'extrude' boolean array property is set in the geometry properties.
An 'altitudeMode' string array property is set in the geometry properties.
Point, LineString and Polygon are handled.
LinearRing properties are not handled.
An 'extrude' boolean property is set in the geometry properties.
An 'altitudeMode' string property is set in the geometry properties.
When the tile queue loads a tile it registers a "change" listener on that tile. But currently that listener is not unregistered, unless the tile cache containing that tile fills up and "dipose" is called on that tile.
This commit makes handleTileChange deregister the "change" listener on the tile, if the tile is now in "loaded" state.
This commit unregisters the viewport resize listener when setTarget(null) is called, and registers it when setTarget(target) is called, and when we don't have that listener registered yet.
This prevents memory leaks where references to map objects are retained because of these viewport resize listeners.
Geometry index won't be updated correctly if feature geometry is changed using `feature.setGeometry(new_geometry)`
ol.interaction.Snap should listen for a 'change:geometry' event on ol.Feature
More than one features can be be changed while handlingDownUpSequence
exampe: ol.interaction.Modify supports simultaneous editing of multiple features
When a geometry changes old indexed segments are searched by the feature extend and removed. New ones are added.
Old feature extent sholud be used when removing the old indexed segments.
This commit changes ol.Snap -> ol.interaction.Snap, which extends
ol.interaction.Pointer. The 'pointerdown', 'pointermove' and
'pointerup' map browser events are hanlded to edit the pixel and
coordinate properties to make them 'snap' to the closest feature.
handlePointerMove_ doesn't need to be called when dragging.
handleDragEvent_ takes care of the event in that case.
in handleDragEvent_, createOrUpdateVertexFeature_ doesn't need to be called for each dragged segment. it can be called only once with current vertex.
fixes made to pass the build
Prevent vertexFeature_ from ol.interaction.Modify from being selected by ol.interaction.Select.
The bug occurs when an delete attempt fails. ex: clicikng on the first or last node of LineString,
or clicking a line segment between two nodes.
This commit fixes the bug that occurs when trying to modify
a closed LineString by clicking on the starting/ending node.
Such a closed line is added to the modify-test example.
Fix a bug in ol.interaction.Modify when trying to delete nodes
on a geometry that has duplicate nodes. A bug occurs when
clicking on the duplicate node.
This fixes a bug in ol.tilegrid.TileGrid#getZForResolution where this function doesn't take minZoom and maxZoom into account when selecting a zoom level for a resolution.
Fixes#2780.
This file includes upgrade notes for changes to the library that require changes to application code. This file is used by the release manager to fill the "Upgrade notes" section in the v3.x.y.md changelog file.
The original browser event was used to catch the mousemove event,
but in IE the 'pointermove' event is returned instead. So, instead
of using the original event, we use the map browser event, which
is always 'pointermove'.
Added functionality to create a wmts tilegrid and wmts source from the
capabilities object created from ol.format.WMTSCapabilities.read().
Added tests for these functions and an example.
Also altered the REST url template replacement to be case insensitive
and added tests for this. This is because the spec uses both style
and Style and both of these are used by existing WMTS services.
Currently, if other params are present at the beginning of the query string,
the mode switcher will not work.
This situation can occur when a search criteria was entered in the examples
index page. That criteria will be passed along to the example page via a query
param.
This commit adds a setTarget method to ol.control.Control. This function can be used in cases where the target cannot be set at control construction time. For example, with Angular, it makes sense to create the control instance in an Angular controller, and have a "control" directive insert the control into the DOM.
With this option, vector batches will be recreated with every frame.
For animations, this means that vector data won't be clipped to the
extent at which the animation started.
Occurs when a FeatureCollection is empty.
Code style changes @bartvde
Added test case for #3118.
Attempt to make jshint happy.
Fixed tab character.
Another code style change (jshint)....
Allows automatic unminification by the browser.
A postprocessing is required to:
- fix the paths to the sources;
- add the link from the minified script to its map.
If someone knows how to do the first item in Python or nodejs, please provide a
patch. A simple shell script is:
```
\#!/bin/sh
pwd=`pwd`
sed -i "s!$pwd/build!olsource!g" 'build/ol.js.map'
sed -i "s!$pwd!olsource!g" 'build/ol.js.map'
```
The second item should always be manually handled to avoid 404 errors
in debuggers
`echo '//# sourceMappingURL=ol.js.map' >> build/ol.js`
Finally, create an alias / copy ol3 directory to /olsource in your
deployed environment.
This fixes a bug that occured when an image source was used by multiple maps. In that case the map that didn't load the image wouldn't register a load listener on that image and would therefore not call render to request a re-render of the map.
This was a partial, unmaintained list of the project contributors. For a complete list of contributors, see the Git log. E.g.
git shortlog -s | cut -c8-
This removes the map's deviceOptions config option, and instead
introduces loadTilesWhileAnimating and loadTilesWhileInteracting map
options. By default, both are false now, to make zooming and panning
smoother on most devices.
Thanks for your interest in contributing to OpenLayers 3.
## Asking Questions
Please ask questions about using the library on [stackoverflow using the tag 'openlayers-3'](http://stackoverflow.com/questions/tagged/openlayers-3).
When you want to get involved and discuss new features or changes, please use [the mailing list](https://groups.google.com/forum/#!forum/ol3-dev).
## Submitting Bug Reports
Please use the [GitHub issue tracker](https://github.com/openlayers/ol3/issues). Before creating a new issue, do a quick search to see if the problem has been reported already.
## Getting Familiar with the Code in the Repository
Look for `readme.md` files! Several directories contain a `readme.md` file that explains the contents of the directory and how to work with them.
## Contributing Code
See [`DEVELOPING.md`](https://github.com/openlayers/ol3/blob/master/DEVELOPING.md) to learn how to get started developing.
Our preferred means of receiving contributions is through [pull requests](https://help.github.com/articles/using-pull-requests). Make sure
that your pull request follows our pull request guidelines below before submitting it.
This page describes what you need to know to contribute code to ol3 as a developer.
## Contributor License Agreement
Before accepting a contribution, we ask that you provide us a Contributor
[forking](https://github.com/openlayers/ol3/fork_select) the ol3 repository.
### Travis CI
The Travis CI 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.
Although not mandatory, it is also recommended to set up Travis CI for your ol3 fork.
For that go to your ol3 fork's Service Hooks page and set up the Travis hook.
Then every time you push to your fork, the test suite will be run. This means
errors can be caught before creating a pull request. For those making
small or occasional contributions, this may be enough to check that your contributions
are ok; in this case, you do not need to install the build tools on your local environment
as described below.
### Development dependencies
The minimum requirements are:
* Git
* [Node.js](http://nodejs.org/)
* Python 2.6 or 2.7 with a couple of extra modules (see below)
* Java 7 (JRE and JDK)
The executables `git`, `java`, `jar`, and `python` should be in your `PATH`.
You can check your configuration by running:
$ ./build.py checkdeps
To install the Node.js dependencies run
$ npm install
To install the extra Python modules, run:
$ sudo pip install -r requirements.txt
or
$ cat requirements.txt | sudo xargs easy_install
depending on your OS and Python installation.
## Working with the build tool
As an ol3 developer you will need to use the `build.py` Python script. This is
the script to use to run the linter, the compiler, the tests, etc. Windows users
can use `build.cmd` which is a thin wrapper around `build.py`.
The `build.py` script is equivalent to a Makefile. It is actually based on
[pake](https://github.com/twpayne/pake/), which is a simple implementation of
`make` in Python.
The usage of the script is:
$ ./build.py <target>
where `<target>` is the name of the build target you want to execute. For
example:
$ ./build.py 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 ol3's [Travis configuration file](https://github.com/openlayers/ol3/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:
$ ./build.py 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:
$ ./build.py serve
Then, just point your browser <http://localhost:3000/examples> in your browser. For example <http://localhost:3000/examples/side-by-side.html>.
Run examples against the `ol.js` standalone build:
The examples can also be run against the `ol.js` standalone lib, just like the examples
[hosted](http://openlayers.github.com/ol3/master/examples/) on GitHub. Start by
executing the `host-examples` build target:
$ ./build.py host-examples
After running `host-examples` you can now open the examples index page in the browser, for example: <http://localhost/~elemoine/ol3/build/hosted/master/examples/>. (This assumes that the `hosted` directory is a web directory, served by Apache for example.)
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).
## Running tests
To run the tests in a browser start the dev server (`./build.py serve`) and open <http://localhost:3000/test/index.html> in the browser.
To run the tests on the console (headless testing with PhantomJS) use the `test` target:
$ ./build.py test
See also the test-specific [README](../blob/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:
$ ./build.py 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.
## Adding examples
Adding functionality often implies adding one or several examples. This
section provides explanations related to adding examples.
The examples are located in the `examples` directory. Adding a new example
implies creating two files in this directory, an `.html` file and a `.js` file.
See `examples/simple.html` and `examples/simple.js` for instance.
The `.html` file needs to include a script tag with
`loader.js?id=<example_name>` as its `src`. For example, if the two files for
the example are `myexample.js` and `myexample.html` then the script tag's `src`
should be set to `myexample`.
You can use `simple.js` and `simple.html` as templates for new examples.
### Use of the `goog` namespace in examples
Short story: the ol3 examples should not use the `goog` namespace, except
for `goog.require`.
Longer story: we want that the ol3 examples work in multiple modes, with the
standalone lib (which has implications of the symbols and properties we
export), and compiled together with the ol3 library.
Compiling the examples together with the library makes it mandatory to declare dependencies with `goog.require` statements.
## Pull request guidelines
Before working on a pull request, create an issue explaining what you want to contribute. This ensures that your pull request won't go unnoticed, and that you are not contributing something that is not suitable for the project. Once a core developer has set the `pull request accepted` label on the issue, you can submit a pull request. The pull request description should reference the original issue.
Your pull request must:
* Follow OpenLayers 3's coding style.
@@ -201,7 +64,7 @@ Your pull request must:
It is strongly recommended that you run
$ ./build.py check
$ 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.
[forking](https://github.com/openlayers/ol3/fork) the ol3 repository.
### Travis CI
The Travis CI 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.
### Development dependencies
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)
The executables `git`, `node`, and `java` should be in your `PATH`.
You can check your configuration by running:
$ make check-deps
To install the Node.js dependencies run
$ npm install
## Working with the build tool
As an ol3 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 ol3's [Travis configuration file](https://github.com/openlayers/ol3/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
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](http://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).
## 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 on the console (headless testing with PhantomJS) use the `test` target:
$ make test
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.
## Adding examples
Adding functionality often implies adding one or several examples. This
section provides explanations related to adding examples.
The examples are located in the `examples` directory. Adding a new example
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 ol3 examples should not use the `goog` namespace, except
for `goog.require`.
Longer story: we want that the ol3 examples work in multiple modes, with the
standalone lib (which has implications of the symbols and properties we
export), and compiled together with the ol3 library.
Compiling the examples together with the library makes it mandatory to declare dependencies with `goog.require` statements.
Welcome to [OpenLayers 3](http://openlayers.org/)!
[OpenLayers 3](http://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).
Check out the [hosted examples](http://openlayers.org/en/master/examples/), the [workshop](http://openlayers.org/ol3-workshop/) or poke around the evolving [API docs](http://openlayers.org/en/master/apidoc/).
## Getting Started
Please don't ask questions in the github issue tracker but use [the mailing list](https://groups.google.com/forum/#!forum/ol3-dev) instead.
- Download the [latest release](http://openlayers.org/download/)
- Install with npm: `npm install openlayers`
- Clone the repo: `git clone git@github.com:openlayers/ol3.git`
## Supported Browsers
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`.
## Documentation
Check out the [hosted examples](http://openlayers.org/en/latest/examples/), the [workshop](http://openlayers.org/workshop/) or the [API documentation](http://openlayers.org/en/latest/apidoc/).
## Bugs
Please use the [GitHub issue tracker](https://github.com/openlayers/ol3/issues) for all bugs and feature requests. Before creating a new issue, do a quick search to see if the problem has been reported already.
## Contributing
Please see our guide on [contributing](CONTRIBUTING.md) if you're interested in getting involved.
## Community
- Need help? Find it on [stackoverflow using the tag 'openlayers-3'](http://stackoverflow.com/questions/tagged/openlayers-3)
- Follow [@openlayers](https://twitter.com/openlayers) on Twitter
- Discuss with openlayers users on IRC in `#openlayers` at `chat.freenode`
Previously, minified builds of the library did not have any assertions. This caused applications to fail silently or with cryptic stack traces. Starting with this release, developers get notified of many runtime errors through the new `ol.AssertionError`. This error has a `code` property. The meaning of the code can be found on http://openlayers.org/en/latest/doc/errors/. There are additional console assertion checks in debug mode when the `goog.DEBUG` compiler flag is `true`. As this is `true` by default, it is recommended that those creating custom builds set this to `false` so these assertions are stripped.'
#### Removal of `ol.ENABLE_NAMED_COLORS`
This option was previously needed to use named colors with the WebGL renderer but is no longer needed.
#### KML format now uses URL()
The URL constructor is supported by all modern browsers, but not by older ones, such as IE. To use the KML format in such older browsers, a URL polyfill will have to be loaded before use.
#### Changes only relevant to those who compile their applications together with the Closure Compiler
A number of internal types have been renamed. This will not affect those who use the API provided by the library, but if you are compiling your application together with OpenLayers and using type names, you'll need to do the following:
* rename `ol.CollectionEventType` to `ol.Collection.EventType`
* rename `ol.CollectionEvent` to `ol.Collection.Event`
* rename `ol.ViewHint` to `ol.View.Hint`
* rename `ol.ViewProperty` to `ol.View.Property`
* rename `ol.render.webgl.imagereplay.shader.Default.Locations` to `ol.render.webgl.imagereplay.defaultshader.Locations`
* rename `ol.render.webgl.imagereplay.shader.DefaultFragment` to `ol.render.webgl.imagereplay.defaultshader.Fragment`
* rename `ol.render.webgl.imagereplay.shader.DefaultVertex` to `ol.render.webgl.imagereplay.defaultshader.Vertex`
* rename `ol.renderer.webgl.map.shader.Default.Locations` to `ol.renderer.webgl.defaultmapshader.Locations`
* rename `ol.renderer.webgl.map.shader.Default.Locations` to `ol.renderer.webgl.defaultmapshader.Locations`
* rename `ol.renderer.webgl.map.shader.DefaultFragment` to `ol.renderer.webgl.defaultmapshader.Fragment`
* rename `ol.renderer.webgl.map.shader.DefaultVertex` to `ol.renderer.webgl.defaultmapshader.Vertex`
* rename `ol.renderer.webgl.tilelayer.shader.Fragment` to `ol.renderer.webgl.tilelayershader.Fragment`
* rename `ol.renderer.webgl.tilelayer.shader.Locations` to `ol.renderer.webgl.tilelayershader.Locations`
* rename `ol.renderer.webgl.tilelayer.shader.Vertex` to `ol.renderer.webgl.tilelayershader.Vertex`
* rename `ol.webgl.WebGLContextEventType` to `ol.webgl.ContextEventType`
* rename `ol.webgl.shader.Fragment` to `ol.webgl.Fragment`
* rename `ol.webgl.shader.Vertex` to `ol.webgl.Vertex`
### v3.17.0
#### `ol.source.MapQuest` removal
Because of changes at MapQuest (see: https://lists.openstreetmap.org/pipermail/talk/2016-June/076106.html) we had to remove the MapQuest source for now (see https://github.com/openlayers/ol3/issues/5484 for details).
#### `ol.interaction.ModifyEvent` changes
The event object previously had a `mapBrowserPointerEvent` property, which has been renamed to `mapBrowserEvent`.
#### Removal of ol.raster namespace
Users compiling their code with the library and using types in the `ol.raster` namespace should note that this has now been removed. `ol.raster.Pixel` has been deleted, and the other types have been renamed as follows, and your code may need changing if you use these:
*`ol.raster.Operation` to `ol.RasterOperation`
*`ol.raster.OperationType` to `ol.RasterOperationType`
#### All typedefs now in ol namespace
Users compiling their code with the library should note that the following typedefs have been renamed; your code may need changing if you use these:
* ol.events.ConditionType to ol.EventsConditionType
* ol.events.EventTargetLike to ol.EventTargetLike
* ol.events.Key to ol.EventsKey
* ol.events.ListenerFunctionType to ol.EventsListenerFunctionType
* ol.interaction.DragBoxEndConditionType to ol.DragBoxEndConditionType
* ol.interaction.DrawGeometryFunctionType to ol.DrawGeometryFunctionType
* ol.interaction.SegmentDataType to ol.ModifySegmentDataType
* ol.interaction.SelectFilterFunction to ol.SelectFilterFunction
* ol.interaction.SnapResultType to ol.SnapResultType
* ol.interaction.SnapSegmentDataType to ol.SnapSegmentDataType
* ol.proj.ProjectionLike to ol.ProjectionLike
* ol.style.AtlasBlock to ol.AtlasBlock
* ol.style.AtlasInfo to ol.AtlasInfo
* ol.style.AtlasManagerInfo to ol.AtlasManagerInfo
* ol.style.CircleRenderOptions to ol.CircleRenderOptions
* ol.style.ImageOptions to ol.StyleImageOptions
* ol.style.GeometryFunction to ol.StyleGeometryFunction
* ol.style.RegularShapeRenderOptions to ol.RegularShapeRenderOptions
* ol.style.StyleFunction to ol.StyleFunction
### v3.16.0
#### Rendering change for tile sources
Previously, if you called `source.setUrl()` on a tile source, all currently rendered tiles would be cleared before new tiles were loaded and rendered. This clearing of the map is undesirable if you are trying to smoothly update the tiles used by a source. This behavior has now changed, and calling `source.setUrl()` (or `source.setUrls()`) will *not* clear currently rendered tiles before loading and rendering new tiles. Instead, previously rendered tiles remain rendered until new tiles have loaded and can replace them. If you want to achieve the old behavior (render a blank map before loading new tiles), you can call `source.refresh()` or you can replace the old source with a new one (using `layer.setSource()`).
#### Move of typedefs out of code and into separate file
This change should not affect the great majority of application developers, but it's possible there are edge cases when compiling application code together with the library which cause compiler errors or warnings. In this case, please raise a GitHub issue. `goog.require`s for typedefs should not be necessary.
Users compiling their code with the library should note that the following API `@typedef`s have been renamed; your code may need changing if you use these:
*`ol.format.WFS.FeatureCollectionMetadata` to `ol.WFSFeatureCollectionMetadata`
*`ol.format.WFS.TransactionResponse` to `ol.WFSTransactionResponse`
#### Removal of `opaque` option for `ol.source.VectorTile`
This option is no longer needed, so it was removed from the API.
#### XHR loading for `ol.source.TileUTFGrid`
The `ol.source.TileUTFGrid` now uses XMLHttpRequest to load UTFGrid tiles by default. This works out of the box with the v4 Mapbox API. To work with the v3 API, you must use the new `jsonp` option on the source. See the examples below for detail.
As of this release, OpenLayers requires a `classList` polyfill for IE 9 support. See http://cdn.polyfill.io/v2/docs/features#Element_prototype_classList.
#### Immediate rendering API
Listeners for `precompose`, `render`, and `postcompose` receive an event with a `vectorContext` property with methods for immediate vector rendering. The previous geometry drawing methods have been replaced with a single `vectorContext.drawGeometry(geometry)` method. If you were using any of the following experimental methods on the vector context, replace them with `drawGeometry`:
* Removed experimental geometry drawing methods: `drawPointGeometry`, `drawLineStringGeometry`, `drawPolygonGeometry`, `drawMultiPointGeometry`, `drawMultiLineStringGeometry`, `drawMultiPolygonGeometry`, and `drawCircleGeometry` (all have been replaced with `drawGeometry`).
In addition, the previous methods for setting style parts have been replaced with a single `vectorContext.setStyle(style)` method. If you were using any of the following experimental methods on the vector context, replace them with `setStyle`:
* Removed experimental style setting methods: `setFillStrokeStyle`, `setImageStyle`, `setTextStyle` (all have been replaced with `setStyle`).
Below is an example of how the vector context might have been used in the past:
Here is an example of how you could accomplish the same with the new methods:
```js
// NEW WAY, USE THIS INSTEAD OF THE CODE ABOVE
map.on('postcompose',function(event){
event.vectorContext.setStyle(style);
event.vectorContext.drawGeometry(geometry);
});
```
A final change to the immediate rendering API is that `vectorContext.drawFeature()` calls are now "immediate" as well. The drawing now occurs synchronously. This means that any `zIndex` in a style passed to `drawFeature()` will be ignored. To achieve `zIndex` ordering, order your calls to `drawFeature()` instead.
#### Removal of `ol.DEFAULT_TILE_CACHE_HIGH_WATER_MARK`
The `ol.DEFAULT_TILE_CACHE_HIGH_WATER_MARK` define has been removed. The size of the cache can now be defined on every tile based `ol.source`:
```js
newol.layer.Tile({
source:newol.source.OSM({
cacheSize:128
})
})
```
The default cache size is `2048`.
### v3.14.0
#### Internet Explorer 9 support
As of this release, OpenLayers requires a `requestAnimationFrame`/`cancelAnimationFrame` polyfill for IE 9 support. See http://cdn.polyfill.io/v2/docs/features/#requestAnimationFrame.
#### Layer pre-/postcompose event changes
It is the responsibility of the application to undo any canvas transform changes at the end of a layer 'precompose' or 'postcompose' handler. Previously, it was ok to set a null transform. The API now guarantees a device pixel coordinate system on the canvas with its origin in the top left corner of the map. However, applications should not rely on the underlying canvas being the same size as the visible viewport.
Old code:
```js
layer.on('precompose',function(e){
// rely on canvas dimensions to move coordinate origin to center
Before this release, OpenLayers depended on the global proj4 namespace. When using a module loader like Browserify, you might not want to depend on the global `proj4` namespace. You can use the `ol.proj.setProj4` function to set the proj4 function object. For example in a browserify ES6 environment:
```js
importolfrom'openlayers';
importproj4from'proj4';
ol.proj.setProj4(proj4);
```
#### `ol.source.TileJSON` changes
The `ol.source.TileJSON` now uses `XMLHttpRequest` to load the TileJSON instead of JSONP with callback.
When using server without proper CORS support, `jsonp: true` option can be passed to the constructor to get the same behavior as before:
```js
newol.source.TileJSON({
url:'http://serverwithoutcors.com/tilejson.json',
jsonp:true
})
```
Also for Mapbox v3, make sure you use urls ending with `.json` (which are able to handle both `XMLHttpRequest` and JSONP) instead of `.jsonp`.
### v3.12.0
#### `ol.Map#forEachFeatureAtPixel` changes
The optional `layerFilter` function is now also called for unmanaged layers. To get the same behaviour as before, wrap your layer filter code in an if block like this:
KML icons are scaled 50% so that the rendering better matches Google Earth rendering.
If a KML placemark has a name and is a point, an `ol.style.Text` is created with the name displayed to the right of the icon (if there is an icon).
This can be controlled with the showPointNames option which defaults to true.
To disable rendering of the point names for placemarks, use the option:
new ol.format.KML({ showPointNames: false });
#### `ol.interaction.DragBox` and `ol.interaction.DragZoom` changes
Styling is no longer done with `ol.Style`, but with pure CSS. The `style` constructor option is no longer required, and no longer available. Instead, there is a `className` option for the CSS selector. The default for `ol.interaction.DragBox` is `ol-dragbox`, and `ol.interaction.DragZoom` uses `ol-dragzoom`. If you previously had
```js
newol.interaction.DragZoom({
style:newol.style.Style({
stroke:newol.style.Stroke({
color:'red',
width:3
}),
fill:newol.style.Fill({
color:[255,255,255,0.4]
})
})
});
```
you'll now just need
```js
newol.interaction.DragZoom();
```
but with additional css:
```css
.ol-dragzoom{
border-color:red;
border-width:3px;
background-color:rgba(255,255,255,0.4);
}
```
#### Removal of `ol.source.TileVector`
With the introduction of true vector tile support, `ol.source.TileVector` becomes obsolete. Change your code to use `ol.layer.VectorTile` and `ol.source.VectorTile` instead of `ol.layer.Vector` and `ol.source.TileVector`.
#### `ol.Map#forEachFeatureAtPixel` changes for unmanaged layers
`ol.Map#forEachFeatureAtPixel` will still be called for unmanaged layers, but the 2nd argument to the callback function will be `null` instead of a reference to the unmanaged layer. This brings back the behavior of the abandoned `ol.FeatureOverlay` that was replaced by unmanaged layers.
If you are affected by this change, please change your unmanaged layer to a regular layer by using e.g. `ol.Map#addLayer` instead of `ol.layer.Layer#setMap`.
### v3.10.0
#### `ol.layer.Layer` changes
The experimental `setHue`, `setContrast`, `setBrightness`, `setSaturation`, and the corresponding getter methods have been removed. These properties only worked with the WebGL renderer. If are interested in applying color transforms, look for the `postcompose` event in the API docs. In addition, the `ol.source.Raster` source provides a way to create new raster data based on arbitrary transforms run on any number of input sources.
### v3.9.0
#### `ol.style.Circle` changes
The experimental `getAnchor`, `getOrigin`, and `getSize` methods have been removed. The anchor and origin of a circle symbolizer are not modifiable, so these properties should not need to be accessed. The radius and stroke width can be used to calculate the rendered size of a circle symbolizer if needed:
```js
// calculate rendered size of a circle symbolizer
varwidth=2*circle.getRadius();
if(circle.getStroke()){
width+=circle.getStroke().getWidth()+1;
}
```
### v3.8.0
There should be nothing special required when upgrading from v3.7.0 to v3.8.0.
### v3.7.0
#### Removal of `ol.FeatureOverlay`
Instead of an `ol.FeatureOverlay`, we now use an `ol.layer.Vector` with an
With the removal of `ol.FeatureOverlay`, `zIndex` symbolizer properties of overlays are no longer stacked per map, but per layer/overlay. If you previously had multiple feature overlays where you controlled the rendering order of features by using `zIndex` symbolizer properties, you can now achieve the same rendering order only if all overlay features are on the same layer.
Note that `ol.FeatureOverlay#getFeatures()` returned an `{ol.Collection.<ol.Feature>}`, whereas `ol.source.Vector#getFeatures()` returns an `{Array.<ol.Feature>}`.
#### `ol.TileCoord` changes
Until now, the API exposed two different types of `ol.TileCoord` tile coordinates: internal ones that increase left to right and upward, and transformed ones that may increase downward, as defined by a transform function on the tile grid. With this change, the API now only exposes tile coordinates that increase left to right and upward.
Previously, tile grids created by OpenLayers either had their origin at the top-left or at the bottom-left corner of the extent. To make it easier for application developers to transform tile coordinates to the common XYZ tiling scheme, all tile grids that OpenLayers creates internally have their origin now at the top-left corner of the extent.
This change affects applications that configure a custom `tileUrlFunction` for an `ol.source.Tile`. Previously, the `tileUrlFunction` was called with rather unpredictable tile coordinates, depending on whether a tile coordinate transform took place before calling the `tileUrlFunction`. Now it is always called with OpenLayers tile coordinates. To transform these into the common XYZ tiling scheme, a custom `tileUrlFunction` has to change the `y` value (tile row) of the `ol.TileCoord`:
The `ol.tilegrid.TileGrid#createTileCoordTransform()` function which could be used to get the tile grid's tile coordinate transform function has been removed. This function was confusing and should no longer be needed now that application developers get tile coordinates in a known layout.
The code snippets below show how your application code needs to be changed:
Old application code (with `ol.tilegrid.TileGrid#createTileCoordTransform()`):
The replacement of `ol.tilegrid.Zoomify` is a plain `ol.tilegrid.TileGrid`, configured with `extent`, `origin` and `resolutions`. If the `size` passed to the `ol.source.Zoomify` source is `[width, height]`, then the extent for the tile grid will be `[0, -height, width, 0]`, and the origin will be `[0, 0]`.
#### Replace `ol.View.fitExtent()` and `ol.View.fitGeometry()` with `ol.View.fit()`
* This combines two previously distinct functions into one more flexible call which takes either a geometry or an extent.
* Rename all calls to `fitExtent` and `fitGeometry` to `fit`.
#### Change to `ol.interaction.Modify`
When single clicking a line or boundary within the `pixelTolerance`, a vertex is now created.
### v3.6.0
#### `ol.interaction.Draw` changes
* The `minPointsPerRing` config option has been renamed to `minPoints`. It is now also available for linestring drawing, not only for polygons.
* The `ol.DrawEvent` and `ol.DrawEventType` types were renamed to `ol.interaction.DrawEvent` and `ol.interaction.DrawEventType`. This has an impact on your code only if your code is compiled together with ol3.
#### `ol.tilegrid` changes
* The `ol.tilegrid.XYZ` constructor has been replaced by a static `ol.tilegrid.createXYZ()` function. The `ol.tilegrid.createXYZ()` function takes the same arguments as the previous `ol.tilegrid.XYZ` constructor, but returns an `ol.tilegrid.TileGrid` instance.
* The internal tile coordinate scheme for XYZ sources has been changed. Previously, the `y` of tile coordinates was transformed to the coordinates used by sources by calculating `-y-1`. Now, it is transformed by calculating `height-y-1`, where height is the number of rows of the tile grid at the zoom level of the tile coordinate.
* The `widths` constructor option of `ol.tilegrid.TileGrid` and subclasses is no longer available, and it is no longer necessary to get proper wrapping at the 180° meridian. However, for `ol.tilegrid.WMTS`, there is a new option `sizes`, where each entry is an `ol.Size` with the `width` ('TileMatrixWidth' in WMTS capabilities) as first and the `height` ('TileMatrixHeight') as second entry of the array. For other tile grids, users can
now specify an `extent` instead of `widths`. These settings are used to restrict the range of tiles that sources will request.
* For `ol.source.TileWMS`, the default value of `warpX` used to be `undefined`, meaning that WMS requests with out-of-extent tile BBOXes would be sent. Now `wrapX` can only be `true` or `false`, and the new default is `true`. No application code changes should be required, but the resulting WMS requests for out-of-extent tiles will no longer use out-of-extent BBOXes, but ones that are shifted to real-world coordinates.
### v3.5.0
#### `ol.Object` and `bindTo`
* The following experimental methods have been removed from `ol.Object`: `bindTo`, `unbind`, and `unbindAll`. If you want to get notification about `ol.Object` property changes, you can listen for the `'propertychange'` event (e.g. `object.on('propertychange', listener)`). Two-way binding can be set up at the application level using property change listeners. See [#3472](https://github.com/openlayers/ol3/pull/3472) for details on the change.
* The experimental `ol.dom.Input` component has been removed. If you need to synchronize the state of a dom Input element with an `ol.Object`, this can be accomplished using listeners for change events. For example, you might bind the state of a checkbox type input with a layer's visibility like this:
```js
var layer = new ol.layer.Tile();
var checkbox = document.querySelector('#checkbox');
checkbox.addEventListener('change', function() {
var checked = this.checked;
if (checked !== layer.getVisible()) {
layer.setVisible(checked);
}
});
layer.on('change:visible', function() {
var visible = this.getVisible();
if (visible !== checkbox.checked) {
checkbox.checked = visible;
}
});
```
#### New Vector API
* The following experimental vector classes have been removed: `ol.source.GeoJSON`, `ol.source.GML`, `ol.source.GPX`, `ol.source.IGC`, `ol.source.KML`, `ol.source.OSMXML`, and `ol.source.TopoJSON`. You now will use `ol.source.Vector` instead.
For example, if you used `ol.source.GeoJSON` as follows:
```js
var source = new ol.source.GeoJSON({
url: 'features.json',
projection: 'EPSG:3857'
});
```
you will need to change your code to:
```js
var source = new ol.source.Vector({
url: 'features.json',
format: new ol.format.GeoJSON()
});
```
See http://openlayers.org/en/master/examples/vector-layer.html for a real example.
Note that you no longer need to set a `projection` on the source!
Previously the vector data was loaded at source construction time, and, if the data projection and the source projection were not the same, the vector data was transformed to the source projection before being inserted (as features) into the source.
The vector data is now loaded at render time, when the view projection is known. And the vector data is transformed to the view projection if the data projection and the source projection are not the same.
If you still want to "eagerly" load the source you will use something like this:
```js
var source = new ol.source.Vector();
$.ajax('features.json').then(function(response) {
var geojsonFormat = new ol.format.GeoJSON();
var features = geojsonFormat.readFeatures(response,
{featureProjection: 'EPSG:3857'});
source.addFeatures(features);
});
```
The above code uses jQuery to send an Ajax request, but you can obviously use any Ajax library.
See http://openlayers.org/en/master/examples/igc.html for a real example.
* Note about KML
If you used `ol.source.KML`'s `extractStyles` or `defaultStyle` options, you will now have to set these options on `ol.format.KML` instead. For example, if you used:
```js
var source = new ol.source.KML({
url: 'features.kml',
extractStyles: false,
projection: 'EPSG:3857'
});
```
you will now use:
```js
var source = new ol.source.Vector({
url: 'features.kml',
format: new ol.format.KML({
extractStyles: false
})
});
```
* The `ol.source.ServerVector` class has been removed. If you used it, for example as follows:
See http://openlayers.org/en/master/examples/vector-osm.html for a real example.
* The experimental `ol.loadingstrategy.createTile` function has been renamed to `ol.loadingstrategy.tile`. The signature of the function hasn't changed. See http://openlayers.org/en/master/examples/vector-osm.html for an example.
#### Change to `ol.style.Icon`
* When manually loading an image for `ol.style.Icon`, the image size should now be set
with the `imgSize` option and not with `size`. `size` is supposed to be used for the
size of a sub-rectangle in an image sprite.
#### Support for non-square tiles
The return value of `ol.tilegrid.TileGrid#getTileSize()` will now be an `ol.Size` array instead of a number if non-square tiles (i.e. an `ol.Size` array instead of a number as `tilsSize`) are used. To always get an `ol.Size`, the new `ol.size.toSize()` was added.
#### Change to `ol.interaction.Draw`
When finishing a draw, the `drawend` event is now dispatched before the feature is inserted to either the source or the collection. This change allows application code to finish setting up the feature.
#### Misc.
If you compile your application together with the library and use the `ol.feature.FeatureStyleFunction` type annotation (this should be extremely rare), the type is now named `ol.FeatureStyleFunction`.
### v3.4.0
There should be nothing special required when upgrading from v3.3.0 to v3.4.0.
### v3.3.0
* The `ol.events.condition.mouseMove` function was replaced by `ol.events.condition.pointerMove` (see [#3281](https://github.com/openlayers/ol3/pull/3281)). For example, if you use `ol.events.condition.mouseMove` as the condition in a `Select` interaction then you now need to use `ol.events.condition.pointerMove`:
```js
var selectInteraction = new ol.interaction.Select({
The v3.10.0 release includes features and fixes from 66 pull requests since the v3.9.0 release. New features and improvements include:
* Full touch gesture support for the Microsoft Edge browser.
* Improved API docs - required constructor options are now marked as such.
* Text styles (vector labels) now work with defaults instead of failing when only a label text is set.
* Write support for GML3 features with multiple geometries
See the complete list below for details. And see the following notes to know how to upgrade from v3.9.0 to v3.10.0.
## Upgrade notes
#### `ol.layer.Layer` changes
The experimental `setHue`, `setContrast`, `setBrightness`, `setSaturation`, and the corresponding getter methods have been removed. These properties only worked with the WebGL renderer. If you are interested in applying color transforms, look for the `postcompose` event in the API docs. In addition, the `ol.source.Raster` source provides a way to create new raster data based on arbitrary transforms run on any number of input sources.
#### Removal of legacy Internet Explorer support
If you are building an appliction that supports Internet Explorer 8 or older, you'll need to use ES5 shims to make OpenLayers work. As before, support for such old browsers is very basic, and we recommend to not support them.
## New features and fixes
* [#4237](https://github.com/openlayers/ol3/pull/4237) - #3328: GML3 - Writing features with multiple geometries ([@awaterme](https://github.com/awaterme))
* [#4218](https://github.com/openlayers/ol3/pull/4218) - Add 'getLayer()' method to 'ol.interaction.Select' ([@jonataswalker](https://github.com/jonataswalker))
* [#4036](https://github.com/openlayers/ol3/pull/4036) - Fix modify interaction event order ([@alvinlindstam](https://github.com/alvinlindstam))
* [#4036](https://github.com/openlayers/ol3/pull/4036) - Fix modify interaction event order ([@alvinlindstam](https://github.com/alvinlindstam))
* [#4116](https://github.com/openlayers/ol3/pull/4116) - Make ol.control.OverviewMap's view configurable ([@ahocevar](https://github.com/ahocevar))
* [#4234](https://github.com/openlayers/ol3/pull/4234) - Support OGC WKT proj4 def.units and def.to_meter ([@tbarsballe](https://github.com/tbarsballe))
* [#4224](https://github.com/openlayers/ol3/pull/4224) - Don't transform the angle into degrees to rotate the element ([@fredj](https://github.com/fredj))
* [#4216](https://github.com/openlayers/ol3/pull/4216) - Fix canvas replay which broke with 31a68e2 ([@ahocevar](https://github.com/ahocevar))
* [#4202](https://github.com/openlayers/ol3/pull/4202) - Remove use of goog.dom.appendChild ([@fredj](https://github.com/fredj))
* [#4205](https://github.com/openlayers/ol3/pull/4205) - Minor cleanup ([@fredj](https://github.com/fredj))
* [#4203](https://github.com/openlayers/ol3/pull/4203) - Cosmetic changes to example html / css ([@marcjansen](https://github.com/marcjansen))
* [#4184](https://github.com/openlayers/ol3/pull/4184) - Adjust iframe's position of GetFeatureInfo examples ([@jonataswalker](https://github.com/jonataswalker))
* [#4192](https://github.com/openlayers/ol3/pull/4192) - Remove use of goog.isNull in favor of simple truthy checks ([@marcjansen](https://github.com/marcjansen))
* [#4197](https://github.com/openlayers/ol3/pull/4197) - Remove blur action on MOUSEOUT on Zoom Out button ([@denilsonsa](https://github.com/denilsonsa))
* [#4195](https://github.com/openlayers/ol3/pull/4195) - #4171: Prefer current layout as default on MultiLineString.setLineStrings() ([@awaterme](https://github.com/awaterme))
* [#4172](https://github.com/openlayers/ol3/pull/4172) - #4171: Prefer current layout as default on Multipolygon.setPolygons() ([@awaterme](https://github.com/awaterme))
* [#4190](https://github.com/openlayers/ol3/pull/4190) - Remove use of goog.functions.constant ([@marcjansen](https://github.com/marcjansen))
* [#4188](https://github.com/openlayers/ol3/pull/4188) - Remove use of goog.object.getKeys ([@fredj](https://github.com/fredj))
* [#4189](https://github.com/openlayers/ol3/pull/4189) - Replace goog.nullFunction with ol.nullFunction ([@marcjansen](https://github.com/marcjansen))
* [#4165](https://github.com/openlayers/ol3/pull/4165) - Use ECMAScript 5.1 Array functions instead of goog.array ([@fredj](https://github.com/fredj))
* [#4181](https://github.com/openlayers/ol3/pull/4181) - Remove use of goog.array.contains ([@fredj](https://github.com/fredj))
* [#4174](https://github.com/openlayers/ol3/pull/4174) - Remove hue, saturation, contrast, and brightness as layer properties. ([@tschaub](https://github.com/tschaub))
* [#4183](https://github.com/openlayers/ol3/pull/4183) - Remove @api on getHitDetectionFramebuffer ([@elemoine](https://github.com/elemoine))
* [#4179](https://github.com/openlayers/ol3/pull/4179) - Use Date.now() instead of goog.now() ([@marcjansen](https://github.com/marcjansen))
* [#4175](https://github.com/openlayers/ol3/pull/4175) - Remove use of goog.math.clamp(). ([@tschaub](https://github.com/tschaub))
* [#4173](https://github.com/openlayers/ol3/pull/4173) - Only animate when resolution is about to be changed ([@ahocevar](https://github.com/ahocevar))
* [#4129](https://github.com/openlayers/ol3/pull/4129) - Remove use of goog.isDef. ([@openlayers](https://github.com/openlayers))
* [#4168](https://github.com/openlayers/ol3/pull/4168) - Tile preload example wording (fixes #4147) ([@wlerner](https://github.com/wlerner))
* [#4167](https://github.com/openlayers/ol3/pull/4167) - Remove externs in externs/closure-compiler.js ([@fredj](https://github.com/fredj))
* [#4166](https://github.com/openlayers/ol3/pull/4166) - Use version 20150920 of Closure Compiler ([@elemoine](https://github.com/elemoine))
* [#4159](https://github.com/openlayers/ol3/pull/4159) - Remove use of goog.object.containsKey ([@fredj](https://github.com/fredj))
* [#4157](https://github.com/openlayers/ol3/pull/4157) - Fix typo in doc ([@elemoine](https://github.com/elemoine))
* [#4138](https://github.com/openlayers/ol3/pull/4138) - Enhanced documentation for ol.style.Text ([@ekargee](https://github.com/ekargee))
* [#4110](https://github.com/openlayers/ol3/pull/4110) - Minor cleanups ([@fredj](https://github.com/fredj))
* [#4156](https://github.com/openlayers/ol3/pull/4156) - Rename drag-features example to custom-interactions ([@elemoine](https://github.com/elemoine))
* [#4150](https://github.com/openlayers/ol3/pull/4150) - Remove use of goog.object.remove ([@fredj](https://github.com/fredj))
* [#4145](https://github.com/openlayers/ol3/pull/4145) - API method for simplifying geometries. ([@tschaub](https://github.com/tschaub))
* [#4153](https://github.com/openlayers/ol3/pull/4153) - Add a "features" option to ol.interaction.Select ([@elemoine](https://github.com/elemoine))
* [#4144](https://github.com/openlayers/ol3/pull/4144) - Set context.fillStyle to a string ([@elemoine](https://github.com/elemoine))
* [#4149](https://github.com/openlayers/ol3/pull/4149) - Remove use of goog.array.isEmpty ([@fredj](https://github.com/fredj))
* [#4139](https://github.com/openlayers/ol3/pull/4139) - Add turf.js and JSTS example ([@tsauerwein](https://github.com/tsauerwein))
* [#4136](https://github.com/openlayers/ol3/pull/4136) - Fix the 'click-to-fork' link in contributer notes ([@marcjansen](https://github.com/marcjansen))
* [#4111](https://github.com/openlayers/ol3/pull/4111) - Use a blackish default for filling texts ([@marcjansen](https://github.com/marcjansen))
* [#4120](https://github.com/openlayers/ol3/pull/4120) - Remove invalid link to featureOverlay in API doc ([@kalbermattenm](https://github.com/kalbermattenm))
* [#4117](https://github.com/openlayers/ol3/pull/4117) - forEachFeatureAtPixel shouldn't fail if layer has no source ([@pgiraud](https://github.com/pgiraud))
* [#4106](https://github.com/openlayers/ol3/pull/4106) - Focus to search field on page load ([@elemoine](https://github.com/elemoine))
* [#4079](https://github.com/openlayers/ol3/pull/4079) - Automatically mark required options in API-docs ([@marcjansen](https://github.com/marcjansen))
* [#4107](https://github.com/openlayers/ol3/pull/4107) - Prevent page zoom on IE Edge ([@fredj](https://github.com/fredj))
* [#3969](https://github.com/openlayers/ol3/pull/3969) - Add an option to use the mouse's location as an anchor when zooming ([@samuellapointe](https://github.com/samuellapointe))
The v3.11.0 release includes features and fixes from 73 pull requests since the v3.10.1 release. New features and improvements include:
* Support for raster reprojection - load raster sources in one projection and view them in another.
* Support for Mapbox Vector Tiles!
* Improved KML support, GeoJSON & TopoJSON fixes, and much more. See below for the full list.
## Upgrade notes
#### `ol.format.KML` changes
KML icons are scaled 50% so that the rendering better matches Google Earth rendering.
If a KML placemark has a name and is a point, an `ol.style.Text` is created with the name displayed to the right of the icon (if there is an icon).
This can be controlled with the showPointNames option which defaults to true.
To disable rendering of the point names for placemarks, use the option:
new ol.format.KML({ showPointNames: false });
#### `ol.interaction.DragBox` and `ol.interaction.DragZoom` changes
Styling is no longer done with `ol.Style`, but with pure CSS. The `style` constructor option is no longer required, and no longer available. Instead, there is a `className` option for the CSS selector. The default for `ol.interaction.DragBox` is `ol-dragbox`, and `ol.interaction.DragZoom` uses `ol-dragzoom`. If you previously had
```js
newol.interaction.DragZoom({
style:newol.style.Style({
stroke:newol.style.Stroke({
color:'red',
width:3
}),
fill:newol.style.Fill({
color:[255,255,255,0.4]
})
})
});
```
you'll now just need
```js
newol.interaction.DragZoom();
```
but with additional css:
```css
.ol-dragzoom{
border-color:red;
border-width:3px;
background-color:rgba(255,255,255,0.4);
}
```
#### Removal of `ol.source.TileVector`
With the introduction of true vector tile support, `ol.source.TileVector` becomes obsolete. Change your code to use `ol.layer.VectorTile` and `ol.source.VectorTile` instead of `ol.layer.Vector` and `ol.source.TileVector`.
#### `ol.Map#forEachFeatureAtPixel` changes for unmanaged layers
`ol.Map#forEachFeatureAtPixel` will still be called for unmanaged layers, but the 2nd argument to the callback function will be `null` instead of a reference to the unmanaged layer. This brings back the behavior of the abandoned `ol.FeatureOverlay` that was replaced by unmanaged layers.
If you are affected by this change, please change your unmanaged layer to a regular layer by using e.g. `ol.Map#addLayer` instead of `ol.layer.Layer#setMap`.
## Full list of changes
* [#4394](https://github.com/openlayers/ol3/pull/4394) - Allow ol.Object property update without notification. ([@DavidHequet](https://github.com/DavidHequet))
* [#4395](https://github.com/openlayers/ol3/pull/4395) - Flag ol.style.Text setOffsetX and Y as @api. ([@adube](https://github.com/adube))
* [#4353](https://github.com/openlayers/ol3/pull/4353) - Resolve path to jsdoc-fork. ([@tschaub](https://github.com/tschaub))
* [#3627](https://github.com/openlayers/ol3/pull/3627) - Make package.json compatible for npm frontend use. ([@ThomasG77](https://github.com/ThomasG77))
* [#4163](https://github.com/openlayers/ol3/pull/4163) - Fixes for building with Node 4.x. ([@tschaub](https://github.com/tschaub))
* [#4347](https://github.com/openlayers/ol3/pull/4347) - Use require.resolve() to find jsdoc. ([@tschaub](https://github.com/tschaub))
* [#4291](https://github.com/openlayers/ol3/pull/4291) - Add 'Move a feature along a line' example. ([@jonataswalker](https://github.com/jonataswalker))
* [#4344](https://github.com/openlayers/ol3/pull/4344) - Allow different resolutions in x and y direction for ol.source.ImageStatic ([@bartvde](https://github.com/bartvde))
* [#4339](https://github.com/openlayers/ol3/pull/4339) - Make sure drawImage width and height are not too big ([@bartvde](https://github.com/bartvde))
* [#4334](https://github.com/openlayers/ol3/pull/4334) - Check view extent within image extent ([@ahocevar](https://github.com/ahocevar))
* [#4332](https://github.com/openlayers/ol3/pull/4332) - Fix write out GeoJSON features with id equal to 0 ([@fredj](https://github.com/fredj))
* [#4331](https://github.com/openlayers/ol3/pull/4331) - Allow TopoJSON features with id equal to 0 ([@fredj](https://github.com/fredj))
* [#4330](https://github.com/openlayers/ol3/pull/4330) - ol.format.TopoJSON is read only, update the jsdoc ([@openlayers](https://github.com/openlayers))
* [#4327](https://github.com/openlayers/ol3/pull/4327) - Allow GeoJSON features with id equal to 0 ([@fredj](https://github.com/fredj))
* [#4219](https://github.com/openlayers/ol3/pull/4219) - Support tiled vector data and Mapbox vector tiles ([@ahocevar](https://github.com/ahocevar))
* [#4322](https://github.com/openlayers/ol3/pull/4322) - Add wrapX override support for ol.source.Cluster ([@FRizZL](https://github.com/FRizZL))
* [#4316](https://github.com/openlayers/ol3/pull/4316) - Render name labels if the geometry is a point in KML format (@tamarmot) ([@marcjansen](https://github.com/marcjansen))
* [#4313](https://github.com/openlayers/ol3/pull/4313) - Align logos nicely with attribution text ([@ahocevar](https://github.com/ahocevar))
* [#4297](https://github.com/openlayers/ol3/pull/4297) - Create standalone versions of ol.ext packages ([@ahocevar](https://github.com/ahocevar))
* [#4302](https://github.com/openlayers/ol3/pull/4302) - scale icons by 0.5 so they are not huge ([@tamarmot](https://github.com/tamarmot))
* [#4283](https://github.com/openlayers/ol3/pull/4283) - Flag ol.tilegrid.TileGrid getTileCoordExtent as @api ([@adube](https://github.com/adube))
* [#4280](https://github.com/openlayers/ol3/pull/4280) - Use overlay container instead of viewport for ol.render.Box ([@ahocevar](https://github.com/ahocevar))
* [#4278](https://github.com/openlayers/ol3/pull/4278) - Use DOM instead of map canvas for ol.render.Box ([@ahocevar](https://github.com/ahocevar))
* [#4277](https://github.com/openlayers/ol3/pull/4277) - Improve the box select example ([@fredj](https://github.com/fredj))
* [#4102](https://github.com/openlayers/ol3/pull/4102) - Export ol.Observable#dispatchEvent function ([@fredj](https://github.com/fredj))
* [#4261](https://github.com/openlayers/ol3/pull/4261) - ol.events.condition.mouseOnly may be wrong ([@fredj](https://github.com/fredj))
* [#4269](https://github.com/openlayers/ol3/pull/4269) - Fix Zoom control duration option - allow `0` as value ([@adube](https://github.com/adube))
* [#4268](https://github.com/openlayers/ol3/pull/4268) - Add method for retrieving ol.Overlay by id ([@jonataswalker](https://github.com/jonataswalker))
* [#4272](https://github.com/openlayers/ol3/pull/4272) - Allow the DragZoom interaction created in defaults to use zoomDuration option. ([@adube](https://github.com/adube))
* [#4267](https://github.com/openlayers/ol3/pull/4267) - Example usability improvements ([@ahocevar](https://github.com/ahocevar))
* [#4263](https://github.com/openlayers/ol3/pull/4263) - Add back CSSProperties.prototype.touchAction extern ([@fredj](https://github.com/fredj))
* [#4259](https://github.com/openlayers/ol3/pull/4259) - Remove use of toDegrees/toRadians util functions ([@marcjansen](https://github.com/marcjansen))
* [#4258](https://github.com/openlayers/ol3/pull/4258) - Remove usage of goog.dom.TagName enum ([@marcjansen](https://github.com/marcjansen))
The v3.11.1 release is a patch release that addresses a few regressions in the v3.11.0 release. See the [v3.11.0 release notes](https://github.com/openlayers/ol3/releases/tag/v3.11.0) for details on upgrading from v3.10.
* [#4408](https://github.com/openlayers/ol3/pull/4408) - Use ratio when calculating ImageWMS width and height ([@ahocevar](https://github.com/ahocevar))
The v3.11.2 release is a patch release that addresses a few regressions in the v3.11.1 release. See the [v3.11.0 release notes](https://github.com/openlayers/ol3/releases/tag/v3.11.0) for details on upgrading from v3.10.
The v3.12.0 release includes features and fixes from 71 pull requests since the v3.11.2 release. New features and improvements include:
* Tile coordinate wrapping for raster reprojection.
* Support for multi-line labels.
* Allow rendering geometries to an arbitrary canvas (useful for vector legends).
## Upgrade notes
#### `ol.Map#forEachFeatureAtPixel` changes
The optional `layerFilter` function is now also called for unmanaged layers. To get the same behaviour as before, wrap your layer filter code in an if block like this:
* [#4511](https://github.com/openlayers/ol3/pull/4511) - Minor code cleanup ([@fredj](https://github.com/fredj))
* [#4510](https://github.com/openlayers/ol3/pull/4510) - Adding a check just in case the projection is not defined/supported ([@GeoCat](https://github.com/GeoCat))
* [#4505](https://github.com/openlayers/ol3/pull/4505) - Remove use of goog.object.getKeys ([@fredj](https://github.com/fredj))
* [#4472](https://github.com/openlayers/ol3/pull/4472) - Do not ignore layer filter for unmanaged layers ([@ahocevar](https://github.com/ahocevar))
* [#4476](https://github.com/openlayers/ol3/pull/4476) - Remove use of goog.functions.constant ([@fredj](https://github.com/fredj))
* [#4484](https://github.com/openlayers/ol3/pull/4484) - Remove use of goog.dom.createDom ([@fredj](https://github.com/fredj))
* [#4486](https://github.com/openlayers/ol3/pull/4486) - Remove note about DragZoom and vector support ([@fredj](https://github.com/fredj))
* [#4483](https://github.com/openlayers/ol3/pull/4483) - Remove use of goog.object.containsKey ([@fredj](https://github.com/fredj))
* [#4475](https://github.com/openlayers/ol3/pull/4475) - Fix up failing tests in Internet Explorer ([@bartvde](https://github.com/bartvde))
* [#4485](https://github.com/openlayers/ol3/pull/4485) - Use appendChild instead of goog.dom.append ([@fredj](https://github.com/fredj))
* [#4481](https://github.com/openlayers/ol3/pull/4481) - Remove blur workaround in ol.control.Attribution ([@fredj](https://github.com/fredj))
* [#4479](https://github.com/openlayers/ol3/pull/4479) - Export ol.interaction.Interaction#getMap function ([@fredj](https://github.com/fredj))
* [#4477](https://github.com/openlayers/ol3/pull/4477) - Replace goog.nullFunction with ol.nullFunction ([@fredj](https://github.com/fredj))
* [#4474](https://github.com/openlayers/ol3/pull/4474) - Remove use of goog.dom.createElement and goog.dom.createTextNode ([@fredj](https://github.com/fredj))
* [#4469](https://github.com/openlayers/ol3/pull/4469) - Upgrade to JSTS 0.17.0 in example ([@bjornharrtell](https://github.com/bjornharrtell))
* [#4465](https://github.com/openlayers/ol3/pull/4465) - Update handlebars to version 4.0.5 🚀 ([@openlayers](https://github.com/openlayers))
* [#4464](https://github.com/openlayers/ol3/pull/4464) - Merge in changes from the 3.11.2 release. ([@openlayers](https://github.com/openlayers))
* [#4463](https://github.com/openlayers/ol3/pull/4463) - Remove use of goog.array.sort ([@fredj](https://github.com/fredj))
* [#4458](https://github.com/openlayers/ol3/pull/4458) - Remove extra space in type annotation ([@fredj](https://github.com/fredj))
* [#4420](https://github.com/openlayers/ol3/pull/4420) - Remove Bootstrap and jQuery from example snippets. ([@openlayers](https://github.com/openlayers))
* [#4442](https://github.com/openlayers/ol3/pull/4442) - Use jsdoc@3.4.0. ([@tschaub](https://github.com/tschaub))
* [#4449](https://github.com/openlayers/ol3/pull/4449) - Change the label of the full screen button to be more intuitive ([@bartvde](https://github.com/bartvde))
* [#4448](https://github.com/openlayers/ol3/pull/4448) - Check ol.source.UrlTile#urls property for null value ([@fredj](https://github.com/fredj))
* [#4434](https://github.com/openlayers/ol3/pull/4434) - Remove unused local variables ([@fredj](https://github.com/fredj))
* [#4433](https://github.com/openlayers/ol3/pull/4433) - Remove unused local variables ([@fredj](https://github.com/fredj))
* [#4140](https://github.com/openlayers/ol3/pull/4140) - Add flight animation example ([@tsauerwein](https://github.com/tsauerwein))
* [#4428](https://github.com/openlayers/ol3/pull/4428) - Add imageSize regression test for ol.source.ImageWMS ([@ahocevar](https://github.com/ahocevar))
* [#4389](https://github.com/openlayers/ol3/pull/4389) - Smooth transitions on parameter changes ([@elemoine](https://github.com/elemoine))
* [#4410](https://github.com/openlayers/ol3/pull/4410) - Merge in changes from the 3.11.1 release. ([@openlayers](https://github.com/openlayers))
* [#4401](https://github.com/openlayers/ol3/pull/4401) - Allow style function to return a style. ([@tschaub](https://github.com/tschaub))
* [#4404](https://github.com/openlayers/ol3/pull/4404) - Set correctly the opt_this parameter when writing a KML document ([@oterral](https://github.com/oterral))
* [#4397](https://github.com/openlayers/ol3/pull/4397) - Update glob to version 6.0.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#4362](https://github.com/openlayers/ol3/pull/4362) - Rotate control now takes optional resetNorth function. ([@tamarmot](https://github.com/tamarmot))
The v3.12.1 release is a patch release that addresses a few regressions in the v3.12.0 release. See the [v3.12.0 release notes](https://github.com/openlayers/ol3/releases/tag/v3.12.0) for details on upgrading from v3.11.
* [#4570](https://github.com/openlayers/ol3/pull/4570) - Rename defaultSort to numberSafeCompareFunction on ol.array ([@bartvde](https://github.com/bartvde))
* [#4567](https://github.com/openlayers/ol3/pull/4567) - Always pass on a compare function to sort ([@bartvde](https://github.com/bartvde))
The v3.13.0 release includes features and fixes from 68 pull requests since the v3.12.1 release. New features and improvements include:
* Improved tiles rendering for the canvas renderer
* Improved MapQuest rendering
* Add color option to ol.style.Icon
* Load TileJSON sources via XMLHttpRequest by default
* Add new ol.geom.LineString#getCoordinateAt function
* Simplify meters per unit handling
* Use ESLint as a replacement for gjslint.py and jshint
## Upgrade notes
#### `proj4js` integration
Before this release, OpenLayers depended on the global proj4 namespace. When using a module loader like Browserify, you might not want to depend on the global `proj4` namespace. You can use the `ol.proj.setProj4` function to set the proj4 function object. For example in a browserify ES6 environment:
```js
importolfrom'openlayers';
importproj4from'proj4';
ol.proj.setProj4(proj4);
```
#### `ol.source.TileJSON` changes
The `ol.source.TileJSON` now uses `XMLHttpRequest` to load the TileJSON instead of JSONP with callback.
When using server without proper CORS support, `jsonp: true` option can be passed to the constructor to get the same behavior as before:
```js
newol.source.TileJSON({
url:'http://serverwithoutcors.com/tilejson.json',
jsonp:true
})
```
Also for Mapbox v3, make sure you use urls ending with `.json` (which are able to handle both `XMLHttpRequest` and JSONP) instead of `.jsonp`.
## Full list of changes
* [#4694](https://github.com/openlayers/ol3/pull/4694) - Fix eslint errors in wms-time example ([@fredj](https://github.com/fredj))
* [#4527](https://github.com/openlayers/ol3/pull/4527) - Add support for smooth TileWMS dimensions ([@bartvde](https://github.com/bartvde))
* [#4684](https://github.com/openlayers/ol3/pull/4684) - Update eslint-config-openlayers to version 3.0.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#4677](https://github.com/openlayers/ol3/pull/4677) - Make pixel projection handling work in compiled mode ([@ahocevar](https://github.com/ahocevar))
* [#4639](https://github.com/openlayers/ol3/pull/4639) - Remove use of goog.bind and use ES5 .bind. ([@nicholas-l](https://github.com/nicholas-l))
* [#4655](https://github.com/openlayers/ol3/pull/4655) - Update browserify to version 13.0.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#4666](https://github.com/openlayers/ol3/pull/4666) - Add a 'boxdrag' event to ol.interaction.DragBox. Resolves #4563 . ([@WeaveTeam](https://github.com/WeaveTeam))
* [#4669](https://github.com/openlayers/ol3/pull/4669) - Remove reference to Closure Linter in CONTRIBUTING.md ([@fredj](https://github.com/fredj))
* [#4665](https://github.com/openlayers/ol3/pull/4665) - Update istanbul to version 0.4.2 🚀 ([@openlayers](https://github.com/openlayers))
* [#4663](https://github.com/openlayers/ol3/pull/4663) - Update glob to version 6.0.4 🚀 ([@openlayers](https://github.com/openlayers))
* [#4667](https://github.com/openlayers/ol3/pull/4667) - Fix rendering of transparent MapQuest layer type ([@klokantech](https://github.com/klokantech))
* [#4457](https://github.com/openlayers/ol3/pull/4457) - Add color option to ol.style.Icon ([@alexbrault](https://github.com/alexbrault))
* [#4638](https://github.com/openlayers/ol3/pull/4638) - Do not rely on projection extent ([@ahocevar](https://github.com/ahocevar))
* [#4635](https://github.com/openlayers/ol3/pull/4635) - Update async to version 1.5.2 🚀 ([@openlayers](https://github.com/openlayers))
* [#4581](https://github.com/openlayers/ol3/pull/4581) - Do not render in handleDownEvent ([@ahocevar](https://github.com/ahocevar))
* [#4541](https://github.com/openlayers/ol3/pull/4541) - Add new ol.geom.LineString#getCoordinateAt function ([@fredj](https://github.com/fredj))
* [#4489](https://github.com/openlayers/ol3/pull/4489) - Update phantomjs to version 1.9.19 🚀 ([@openlayers](https://github.com/openlayers))
* [#4625](https://github.com/openlayers/ol3/pull/4625) - Use XHR by default to load TileJSON in ol.source.TileJSON ([@klokantech](https://github.com/klokantech))
* [#4622](https://github.com/openlayers/ol3/pull/4622) - Update fs-extra to version 0.26.4 🚀 ([@openlayers](https://github.com/openlayers))
* [#4630](https://github.com/openlayers/ol3/pull/4630) - Simplify meters per unit handling ([@ahocevar](https://github.com/ahocevar))
* [#4490](https://github.com/openlayers/ol3/pull/4490) - Update istanbul to version 0.4.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#4574](https://github.com/openlayers/ol3/pull/4574) - Added boxEndCondition to DragBoxOptions to replace the hardcoded chec… ([@WeaveTeam](https://github.com/WeaveTeam))
* [#4553](https://github.com/openlayers/ol3/pull/4553) - Update mustache to version 2.2.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#4613](https://github.com/openlayers/ol3/pull/4613) - Include own layer in layerFilter and only select unselected features ([@ahocevar](https://github.com/ahocevar))
* [#4612](https://github.com/openlayers/ol3/pull/4612) - Set oli.source.VectorEvent#feature to ol.Feature|undefined ([@fredj](https://github.com/fredj))
* [#4620](https://github.com/openlayers/ol3/pull/4620) - Fix olx.format.PolylineOptions#factor type ([@fredj](https://github.com/fredj))
* [#4621](https://github.com/openlayers/ol3/pull/4621) - Fix olx.format.GPXOptions#readExtensions type ([@fredj](https://github.com/fredj))
* [#4619](https://github.com/openlayers/ol3/pull/4619) - Add option to load TileJSON via XHR ([@klokantech](https://github.com/klokantech))
* [#4617](https://github.com/openlayers/ol3/pull/4617) - Add missing return type to GeoJSON format ([@gberaudo](https://github.com/gberaudo))
* [#4615](https://github.com/openlayers/ol3/pull/4615) - Adjust copyright to include 2016 ([@marcjansen](https://github.com/marcjansen))
* [#4616](https://github.com/openlayers/ol3/pull/4616) - Update closure-util to version 1.10.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#4596](https://github.com/openlayers/ol3/pull/4596) - Use consistent tile coordinate keys ([@ahocevar](https://github.com/ahocevar))
* [#4609](https://github.com/openlayers/ol3/pull/4609) - Add ol.proj.setProj4 function ([@bartvde](https://github.com/bartvde))
* [#4603](https://github.com/openlayers/ol3/pull/4603) - Update async to version 1.5.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#4604](https://github.com/openlayers/ol3/pull/4604) - Update clean-css to version 3.4.9 🚀 ([@openlayers](https://github.com/openlayers))
* [#4600](https://github.com/openlayers/ol3/pull/4600) - Update glob to version 6.0.3 🚀 ([@openlayers](https://github.com/openlayers))
* [#4595](https://github.com/openlayers/ol3/pull/4595) - Pass 'opaque' option on to superclass ([@ahocevar](https://github.com/ahocevar))
* [#4598](https://github.com/openlayers/ol3/pull/4598) - Make ol.source.Tile#getTilePixelRatio work correctly for all sources ([@klokantech](https://github.com/klokantech))
* [#4594](https://github.com/openlayers/ol3/pull/4594) - Fix for TileQueue gradually choking up when using raster reprojection ([@klokantech](https://github.com/klokantech))
* [#4557](https://github.com/openlayers/ol3/pull/4557) - Conditionally render tiles to a separate tile canvas ([@ahocevar](https://github.com/ahocevar))
* [#4580](https://github.com/openlayers/ol3/pull/4580) - Update fs-extra to version 0.26.3 🚀 ([@openlayers](https://github.com/openlayers))
* [#4575](https://github.com/openlayers/ol3/pull/4575) - Update rbush to version 1.4.2 🚀 ([@openlayers](https://github.com/openlayers))
* [#4571](https://github.com/openlayers/ol3/pull/4571) - Correct typedef of selectinteraction options obj ([@marcjansen](https://github.com/marcjansen))
* [#4570](https://github.com/openlayers/ol3/pull/4570) - Rename defaultSort to numberSafeCompareFunction on ol.array ([@bartvde](https://github.com/bartvde))
* [#4567](https://github.com/openlayers/ol3/pull/4567) - Always pass on a compare function to sort ([@bartvde](https://github.com/bartvde))
* [#4001](https://github.com/openlayers/ol3/pull/4001) - Export PDF's using jsPDF ([@bartvde](https://github.com/bartvde))
The v3.13.1 release is a patch release that addresses a few regressions in the v3.13.0 release. See the [v3.13.0 release notes](https://github.com/openlayers/ol3/releases/tag/v3.13.0) for details on upgrading from v3.12.
## Fixes
* [#4736](https://github.com/openlayers/ol3/pull/4736) - Properly detect feature on unmanaged layer for toggle selection ([@ahocevar](https://github.com/ahocevar))
The v3.14.0 release includes features and fixes from 93 pull requests since the v3.13.1 release. New features and improvements include:
* New `source` option for the `ol.control.FullScreen`, to allow including other elements besides the map in a full screen view (#4679).
* New `target` property for the Drag&Drop interaction allows using a different drop target than the map viewport (#4876).
*`ol.style.RegularShape` has a new `rotateWithView` option, for controlling how regular shape symbols are rendered on rotated views (#4698).
* New `layers` option for `ol.format.WMSGetFeatureInfo` format, to selectively only read features from specific layers (#4700).
* New `precision` parameter for formatting coordinates with `ol.coordinate.toStringHDMS` (#4787).
* Smarter tile queue for improved tile loading user experience when more than one tile layer is used (#4794).
* Improved rendering performance for tile layers by rendering tiles directly to the map canvas (#4597).
* The `goog.events` event system was replaced with our own lightweight event system. This significally reduces the build size (#4711). Replacement of other `goog.*` components with ES5 features or custom code marks a huge step towards the complete removal of the Closure Library dependency.
## Upgrade notes
#### Internet Explorer 9 support
As of this release, OpenLayers requires a `requestAnimationFrame`/`cancelAnimationFrame` polyfill for IE 9 support. See http://cdn.polyfill.io/v2/docs/features/#requestAnimationFrame.
#### Layer pre-/postcompose event changes
It is the responsibility of the application to undo any canvas transform changes at the end of a layer 'precompose' or 'postcompose' handler. Previously, it was ok to set a null transform. The API now guarantees a device pixel coordinate system on the canvas with its origin in the top left corner of the map. However, applications should not rely on the underlying canvas being the same size as the visible viewport.
Old code:
```js
layer.on('precompose',function(e){
// rely on canvas dimensions to move coordinate origin to center
* [#4894](https://github.com/openlayers/ol3/pull/4894) - Only run raster operations after image sources have loaded. ([@tschaub](https://github.com/tschaub))
* [#4892](https://github.com/openlayers/ol3/pull/4892) - Stricter check for ImageData constructor ([@ahocevar](https://github.com/ahocevar))
* [#4891](https://github.com/openlayers/ol3/pull/4891) - Fix tests so they all pass in IE9 ([@ahocevar](https://github.com/ahocevar))
* [#4889](https://github.com/openlayers/ol3/pull/4889) - Use requestAnimation polyfill for examples and update release notes ([@ahocevar](https://github.com/ahocevar))
* [#4887](https://github.com/openlayers/ol3/pull/4887) - Use less aggressive DOM function overrides ([@ahocevar](https://github.com/ahocevar))
* [#4885](https://github.com/openlayers/ol3/pull/4885) - Mark overlayContainer and overlayContainerStopEvent as non-nullable ([@fredj](https://github.com/fredj))
* [#4884](https://github.com/openlayers/ol3/pull/4884) - Remove use of goog.math.isFiniteNumber() ([@fredj](https://github.com/fredj))
* [#4881](https://github.com/openlayers/ol3/pull/4881) - Update jquery to version 2.2.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#4780](https://github.com/openlayers/ol3/pull/4780) - Adapt the code for the new closure-compiler version ([@fredj](https://github.com/fredj))
* [#3453](https://github.com/openlayers/ol3/pull/3453) - Consider multi in add/remove/toggle select logic ([@bjornharrtell](https://github.com/bjornharrtell))
* [#4876](https://github.com/openlayers/ol3/pull/4876) - Add `target` property to Drag&Drop interaction ([@tsauerwein](https://github.com/tsauerwein))
* [#4854](https://github.com/openlayers/ol3/pull/4854) - Always report skipped feature hits for the original layer ([@ahocevar](https://github.com/ahocevar))
* [#4877](https://github.com/openlayers/ol3/pull/4877) - Update eslint to version 2.2.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#4870](https://github.com/openlayers/ol3/pull/4870) - Reuse dragListenerKeys_ local variable ([@fredj](https://github.com/fredj))
* [#4721](https://github.com/openlayers/ol3/pull/4721) - Fix reprojection of raster sources with gutter ([@klokantech](https://github.com/klokantech))
* [#4874](https://github.com/openlayers/ol3/pull/4874) - Assert we have a feature id ([@bartvde](https://github.com/bartvde))
* [#4869](https://github.com/openlayers/ol3/pull/4869) - Improve precision of ol.reproj.render ([@klokantech](https://github.com/klokantech))
* [#4866](https://github.com/openlayers/ol3/pull/4866) - Use requestAnimationFrame polyfill (for IE9) ([@ahocevar](https://github.com/ahocevar))
* [#4863](https://github.com/openlayers/ol3/pull/4863) - Remove use of goog.dom.createElement ([@fredj](https://github.com/fredj))
* [#4864](https://github.com/openlayers/ol3/pull/4864) - Use querySelectorAll instead of goog.dom.getElementsByClass ([@fredj](https://github.com/fredj))
* [#4597](https://github.com/openlayers/ol3/pull/4597) - Render tiles directly to the map canvas ([@ahocevar](https://github.com/ahocevar))
* [#4851](https://github.com/openlayers/ol3/pull/4851) - Don't use goog.isBoolean() ([@marcjansen](https://github.com/marcjansen))
* [#4852](https://github.com/openlayers/ol3/pull/4852) - Don't use goog.isString() ([@marcjansen](https://github.com/marcjansen))
* [#4849](https://github.com/openlayers/ol3/pull/4849) - Fix docs of LogoOptions.prototype.src ([@openlayers](https://github.com/openlayers))
* [#4794](https://github.com/openlayers/ol3/pull/4794) - Make tile loading count no longer depend on source count ([@ahocevar](https://github.com/ahocevar))
* [#4843](https://github.com/openlayers/ol3/pull/4843) - Remove use of goog.dom.getParentElement ([@fredj](https://github.com/fredj))
* [#4839](https://github.com/openlayers/ol3/pull/4839) - Add template type to ol.Collection ([@fredj](https://github.com/fredj))
* [#4847](https://github.com/openlayers/ol3/pull/4847) - Update eslint to version 2.1.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#4632](https://github.com/openlayers/ol3/pull/4632) - Overloading fill color (polygon or text) with CanvasPattern and CanvasGradient ([@bjnsn](https://github.com/bjnsn))
* [#4842](https://github.com/openlayers/ol3/pull/4842) - Remove use of goog.dom.createDom ([@fredj](https://github.com/fredj))
* [#4808](https://github.com/openlayers/ol3/pull/4808) - Type cleanup ([@fredj](https://github.com/fredj))
* [#4737](https://github.com/openlayers/ol3/pull/4737) - Use olx.format.ReadOptions in ol.interaction.DragAndDrop ([@fredj](https://github.com/fredj))
* [#4830](https://github.com/openlayers/ol3/pull/4830) - Make sure window.proj4 is always restored in tests ([@ahocevar](https://github.com/ahocevar))
* [#4838](https://github.com/openlayers/ol3/pull/4838) - Use regular expression instead of String#endsWith() check ([@ahocevar](https://github.com/ahocevar))
* [#4837](https://github.com/openlayers/ol3/pull/4837) - Update metalsmith-layouts to version 1.5.4 🚀 ([@openlayers](https://github.com/openlayers))
* [#4836](https://github.com/openlayers/ol3/pull/4836) - Use lowercase for all user agent checks ([@ahocevar](https://github.com/ahocevar))
* [#4833](https://github.com/openlayers/ol3/pull/4833) - Upgrade linter and config. ([@tschaub](https://github.com/tschaub))
* [#4831](https://github.com/openlayers/ol3/pull/4831) - Add navigation header to examples page ([@jonataswalker](https://github.com/jonataswalker))
* [#4824](https://github.com/openlayers/ol3/pull/4824) - Don't use goog.string.newlines.* ([@marcjansen](https://github.com/marcjansen))
* [#4825](https://github.com/openlayers/ol3/pull/4825) - Don't use goog.string.isEmpty ([@marcjansen](https://github.com/marcjansen))
* [#4823](https://github.com/openlayers/ol3/pull/4823) - Fix type for layers option on ol.interaction.Select ([@ahocevar](https://github.com/ahocevar))
* [#4815](https://github.com/openlayers/ol3/pull/4815) - wrapX false in synthetic examples ([@fredj](https://github.com/fredj))
* [#4810](https://github.com/openlayers/ol3/pull/4810) - Add checks for undefined in controls ([@gberaudo](https://github.com/gberaudo))
* [#4787](https://github.com/openlayers/ol3/pull/4787) - Add precision parameter for HDMS coordinate ([@pfanguin](https://github.com/pfanguin))
* [#4811](https://github.com/openlayers/ol3/pull/4811) - Make ol.style.Style a @struct ([@fredj](https://github.com/fredj))
* [#4800](https://github.com/openlayers/ol3/pull/4800) - Update phantomjs-prebuilt to version 2.1.4 🚀 ([@openlayers](https://github.com/openlayers))
* [#4792](https://github.com/openlayers/ol3/pull/4792) - Use ol.events.listen instead of ol.Observable#on ([@fredj](https://github.com/fredj))
* [#4796](https://github.com/openlayers/ol3/pull/4796) - Remove use of goog.isString() ([@marcjansen](https://github.com/marcjansen))
* [#4795](https://github.com/openlayers/ol3/pull/4795) - Cleanup after goog.array, goog.object and goog.isDef removal ([@ahocevar](https://github.com/ahocevar))
* [#4771](https://github.com/openlayers/ol3/pull/4771) - Use innerHTML instead of innerText to populate the status element ([@fredj](https://github.com/fredj))
* [#4769](https://github.com/openlayers/ol3/pull/4769) - Add opaque option to olx.source.OSMOptions ([@fredj](https://github.com/fredj))
* [#4736](https://github.com/openlayers/ol3/pull/4736) - Properly detect feature on unmanaged layer for toggle selection ([@ahocevar](https://github.com/ahocevar))
* [#4756](https://github.com/openlayers/ol3/pull/4756) - Remove VectorTile getSource re-definition of return value ([@adube](https://github.com/adube))
* [#4733](https://github.com/openlayers/ol3/pull/4733) - Avoid rendering too big and too small images for vector tiles ([@ahocevar](https://github.com/ahocevar))
* [#4754](https://github.com/openlayers/ol3/pull/4754) - Upgrade to mocha@2.4.5. ([@tschaub](https://github.com/tschaub))
* [#4750](https://github.com/openlayers/ol3/pull/4750) - Update metalsmith-layouts to version 1.4.4 🚀 ([@openlayers](https://github.com/openlayers))
* [#4751](https://github.com/openlayers/ol3/pull/4751) - Update phantomjs to version 2.1.3 🚀 ([@openlayers](https://github.com/openlayers))
* [#4741](https://github.com/openlayers/ol3/pull/4741) - Report on installed versions in Travis. ([@openlayers](https://github.com/openlayers))
* [#4742](https://github.com/openlayers/ol3/pull/4742) - Upgrade to eslint@2.0.0-beta.2. ([@tschaub](https://github.com/tschaub))
* [#4746](https://github.com/openlayers/ol3/pull/4746) - Downgrade to mocha@2.3.4. ([@tschaub](https://github.com/tschaub))
* [#4740](https://github.com/openlayers/ol3/pull/4740) - Update fs-extra to version 0.26.5 🚀 ([@openlayers](https://github.com/openlayers))
* [#4738](https://github.com/openlayers/ol3/pull/4738) - Add unit tests for ol.control.Rotate and ol.control.Zoom ([@fredj](https://github.com/fredj))
* [#4718](https://github.com/openlayers/ol3/pull/4718) - Improve raster reprojection behavior when tiles fail to load ([@klokantech](https://github.com/klokantech))
* [#4734](https://github.com/openlayers/ol3/pull/4734) - Update sinon to version 1.17.3 🚀 ([@openlayers](https://github.com/openlayers))
* [#4726](https://github.com/openlayers/ol3/pull/4726) - Update mocha to version 2.4.2 🚀 ([@openlayers](https://github.com/openlayers))
The v3.14.1 release is a patch release that addresses a few regressions in the v3.14.0 release. See the [v3.14.0 release notes](https://github.com/openlayers/ol3/releases/tag/v3.14.0) for details on upgrading from v3.13.x.
## Fixes
* [#4939](https://github.com/openlayers/ol3/pull/4939) - Fix rendering of opaque layers with opacity != 1 ([@ahocevar](https://github.com/ahocevar))
* [#4921](https://github.com/openlayers/ol3/pull/4921) - Unlisten before calling listener and bind to target by default ([@ahocevar](https://github.com/ahocevar))
The v3.14.2 release is a patch release that addresses a few regressions in the v3.14.1 release. See the [v3.14.0 release notes](https://github.com/openlayers/ol3/releases/tag/v3.14.0) for details on upgrading from v3.13.x.
## Fixes
* [#4963](https://github.com/openlayers/ol3/pull/4963) - Handle more XHR errors in the TileJSON source ([@tschaub](https://github.com/tschaub))
* [#4960](https://github.com/openlayers/ol3/pull/4960) - Simplify clipping of lower resolution regions ([@ahocevar](https://github.com/ahocevar))
The v3.15.0 release includes features and fixes from 136 pull requests since the v3.14.2 release. New features and improvements include:
* Make ol.source.Cluster more flexible by adding a geometryFunction option (#4917).
* Add new CartoDB tile source (#4926).
* Improved rendering performance for vector layers by batching polygon fill and stroke instructions (#5149).
* Make the tile cache size configurable (#4805).
* Add new ol.geom.Geometry#rotate function (#4984).
* Accept simpler forms of specifying attribution(s) for sources (#5007).
* Support zooming out for ol.interaction.DragZoom (#5031).
## Upgrade notes
### v3.15.0
#### Internet Explorer 9 support
As of this release, OpenLayers requires a `classList` polyfill for IE 9 support. See http://cdn.polyfill.io/v2/docs/features#Element_prototype_classList.
#### Immediate rendering API
Listeners for `precompose`, `render`, and `postcompose` receive an event with a `vectorContext` property with methods for immediate vector rendering. The previous geometry drawing methods have been replaced with a single `vectorContext.drawGeometry(geometry)` method. If you were using any of the following experimental methods on the vector context, replace them with `drawGeometry`:
* Removed experimental geometry drawing methods: `drawPointGeometry`, `drawLineStringGeometry`, `drawPolygonGeometry`, `drawMultiPointGeometry`, `drawMultiLineStringGeometry`, `drawMultiPolygonGeometry`, and `drawCircleGeometry` (all have been replaced with `drawGeometry`).
In addition, the previous methods for setting style parts have been replaced with a single `vectorContext.setStyle(style)` method. If you were using any of the following experimental methods on the vector context, replace them with `setStyle`:
* Removed experimental style setting methods: `setFillStrokeStyle`, `setImageStyle`, `setTextStyle` (all have been replaced with `setStyle`).
Below is an example of how the vector context might have been used in the past:
Here is an example of how you could accomplish the same with the new methods:
```js
// NEW WAY, USE THIS INSTEAD OF THE CODE ABOVE
map.on('postcompose',function(event){
event.vectorContext.setStyle(style);
event.vectorContext.drawGeometry(geometry);
});
```
A final change to the immediate rendering API is that `vectorContext.drawFeature()` calls are now "immediate" as well. The drawing now occurs synchronously. This means that any `zIndex` in a style passed to `drawFeature()` will be ignored. To achieve `zIndex` ordering, order your calls to `drawFeature()` instead.
#### Removal of `ol.DEFAULT_TILE_CACHE_HIGH_WATER_MARK`
The `ol.DEFAULT_TILE_CACHE_HIGH_WATER_MARK` define has been removed. The size of the cache can now be defined on every tile based `ol.source`:
```js
newol.layer.Tile({
source:newol.source.OSM({
cacheSize:128
})
})
```
The default cache size is `2048`.
## Full list of changes
* [#4775](https://github.com/openlayers/ol3/pull/4775) - Remove goog.math.modulo and goog.math.lerp ([@nicholas-l](https://github.com/nicholas-l))
* [#5151](https://github.com/openlayers/ol3/pull/5151) - Use fs-extra as fs, remove usage of graceful-fs ([@marcjansen](https://github.com/marcjansen))
* [#5115](https://github.com/openlayers/ol3/pull/5115) - Clarify that lineDash has no effect in IE 10 and below ([@marcjansen](https://github.com/marcjansen))
* [#5136](https://github.com/openlayers/ol3/pull/5136) - Update eslint to version 2.5.3 🚀 ([@openlayers](https://github.com/openlayers))
* [#5123](https://github.com/openlayers/ol3/pull/5123) - Update coveralls to version 2.11.9 🚀 ([@openlayers](https://github.com/openlayers))
* [#5131](https://github.com/openlayers/ol3/pull/5131) - Update phantomjs-prebuilt to version 2.1.7 🚀 ([@openlayers](https://github.com/openlayers))
* [#5122](https://github.com/openlayers/ol3/pull/5122) - Update browser support info in intro tutorial ([@probins](https://github.com/probins))
* [#5112](https://github.com/openlayers/ol3/pull/5112) - Add decimals option to format write ([@probins](https://github.com/probins))
* [#5120](https://github.com/openlayers/ol3/pull/5120) - Add tileJSON option to ol.source.TileUTFGrid ([@ahocevar](https://github.com/ahocevar))
* [#5119](https://github.com/openlayers/ol3/pull/5119) - Add ol.source.Raster events on API docs page ([@drnextgis](https://github.com/drnextgis))
* [#5116](https://github.com/openlayers/ol3/pull/5116) - Improve examples pages on mobile devices a bit ([@ahocevar](https://github.com/ahocevar))
* [#5113](https://github.com/openlayers/ol3/pull/5113) - Memory leak in ol.control.FullScreen ([@AvatharDG](https://github.com/AvatharDG))
* [#5111](https://github.com/openlayers/ol3/pull/5111) - Remove CSS filter in examples ([@fredj](https://github.com/fredj))
* [#5108](https://github.com/openlayers/ol3/pull/5108) - Remove unused ol.xml.getAttributeNodeNS function ([@fredj](https://github.com/fredj))
* [#5106](https://github.com/openlayers/ol3/pull/5106) - Get rid of goog.math.Vec2 ([@fredj](https://github.com/fredj))
* [#5096](https://github.com/openlayers/ol3/pull/5096) - Add tests for ol.source.Zoomify ([@marcjansen](https://github.com/marcjansen))
* [#5102](https://github.com/openlayers/ol3/pull/5102) - Fix typo in API docs ([@openlayers](https://github.com/openlayers))
* [#5089](https://github.com/openlayers/ol3/pull/5089) - Test for both transform coords should use roughlyEqual ([@probins](https://github.com/probins))
* [#5088](https://github.com/openlayers/ol3/pull/5088) - DEVELOPING.md: remove section on running Travis on fork ([@probins](https://github.com/probins))
* [#5087](https://github.com/openlayers/ol3/pull/5087) - assertion to check that there's a DOM node for target element ([@drnextgis](https://github.com/drnextgis))
* [#5069](https://github.com/openlayers/ol3/pull/5069) - Update jquery to version 2.2.2 🚀 ([@openlayers](https://github.com/openlayers))
* [#5082](https://github.com/openlayers/ol3/pull/5082) - Get rid of goog.log. ([@bjornharrtell](https://github.com/bjornharrtell))
* [#5079](https://github.com/openlayers/ol3/pull/5079) - Correcting a typo in the upgrade notes ([@tschaub](https://github.com/tschaub))
* [#5076](https://github.com/openlayers/ol3/pull/5076) - Update phantomjs-prebuilt to version 2.1.6 🚀 ([@openlayers](https://github.com/openlayers))
* [#5077](https://github.com/openlayers/ol3/pull/5077) - Make immediate API uniformly synchronous. ([@tschaub](https://github.com/tschaub))
* [#5072](https://github.com/openlayers/ol3/pull/5072) - Add setStyle() and drawGeometry() to the immediate rendering API. ([@tschaub](https://github.com/tschaub))
* [#5074](https://github.com/openlayers/ol3/pull/5074) - Do not rotate map canvas after composition ([@ahocevar](https://github.com/ahocevar))
* [#5071](https://github.com/openlayers/ol3/pull/5071) - correct way to determine freehand mode is enabled ([@drnextgis](https://github.com/drnextgis))
* [#5066](https://github.com/openlayers/ol3/pull/5066) - Add more getters to ol.source.Vector ([@bartvde](https://github.com/bartvde))
* [#5064](https://github.com/openlayers/ol3/pull/5064) - Fix inconsistency in geom docs ([@probins](https://github.com/probins))
* [#5063](https://github.com/openlayers/ol3/pull/5063) - Remove inappropriate information from API docs ([@drnextgis](https://github.com/drnextgis))
* [#5058](https://github.com/openlayers/ol3/pull/5058) - Note in docs that DOM renderer can also render vectors ([@probins](https://github.com/probins))
* [#5056](https://github.com/openlayers/ol3/pull/5056) - Note in docs that WebGL can render points ([@probins](https://github.com/probins))
* [#5055](https://github.com/openlayers/ol3/pull/5055) - Fix cruft on kml scale output ([@probins](https://github.com/probins))
* [#5051](https://github.com/openlayers/ol3/pull/5051) - Handle aborted tiles in ol.TileQueue ([@fredj](https://github.com/fredj))
* [#5049](https://github.com/openlayers/ol3/pull/5049) - Supported browsers all have getComputedStyle ([@marcjansen](https://github.com/marcjansen))
* [#5048](https://github.com/openlayers/ol3/pull/5048) - Add tests for ol.dom methods ([@marcjansen](https://github.com/marcjansen))
* [#5031](https://github.com/openlayers/ol3/pull/5031) - support zooming out for ol.interaction.DragZoom ([@drnextgis](https://github.com/drnextgis))
* [#5036](https://github.com/openlayers/ol3/pull/5036) - Use imgSize when provided ([@ahocevar](https://github.com/ahocevar))
* [#5020](https://github.com/openlayers/ol3/pull/5020) - Update gaze to version 1.0.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5039](https://github.com/openlayers/ol3/pull/5039) - Update fs-extra to version 0.26.6 🚀 ([@openlayers](https://github.com/openlayers))
* [#5024](https://github.com/openlayers/ol3/pull/5024) - Resize the map canvas less aggressively ([@ahocevar](https://github.com/ahocevar))
* [#5000](https://github.com/openlayers/ol3/pull/5000) - Remove use of goog.math.Size and goog.style.setBorderBoxSize ([@fredj](https://github.com/fredj))
* [#5027](https://github.com/openlayers/ol3/pull/5027) - Clarify default value of featureProjection on geometry write ([@probins](https://github.com/probins))
* [#5019](https://github.com/openlayers/ol3/pull/5019) - Update eslint to version 2.4.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5016](https://github.com/openlayers/ol3/pull/5016) - Add basic tests for ol.geom.flat.center ([@marcjansen](https://github.com/marcjansen))
* [#5015](https://github.com/openlayers/ol3/pull/5015) - Update proj4 to version 2.3.14 🚀 ([@openlayers](https://github.com/openlayers))
* [#5013](https://github.com/openlayers/ol3/pull/5013) - Fix typo in test description ([@openlayers](https://github.com/openlayers))
* [#5007](https://github.com/openlayers/ol3/pull/5007) - Accept simpler forms of specifying attribution(s) for sources. ([@marcjansen](https://github.com/marcjansen))
* [#5011](https://github.com/openlayers/ol3/pull/5011) - Add missing setProjection function to ol.VectorTile API ([@ahocevar](https://github.com/ahocevar))
* [#5010](https://github.com/openlayers/ol3/pull/5010) - Add and fix API docs for ol.events.Event stack ([@ahocevar](https://github.com/ahocevar))
* [#5006](https://github.com/openlayers/ol3/pull/5006) - Use the maintained slimerjs package ([@ahocevar](https://github.com/ahocevar))
* [#5003](https://github.com/openlayers/ol3/pull/5003) - Add 'function' jsdoc tag to ol.geom.Geometry#rotate ([@fredj](https://github.com/fredj))
* [#5002](https://github.com/openlayers/ol3/pull/5002) - Update eslint-config-openlayers to version 4.1.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#4999](https://github.com/openlayers/ol3/pull/4999) - Remove use of goog.dom.removeNode ([@fredj](https://github.com/fredj))
* [#4990](https://github.com/openlayers/ol3/pull/4990) - Add new ol.source.TileJSON#getTileJSON function ([@fredj](https://github.com/fredj))
* [#4998](https://github.com/openlayers/ol3/pull/4998) - Remove unused ol.Map#isDef function ([@fredj](https://github.com/fredj))
* [#4991](https://github.com/openlayers/ol3/pull/4991) - Do not remove listeners while dispatching event ([@ahocevar](https://github.com/ahocevar))
* [#4984](https://github.com/openlayers/ol3/pull/4984) - Add new ol.geom.Geometry#rotate function ([@fredj](https://github.com/fredj))
* [#4994](https://github.com/openlayers/ol3/pull/4994) - Add alpha default value to ol.Color array form ([@jonataswalker](https://github.com/jonataswalker))
* [#4992](https://github.com/openlayers/ol3/pull/4992) - Allow configuration of the test reporter ([@marcjansen](https://github.com/marcjansen))
* [#4988](https://github.com/openlayers/ol3/pull/4988) - Update phantomjs-prebuilt to version 2.1.5 🚀 ([@openlayers](https://github.com/openlayers))
* [#4939](https://github.com/openlayers/ol3/pull/4939) - Fix rendering of opaque layers with opacity != 1 ([@ahocevar](https://github.com/ahocevar))
* [#4938](https://github.com/openlayers/ol3/pull/4938) - Get rid of goog.dom.getFirstElementChild ([@fredj](https://github.com/fredj))
* [#4937](https://github.com/openlayers/ol3/pull/4937) - Get rid of goog.json ([@fredj](https://github.com/fredj))
* [#4936](https://github.com/openlayers/ol3/pull/4936) - Remove jquery from getfeatureinfo-layers example ([@fredj](https://github.com/fredj))
* [#4930](https://github.com/openlayers/ol3/pull/4930) - Use ADVANCED instead of ADVANCED_OPTIMIZATIONS ([@fredj](https://github.com/fredj))
* [#4917](https://github.com/openlayers/ol3/pull/4917) - Make ol.source.Cluster more flexible by adding a geometryFunction option ([@ahocevar](https://github.com/ahocevar))
* [#4918](https://github.com/openlayers/ol3/pull/4918) - Don't change the canvas size to clear it ([@fredj](https://github.com/fredj))
* [#4924](https://github.com/openlayers/ol3/pull/4924) - Update coveralls to version 2.11.8 🚀 ([@openlayers](https://github.com/openlayers))
* [#4921](https://github.com/openlayers/ol3/pull/4921) - Unlisten before calling listener and bind to target by default ([@ahocevar](https://github.com/ahocevar))
* [#4868](https://github.com/openlayers/ol3/pull/4868) - Allow to refresh a source and reload its data. ([@sebasbaumh](https://github.com/sebasbaumh))
* [#4903](https://github.com/openlayers/ol3/pull/4903) - Remove use of goog.style.getRelativePosition ([@fredj](https://github.com/fredj))
* [#4902](https://github.com/openlayers/ol3/pull/4902) - Remove use of goog.style.getClientPosition ([@fredj](https://github.com/fredj))
* [#4916](https://github.com/openlayers/ol3/pull/4916) - Fix ol.format.GeoJSON#writeFeatureObject return type ([@fredj](https://github.com/fredj))
* [#4899](https://github.com/openlayers/ol3/pull/4899) - Use ol.format.GMLBase#srsName instead of undeclared srsName_ ([@fredj](https://github.com/fredj))
The v3.15.1 release is a patch release that addresses a regression in the v3.15.0 release. See the [v3.15.0 release notes](https://github.com/openlayers/ol3/releases/tag/v3.15.0) for details on upgrading from v3.14.x.
## Fixes
* [#5190](https://github.com/openlayers/ol3/pull/5190) - Revert "Batch polygon fill and stroke instructions" ([@ahocevar](https://github.com/ahocevar))
The v3.16.0 release includes features and fixes from 95 pull requests since the v3.15.1 release. New features and improvements include:
* Add `ol.source.ImageArcGISRest` for ArcGIS REST image layer support (#3880)
* New `finishCondition` option for `ol.interaction.Draw` to control which action should finish a geometry when drawing (#5261)
* New filter API for `ol.format.WFS#writeGetFeature` for WFS queries with OGC filters (#5252)
* New `renderMode` option for `ol.layer.VectorTile` to balance between rendering performance and rendering quality (#5177)
* More flexibility for configuring attribution logos by allowing HTML elements (#5274)
* UTFGrid updates, now supporting Mapbox API v4 (#5329)
* New `condition` option for `ol.interaction.Modify` for better reliability when combining with other interactions (#5320)
In addition to these new features, the code base has been simplified and refactored in the process of removing the dependency on Closure Library and Compiler.
## Upgrade notes
#### Rendering change for tile sources
Previously, if you called `source.setUrl()` on a tile source, all currently rendered tiles would be cleared before new tiles were loaded and rendered. This clearing of the map is undesirable if you are trying to smoothly update the tiles used by a source. This behavior has now changed, and calling `source.setUrl()` (or `source.setUrls()`) will *not* clear currently rendered tiles before loading and rendering new tiles. Instead, previously rendered tiles remain rendered until new tiles have loaded and can replace them. If you want to achieve the old behavior (render a blank map before loading new tiles), you can call `source.refresh()` or you can replace the old source with a new one (using `layer.setSource()`).
#### Move of typedefs out of code and into separate file
This change should not affect the great majority of application developers, but it's possible there are edge cases when compiling application code together with the library which cause compiler errors or warnings. In this case, please raise a GitHub issue. `goog.require`s for typedefs should not be necessary.
Users compiling their code with the library should note that the following API `@typedef`s have been renamed; your code may need changing if you use these:
*`ol.format.WFS.FeatureCollectionMetadata` to `ol.WFSFeatureCollectionMetadata`
*`ol.format.WFS.TransactionResponse` to `ol.WFSTransactionResponse`
#### Removal of `opaque` option for `ol.source.VectorTile`
This option is no longer needed, so it was removed from the API.
#### XHR loading for `ol.source.TileUTFGrid`
The `ol.source.TileUTFGrid` now uses XMLHttpRequest to load UTFGrid tiles by default. This works out of the box with the v4 Mapbox API. To work with the v3 API, you must use the new `jsonp` option on the source. See the examples below for detail.
* [#5377](https://github.com/openlayers/ol3/pull/5377) - Fix link to jspdf.min.js in export-pdf example ([@fredj](https://github.com/fredj))
* [#5372](https://github.com/openlayers/ol3/pull/5372) - Update jquery to version 2.2.4 🚀 ([@openlayers](https://github.com/openlayers))
* [#5364](https://github.com/openlayers/ol3/pull/5364) - Make it so things don't flash so much when you change the tile source URL. ([@tschaub](https://github.com/tschaub))
* [#5368](https://github.com/openlayers/ol3/pull/5368) - Move WFS typedefs to typedefs.js ([@probins](https://github.com/probins))
* [#5361](https://github.com/openlayers/ol3/pull/5361) - Fix url to maki icons ([@fredj](https://github.com/fredj))
* [#5358](https://github.com/openlayers/ol3/pull/5358) - Handle multiple featureMember elements for different types (WFS format) ([@tsauerwein](https://github.com/tsauerwein))
* [#5355](https://github.com/openlayers/ol3/pull/5355) - Fix navigation-controls example description ([@fredj](https://github.com/fredj))
* [#5353](https://github.com/openlayers/ol3/pull/5353) - Add API definition to docs landing page ([@probins](https://github.com/probins))
* [#5356](https://github.com/openlayers/ol3/pull/5356) - Update rbush to version 1.4.3 🚀 ([@openlayers](https://github.com/openlayers))
* [#5354](https://github.com/openlayers/ol3/pull/5354) - Update eslint to version 2.10.2 🚀 ([@openlayers](https://github.com/openlayers))
* [#5347](https://github.com/openlayers/ol3/pull/5347) - Update eslint to version 2.10.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5344](https://github.com/openlayers/ol3/pull/5344) - Remove raster enum from test ([@probins](https://github.com/probins))
* [#5335](https://github.com/openlayers/ol3/pull/5335) - Move typedefs to separate file ([@probins](https://github.com/probins))
* [#5332](https://github.com/openlayers/ol3/pull/5332) - Warn when viewing an outdated example, and offer a redirect to latest ([@ahocevar](https://github.com/ahocevar))
* [#5339](https://github.com/openlayers/ol3/pull/5339) - Use a div instead of alert for version warning ([@ahocevar](https://github.com/ahocevar))
* [#5320](https://github.com/openlayers/ol3/pull/5320) - Add a 'condition' option to ol.interaction.Modify ([@fredj](https://github.com/fredj))
* [#5333](https://github.com/openlayers/ol3/pull/5333) - Improve code readability with better comments ([@openlayers](https://github.com/openlayers))
* [#5330](https://github.com/openlayers/ol3/pull/5330) - Fix source links, display version and warn about outdated docs ([@ahocevar](https://github.com/ahocevar))
* [#5324](https://github.com/openlayers/ol3/pull/5324) - Remove unneeded goog.provides/requires for typedefs ([@probins](https://github.com/probins))
* [#5328](https://github.com/openlayers/ol3/pull/5328) - Use Node 6 on Travis. ([@tschaub](https://github.com/tschaub))
* [#5326](https://github.com/openlayers/ol3/pull/5326) - Fix wording in tile-load-event example ([@tsauerwein](https://github.com/tsauerwein))
* [#5327](https://github.com/openlayers/ol3/pull/5327) - Update closure-util to version 1.13.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5289](https://github.com/openlayers/ol3/pull/5289) - Update fs-extra to version 0.30.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5319](https://github.com/openlayers/ol3/pull/5319) - Remove outdated fixme from framestate.js. ([@probins](https://github.com/probins))
* [#5274](https://github.com/openlayers/ol3/pull/5274) - Allow using elements in logo attribution options ([@samuellapointe](https://github.com/samuellapointe))
* [#5162](https://github.com/openlayers/ol3/pull/5162) - Improve docs/examples for loadingstrategy ([@probins](https://github.com/probins))
* [#5314](https://github.com/openlayers/ol3/pull/5314) - Update browserify to version 13.0.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5310](https://github.com/openlayers/ol3/pull/5310) - Get raster sources working again. ([@tschaub](https://github.com/tschaub))
* [#5291](https://github.com/openlayers/ol3/pull/5291) - Allow once listeners to dispatch events of same type ([@ahocevar](https://github.com/ahocevar))
* [#5309](https://github.com/openlayers/ol3/pull/5309) - Update metalsmith-layouts to version 1.6.5 🚀 ([@openlayers](https://github.com/openlayers))
* [#5052](https://github.com/openlayers/ol3/pull/5052) - Update fs-extra to version 0.26.7 🚀 ([@openlayers](https://github.com/openlayers))
* [#5306](https://github.com/openlayers/ol3/pull/5306) - Make olx.view.FitOptions.padding optional ([@gberaudo](https://github.com/gberaudo))
* [#5302](https://github.com/openlayers/ol3/pull/5302) - Remove use of goog.partial ([@fredj](https://github.com/fredj))
* [#5304](https://github.com/openlayers/ol3/pull/5304) - Update sinon to version 1.17.4 🚀 ([@openlayers](https://github.com/openlayers))
* [#5278](https://github.com/openlayers/ol3/pull/5278) - Fix invalid generics type instantiation ([@fredj](https://github.com/fredj))
* [#5044](https://github.com/openlayers/ol3/pull/5044) - Snap interaction now handle feature without geometry properly ([@fblackburn](https://github.com/fblackburn))
* [#5277](https://github.com/openlayers/ol3/pull/5277) - Type cleanup ([@fredj](https://github.com/fredj))
* [#5275](https://github.com/openlayers/ol3/pull/5275) - Fix feature-layer association on replaced selections ([@ahocevar](https://github.com/ahocevar))
* [#5252](https://github.com/openlayers/ol3/pull/5252) - Add filter option to ol.format.WFS#writeGetFeature ([@tsauerwein](https://github.com/tsauerwein))
* [#5264](https://github.com/openlayers/ol3/pull/5264) - Fix for close draw polygon error ([@matjos](https://github.com/matjos))
* [#5267](https://github.com/openlayers/ol3/pull/5267) - Use ol.functions instead of goog.functions ([@ahocevar](https://github.com/ahocevar))
* [#5261](https://github.com/openlayers/ol3/pull/5261) - add finishCondition to ol.interaction.Draw ([@giohappy](https://github.com/giohappy))
* [#5259](https://github.com/openlayers/ol3/pull/5259) - Include squash commit merges in changelog ([@ahocevar](https://github.com/ahocevar))
* [#5257](https://github.com/openlayers/ol3/pull/5257) - Add readFeatures and readProjection as MVT experimental API ([@bjornharrtell](https://github.com/bjornharrtell))
* [#5228](https://github.com/openlayers/ol3/pull/5228) - Add 'layers' option to Translate interaction ([@adube](https://github.com/adube))
* [#5221](https://github.com/openlayers/ol3/pull/5221) - Update jquery, bootstrap and proj4js in examples ([@fredj](https://github.com/fredj))
* [#5227](https://github.com/openlayers/ol3/pull/5227) - Add a temporary ol.TileCoord in ol.renderer.canvas.TileLayer ([@fredj](https://github.com/fredj))
* [#5222](https://github.com/openlayers/ol3/pull/5222) - Remove unused private variables in ol.renderer.canvas.Map ([@fredj](https://github.com/fredj))
The v3.17.0 release includes features and fixes from 60 pull requests since the v3.16.0 release. Most of the changes are bug fixes and continuing removal of the dependency on Closure Library.
## Upgrade notes
#### `ol.source.MapQuest` removal
Because of changes at MapQuest (see: https://lists.openstreetmap.org/pipermail/talk/2016-June/076106.html) we had to remove the MapQuest source for now (see https://github.com/openlayers/ol3/issues/5484 for details).
#### `ol.interaction.ModifyEvent` changes
The event object previously had a `mapBrowserPointerEvent` property, which has been renamed to `mapBrowserEvent`.
#### Removal of ol.raster namespace
Users compiling their code with the library and using types in the `ol.raster` namespace should note that this has now been removed. `ol.raster.Pixel` has been deleted, and the other types have been renamed as follows, and your code may need changing if you use these:
*`ol.raster.Operation` to `ol.RasterOperation`
*`ol.raster.OperationType` to `ol.RasterOperationType`
#### All typedefs now in ol namespace
Users compiling their code with the library should note that the following typedefs have been renamed; your code may need changing if you use these:
* ol.events.ConditionType to ol.EventsConditionType
* ol.events.EventTargetLike to ol.EventTargetLike
* ol.events.Key to ol.EventsKey
* ol.events.ListenerFunctionType to ol.EventsListenerFunctionType
* ol.interaction.DragBoxEndConditionType to ol.DragBoxEndConditionType
* ol.interaction.DrawGeometryFunctionType to ol.DrawGeometryFunctionType
* ol.interaction.SegmentDataType to ol.ModifySegmentDataType
* ol.interaction.SelectFilterFunction to ol.SelectFilterFunction
* ol.interaction.SnapResultType to ol.SnapResultType
* ol.interaction.SnapSegmentDataType to ol.SnapSegmentDataType
* ol.proj.ProjectionLike to ol.ProjectionLike
* ol.style.AtlasBlock to ol.AtlasBlock
* ol.style.AtlasInfo to ol.AtlasInfo
* ol.style.AtlasManagerInfo to ol.AtlasManagerInfo
* ol.style.CircleRenderOptions to ol.CircleRenderOptions
* ol.style.ImageOptions to ol.StyleImageOptions
* ol.style.GeometryFunction to ol.StyleGeometryFunction
* ol.style.RegularShapeRenderOptions to ol.RegularShapeRenderOptions
* ol.style.StyleFunction to ol.StyleFunction
## Full list of changes
* [#5539](https://github.com/openlayers/ol3/pull/5539) - Remove outdated comments re goog.dom ([@probins](https://github.com/probins))
* [#5543](https://github.com/openlayers/ol3/pull/5543) - Update rbush to 2.0.1 ([@tsauerwein](https://github.com/tsauerwein))
* [#5536](https://github.com/openlayers/ol3/pull/5536) - Update to layer-extent example ([@tschaub](https://github.com/tschaub))
* [#5482](https://github.com/openlayers/ol3/pull/5482) - Fix for regression in tile layer extent ([@ischneider](https://github.com/ischneider))
* [#5475](https://github.com/openlayers/ol3/pull/5475) - Remove goog.provide from enums only used internally or in olx.js ([@probins](https://github.com/probins))
* [#5424](https://github.com/openlayers/ol3/pull/5424) - Don't dispatch select event if no feature is selected or deselected ([@fredj](https://github.com/fredj))
* [#5522](https://github.com/openlayers/ol3/pull/5522) - Add 'condition' option to ol.interaction.DragPanOptions in olx.js ([@SamuelBerger](https://github.com/SamuelBerger))
* [#5497](https://github.com/openlayers/ol3/pull/5497) - Update istanbul to version 0.4.4 🚀 ([@openlayers](https://github.com/openlayers))
* [#5523](https://github.com/openlayers/ol3/pull/5523) - Update closure-util to version 1.15.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5508](https://github.com/openlayers/ol3/pull/5508) - Fix problems with ol.format.WFS in compiled mode ([@tsauerwein](https://github.com/tsauerwein))
* [#5512](https://github.com/openlayers/ol3/pull/5512) - Use forEachTileCoord name instead of forEachTileCoordInExtentAndZ ([@ahocevar](https://github.com/ahocevar))
* [#5513](https://github.com/openlayers/ol3/pull/5513) - Add getters for min and max resolution of the view ([@bartvde](https://github.com/bartvde))
* [#5471](https://github.com/openlayers/ol3/pull/5471) - Fix GPX write of xsi ns ([@probins](https://github.com/probins))
* [#5511](https://github.com/openlayers/ol3/pull/5511) - Do not optimize lines away entirely ([@ahocevar](https://github.com/ahocevar))
* [#5509](https://github.com/openlayers/ol3/pull/5509) - Make it easier to work with tile ranges in custom source implementations ([@ahocevar](https://github.com/ahocevar))
* [#5498](https://github.com/openlayers/ol3/pull/5498) - Update eslint to version 2.13.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5495](https://github.com/openlayers/ol3/pull/5495) - Get rid of goog.isFunction ([@fredj](https://github.com/fredj))
* [#5499](https://github.com/openlayers/ol3/pull/5499) - Update glob to version 7.0.5 🚀 ([@openlayers](https://github.com/openlayers))
* [#5452](https://github.com/openlayers/ol3/pull/5452) - Update eslint-config-openlayers to version 5.0.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5432](https://github.com/openlayers/ol3/pull/5432) - Remove use of goog.uri ([@bjornharrtell](https://github.com/bjornharrtell))
* [#5449](https://github.com/openlayers/ol3/pull/5449) - Make example data/ paths absolute for source view and JSFiddle ([@ahocevar](https://github.com/ahocevar))
* [#5270](https://github.com/openlayers/ol3/pull/5270) - Load erroneous image in ol.Image#load and ol.ImageTile#load ([@fredj](https://github.com/fredj))
* [#5194](https://github.com/openlayers/ol3/pull/5194) - Get rid of goog.inherits and goog.base ([@fredj](https://github.com/fredj))
* [#5427](https://github.com/openlayers/ol3/pull/5427) - Document typedefs and enums used by API symbols ([@ahocevar](https://github.com/ahocevar))
* [#5438](https://github.com/openlayers/ol3/pull/5438) - Don't make ol.format.ogc.filter.Filter inherit from ol.Object ([@fredj](https://github.com/fredj))
* [#5433](https://github.com/openlayers/ol3/pull/5433) - Update clean-css to version 3.4.17 🚀 ([@openlayers](https://github.com/openlayers))
* [#5434](https://github.com/openlayers/ol3/pull/5434) - Fix externs in closure compiler tutorial ([@tsauerwein](https://github.com/tsauerwein))
* [#5426](https://github.com/openlayers/ol3/pull/5426) - Fix icon example to anchor popup to feature location ([@frankrowe](https://github.com/frankrowe))
* [#5421](https://github.com/openlayers/ol3/pull/5421) - Correct typo in config/jsdoc/api/readme.md ([@probins](https://github.com/probins))
* [#5417](https://github.com/openlayers/ol3/pull/5417) - Update clean-css to version 3.4.16 🚀 ([@openlayers](https://github.com/openlayers))
* [#5413](https://github.com/openlayers/ol3/pull/5413) - Update clean-css to version 3.4.15 🚀 ([@openlayers](https://github.com/openlayers))
* [#5410](https://github.com/openlayers/ol3/pull/5410) - Update eslint to version 2.11.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5408](https://github.com/openlayers/ol3/pull/5408) - Update pbf to version 2.0.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5404](https://github.com/openlayers/ol3/pull/5404) - Update eslint to version 2.11.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5402](https://github.com/openlayers/ol3/pull/5402) - Pass in srsName option to writeTransaction ([@anzhihun](https://github.com/anzhihun))
* [#5393](https://github.com/openlayers/ol3/pull/5393) - Update mocha to version 2.5.3 🚀 ([@openlayers](https://github.com/openlayers))
* [#5394](https://github.com/openlayers/ol3/pull/5394) - Update resemblejs to version 2.2.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5390](https://github.com/openlayers/ol3/pull/5390) - Fix the requestEncoding automatic selection ([@fredj](https://github.com/fredj))
* [#5392](https://github.com/openlayers/ol3/pull/5392) - Update closure-util to version 1.14.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5388](https://github.com/openlayers/ol3/pull/5388) - Update mocha to version 2.5.2 🚀 ([@openlayers](https://github.com/openlayers))
The v3.17.1 release is a patch release that addresses a regression in the v3.17.0 release. See the [v3.17.0 release notes](https://github.com/openlayers/ol3/releases/tag/v3.17.0) for details on upgrading from v3.16.
## Fixes
* [#5548](https://github.com/openlayers/ol3/pull/5548) - Fix CHANGETYPE in ol.control.FullScreen ([@GaborFarkas](https://github.com/GaborFarkas))
The v3.18.0 release includes features and fixes from almost 120 pull requests since the v3.17.1 release. Most of the changes are bug fixes and continuing removal of the dependency on Closure Library. New features include:
* Addition of `Intersects` and `Within` filters to `ol.format.ogc.filter` [#5668](https://github.com/openlayers/ol3/pull/5668)
* New `overlaps` option for `ol.source.Vector` and `ol.source.VectorTile` to improve rendering performance for polygon topologies [#5196](https://github.com/openlayers/ol3/pull/5196)
* New `rotateWithView` option for `ol.style.Text` to control appearance of text on rotated views [#5050](https://github.com/openlayers/ol3/pull/5050)
* Add a `#scale()` method to `ol.geom.Geometry` and subclasses [#5685](https://github.com/openlayers/ol3/pull/5685)
* Parse `id` of features in `ol.format.MVT` [#5613](https://github.com/openlayers/ol3/pull/5613)
## Upgrade notes
#### Changes in the way assertions are handled
Previously, minified builds of the library did not have any assertions. This caused applications to fail silently or with cryptic stack traces. Starting with this release, developers get notified of many runtime errors through the new `ol.AssertionError`. This error has a `code` property. The meaning of the code can be found on http://openlayers.org/en/latest/doc/errors/. There are additional console assertion checks in debug mode when the `goog.DEBUG` compiler flag is `true`. As this is `true` by default, it is recommended that those creating custom builds set this to `false` so these assertions are stripped.'
#### Removal of `ol.ENABLE_NAMED_COLORS`
This option was previously needed to use named colors with the WebGL renderer but is no longer needed.
#### KML format now uses URL()
The URL constructor is supported by all modern browsers, but not by older ones, such as IE. To use the KML format in such older browsers, a URL polyfill will have to be loaded before use.
#### Changes only relevant to those who compile their applications together with the Closure Compiler
A number of internal types have been renamed. This will not affect those who use the API provided by the library, but if you are compiling your application together with OpenLayers and using type names, you'll need to do the following:
* rename `ol.CollectionEventType` to `ol.Collection.EventType`
* rename `ol.CollectionEvent` to `ol.Collection.Event`
* rename `ol.ViewHint` to `ol.View.Hint`
* rename `ol.ViewProperty` to `ol.View.Property`
* rename `ol.render.webgl.imagereplay.shader.Default.Locations` to `ol.render.webgl.imagereplay.defaultshader.Locations`
* rename `ol.render.webgl.imagereplay.shader.DefaultFragment` to `ol.render.webgl.imagereplay.defaultshader.Fragment`
* rename `ol.render.webgl.imagereplay.shader.DefaultVertex` to `ol.render.webgl.imagereplay.defaultshader.Vertex`
* rename `ol.renderer.webgl.map.shader.Default.Locations` to `ol.renderer.webgl.defaultmapshader.Locations`
* rename `ol.renderer.webgl.map.shader.Default.Locations` to `ol.renderer.webgl.defaultmapshader.Locations`
* rename `ol.renderer.webgl.map.shader.DefaultFragment` to `ol.renderer.webgl.defaultmapshader.Fragment`
* rename `ol.renderer.webgl.map.shader.DefaultVertex` to `ol.renderer.webgl.defaultmapshader.Vertex`
* rename `ol.renderer.webgl.tilelayer.shader.Fragment` to `ol.renderer.webgl.tilelayershader.Fragment`
* rename `ol.renderer.webgl.tilelayer.shader.Locations` to `ol.renderer.webgl.tilelayershader.Locations`
* rename `ol.renderer.webgl.tilelayer.shader.Vertex` to `ol.renderer.webgl.tilelayershader.Vertex`
* rename `ol.webgl.WebGLContextEventType` to `ol.webgl.ContextEventType`
* rename `ol.webgl.shader.Fragment` to `ol.webgl.Fragment`
* rename `ol.webgl.shader.Vertex` to `ol.webgl.Vertex`
## Full list of changes
* [#5782](https://github.com/openlayers/ol3/pull/5782) - Compare URLs in an IE compatible way ([@ahocevar](https://github.com/ahocevar))
* [#5778](https://github.com/openlayers/ol3/pull/5778) - Use Mapzen instead of openstreetmap.us tiles ([@ahocevar](https://github.com/ahocevar))
* [#5774](https://github.com/openlayers/ol3/pull/5774) - Update glob to version 7.0.6 🚀 ([@openlayers](https://github.com/openlayers))
* [#5196](https://github.com/openlayers/ol3/pull/5196) - Batch polygon and circle fills and strokes ([@ahocevar](https://github.com/ahocevar))
* [#5768](https://github.com/openlayers/ol3/pull/5768) - Enable extent clipping for vector layers ([@ahocevar](https://github.com/ahocevar))
* [#4753](https://github.com/openlayers/ol3/pull/4753) - Export ol.geom.Geometry#containsCoordinate function ([@fredj](https://github.com/fredj))
* [#5050](https://github.com/openlayers/ol3/pull/5050) - Add rotateWithView option to ol.style.Text ([@fredj](https://github.com/fredj))
* [#5767](https://github.com/openlayers/ol3/pull/5767) - Accept feature without geometry in ol.interaction.Modify ([@fredj](https://github.com/fredj))
* [#5334](https://github.com/openlayers/ol3/pull/5334) - Load the examples resources with HTTPS ([@fredj](https://github.com/fredj))
* [#5766](https://github.com/openlayers/ol3/pull/5766) - Use HTTPS to access tiles at tileserver.maptiler.com in examples ([@klokantech](https://github.com/klokantech))
* [#5765](https://github.com/openlayers/ol3/pull/5765) - Force a map render when the view is not updated ([@fredj](https://github.com/fredj))
* [#5724](https://github.com/openlayers/ol3/pull/5724) - Fix clipping of the tile layer extent on HiDPI devices ([@ahocevar](https://github.com/ahocevar))
* [#5616](https://github.com/openlayers/ol3/pull/5616) - Fix event type and documentation of ol.events.condition.mouseOnly ([@ahocevar](https://github.com/ahocevar))
* [#5755](https://github.com/openlayers/ol3/pull/5755) - Increase the size of the map in ol.layer.Tile rendering tests ([@fredj](https://github.com/fredj))
* [#5757](https://github.com/openlayers/ol3/pull/5757) - Add ol.source.Cluster#setDistance function ([@fredj](https://github.com/fredj))
* [#5752](https://github.com/openlayers/ol3/pull/5752) - Set proper replay canvas size and offset for rotated view ([@ahocevar](https://github.com/ahocevar))
* [#5754](https://github.com/openlayers/ol3/pull/5754) - Update istanbul to version 0.4.5 🚀 ([@openlayers](https://github.com/openlayers))
* [#5273](https://github.com/openlayers/ol3/pull/5273) - Take the pixelRatio into account when computing the gutter ([@fredj](https://github.com/fredj))
* [#5753](https://github.com/openlayers/ol3/pull/5753) - Update proj4 to version 2.3.15 🚀 ([@openlayers](https://github.com/openlayers))
* [#5741](https://github.com/openlayers/ol3/pull/5741) - Point to the English workshop ([@bartvde](https://github.com/bartvde))
* [#5721](https://github.com/openlayers/ol3/pull/5721) - Update metalsmith to version 2.2.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5736](https://github.com/openlayers/ol3/pull/5736) - Show `resultType` attribute in docs ([@tsauerwein](https://github.com/tsauerwein))
* [#5735](https://github.com/openlayers/ol3/pull/5735) - Update eslint to version 3.3.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5731](https://github.com/openlayers/ol3/pull/5731) - Added a pixelRatio adjust to the canvasTileLayer 'forEachLayerAtPixel… ([@Benjaki2](https://github.com/Benjaki2))
* [#5732](https://github.com/openlayers/ol3/pull/5732) - Add missing curly braces in type annotations ([@fredj](https://github.com/fredj))
* [#5728](https://github.com/openlayers/ol3/pull/5728) - Update closure-util to version 1.15.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5717](https://github.com/openlayers/ol3/pull/5717) - Update phantomjs-prebuilt to version 2.1.12 🚀 ([@openlayers](https://github.com/openlayers))
* [#5725](https://github.com/openlayers/ol3/pull/5725) - Remove tilerange assert from tilegrid/wmts ([@probins](https://github.com/probins))
* [#5723](https://github.com/openlayers/ol3/pull/5723) - Update eslint to version 3.3.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5702](https://github.com/openlayers/ol3/pull/5702) - Add rule to identify missing requires ([@tschaub](https://github.com/tschaub))
* [#5670](https://github.com/openlayers/ol3/pull/5670) - Added image data value to 'forEachLayerAtPixel' method callback ([@Benjaki2](https://github.com/Benjaki2))
* [#5720](https://github.com/openlayers/ol3/pull/5720) - Fix typo in tilegrid/wmts ([@probins](https://github.com/probins))
* [#5715](https://github.com/openlayers/ol3/pull/5715) - Create a check-example task for smarter example checking with PhantomJS ([@ahocevar](https://github.com/ahocevar))
* [#5714](https://github.com/openlayers/ol3/pull/5714) - Add FAQ entry about renderBuffer ([@tsauerwein](https://github.com/tsauerwein))
* [#5713](https://github.com/openlayers/ol3/pull/5713) - Check examples with http protocol instead of file ([@ahocevar](https://github.com/ahocevar))
* [#5689](https://github.com/openlayers/ol3/pull/5689) - Fix cursor change in translate interaction ([@pgiraud](https://github.com/pgiraud))
* [#5165](https://github.com/openlayers/ol3/pull/5165) - Remove goog.addSingletonGetter function ([@fredj](https://github.com/fredj))
* [#5701](https://github.com/openlayers/ol3/pull/5701) - Update phantomjs-prebuilt to version 2.1.11 🚀 ([@openlayers](https://github.com/openlayers))
* [#5693](https://github.com/openlayers/ol3/pull/5693) - Reorganize files so they are named like their default export ([@tschaub](https://github.com/tschaub))
* [#5694](https://github.com/openlayers/ol3/pull/5694) - layer.Base in Map not required ([@probins](https://github.com/probins))
* [#5695](https://github.com/openlayers/ol3/pull/5695) - Remove unneeded requires in renderers ([@probins](https://github.com/probins))
* [#5692](https://github.com/openlayers/ol3/pull/5692) - Small text fix ([@bngsudheer](https://github.com/bngsudheer))
* [#5682](https://github.com/openlayers/ol3/pull/5682) - Update mocha to version 3.0.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5685](https://github.com/openlayers/ol3/pull/5685) - Add a method to scale geometries ([@tschaub](https://github.com/tschaub))
* [#5674](https://github.com/openlayers/ol3/pull/5674) - Support fractional zoom levels in ol.View#getZoom and #setZoom ([@ahocevar](https://github.com/ahocevar))
* [#5681](https://github.com/openlayers/ol3/pull/5681) - Remove extra goog.require ([@fredj](https://github.com/fredj))
* [#5680](https://github.com/openlayers/ol3/pull/5680) - Update phantomjs-prebuilt to version 2.1.10 🚀 ([@openlayers](https://github.com/openlayers))
* [#5668](https://github.com/openlayers/ol3/pull/5668) - Added Intersects and Within filters into ol.format.wfs ([@cpsTinK](https://github.com/cpsTinK))
* [#5613](https://github.com/openlayers/ol3/pull/5613) - Parse MVT id property ([@drnextgis](https://github.com/drnextgis))
* [#5612](https://github.com/openlayers/ol3/pull/5612) - Update vector-tile to version 1.3.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5609](https://github.com/openlayers/ol3/pull/5609) - Update eslint to version 3.1.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5605](https://github.com/openlayers/ol3/pull/5605) - Remove goog.isObject not in assertions ([@probins](https://github.com/probins))
* [#5603](https://github.com/openlayers/ol3/pull/5603) - Update eslint to version 3.1.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5597](https://github.com/openlayers/ol3/pull/5597) - Avoid unnecessary getImageData calls in hit detection ([@schmidtk](https://github.com/schmidtk))
* [#5429](https://github.com/openlayers/ol3/pull/5429) - Remove enums from tests ([@probins](https://github.com/probins))
* [#5516](https://github.com/openlayers/ol3/pull/5516) - Remove goog.Uri from KML format ([@probins](https://github.com/probins))
* [#5598](https://github.com/openlayers/ol3/pull/5598) - Clarify that default source.Vector loader only handles features ([@probins](https://github.com/probins))
* [#5595](https://github.com/openlayers/ol3/pull/5595) - Use tile keys instead of coord keys ([@ahocevar](https://github.com/ahocevar))
* [#5594](https://github.com/openlayers/ol3/pull/5594) - Add renderBuffer option for ol.source.ImageVector ([@ahocevar](https://github.com/ahocevar))
* [#5592](https://github.com/openlayers/ol3/pull/5592) - Update coveralls to version 2.11.11 🚀 ([@openlayers](https://github.com/openlayers))
* [#5593](https://github.com/openlayers/ol3/pull/5593) - Update async to version 2.0.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#4194](https://github.com/openlayers/ol3/pull/4194) - Remove usage of goog.color and closure named colors ([@bjornharrtell](https://github.com/bjornharrtell))
* [#5583](https://github.com/openlayers/ol3/pull/5583) - Fix dead link for change event in API docs ([@ahocevar](https://github.com/ahocevar))
* [#5560](https://github.com/openlayers/ol3/pull/5560) - Get rid of goog.isArrayLike ([@fredj](https://github.com/fredj))
* [#5573](https://github.com/openlayers/ol3/pull/5573) - Determine ol.global in a way that works in more environments ([@ahocevar](https://github.com/ahocevar))
* [#5558](https://github.com/openlayers/ol3/pull/5558) - Remove goog.Uri from tests ([@probins](https://github.com/probins))
* [#5578](https://github.com/openlayers/ol3/pull/5578) - Add polyfills to copy/paste code ([@ahocevar](https://github.com/ahocevar))
* [#5577](https://github.com/openlayers/ol3/pull/5577) - Fix olx.source.OSMOptions#url default value documentation ([@fredj](https://github.com/fredj))
* [#5576](https://github.com/openlayers/ol3/pull/5576) - Use the word "documentation" ([@ahocevar](https://github.com/ahocevar))
* [#5575](https://github.com/openlayers/ol3/pull/5575) - Add a bit more info about the library to the README ([@ahocevar](https://github.com/ahocevar))
* [#5574](https://github.com/openlayers/ol3/pull/5574) - Add paragraph about supported browsers and polyfills ([@ahocevar](https://github.com/ahocevar))
* [#5570](https://github.com/openlayers/ol3/pull/5570) - Upgrade JSTS in example to 1.2.0 ([@bjornharrtell](https://github.com/bjornharrtell))
* [#5546](https://github.com/openlayers/ol3/pull/5546) - Remove useless target argument from ol.Event and subclass constructors ([@ahocevar](https://github.com/ahocevar))
* [#5565](https://github.com/openlayers/ol3/pull/5565) - Reinsert goog.provide for enums in olx.js ([@probins](https://github.com/probins))
* [#5561](https://github.com/openlayers/ol3/pull/5561) - Add unit tests for ol.View.createCenterConstraint ([@fredj](https://github.com/fredj))
* [#5563](https://github.com/openlayers/ol3/pull/5563) - Return if a vertex was removed in ol.interaction.Modify#removeVertex_ ([@fredj](https://github.com/fredj))
* [#5533](https://github.com/openlayers/ol3/pull/5533) - Make sure reprojected tiles are recreated on updateParams ([@ahocevar](https://github.com/ahocevar))
* [#5534](https://github.com/openlayers/ol3/pull/5534) - Fix ScaleLine control documentation ([@ahocevar](https://github.com/ahocevar))
* [#5550](https://github.com/openlayers/ol3/pull/5550) - Remove use of ol.vec.Mat4 calls remaining after #5482 ([@ahocevar](https://github.com/ahocevar))
* [#5507](https://github.com/openlayers/ol3/pull/5507) - Remove use of goog.vec.* ([@ahocevar](https://github.com/ahocevar))
The 3.1.0 release includes 70 merged pull requests since 3.1.0. Of note, the KML format [now parses `NetworkingLink` tags](https://github.com/openlayers/ol3/pull/3171). The [measure example](http://openlayers.org/en/v3.2.0/examples/measure.html) was [reworked](https://github.com/openlayers/ol3/pull/3206) to display measurements and help messages while drawing. A WMTS GetCapabilities format was [added](https://github.com/openlayers/ol3/pull/3026). The WebGL renderer [now supports feature hit detection](https://github.com/openlayers/ol3/pull/3065) (on point features). And you can now [detect](https://github.com/openlayers/ol3/pull/3172) features/colored pixels on image and tile layers! See the full list of [changes](#changes) below.
## Upgrade notes
The 3.2.0 release maintains a backwards-compatible API with the 3.1.0 release, so upgrades should be painless. Some special considerations below.
* You should not call `view.setRotation` with `undefined`, to reset the view rotation to `0` then use `view.setRotation(0)` (see [#3176](https://github.com/openlayers/ol3/pull/3176)).
* If you use `$(map.getViewport()).on('mousemove')` to detect features when the mouse is hovered on the map, you should now rely on the `pointermove` map event type and check in the `pointermove` listener that the `dragging` event property is `false` (see [#3190](https://github.com/openlayers/ol3/pull/3190)).
## Changes
* [#3171](https://github.com/openlayers/ol3/pull/3171) - KML: Parsing of NetworkLink tag ([@oterral](https://github.com/oterral))
* [#3208](https://github.com/openlayers/ol3/pull/3208) - Add setters and getters for imageLoadFunction ([@bartvde](https://github.com/bartvde))
* [#3019](https://github.com/openlayers/ol3/pull/3019) - Add option to allow Select interaction logic to select overlapping features ([@bjornharrtell](https://github.com/bjornharrtell))
* [#3206](https://github.com/openlayers/ol3/pull/3206) - Add tooltip to show measure + help message while drawing ([@pgiraud](https://github.com/pgiraud))
* [#3205](https://github.com/openlayers/ol3/pull/3205) - Use ol.extent.createOrUpdateFromCoordinate ([@fredj](https://github.com/fredj))
* [#3026](https://github.com/openlayers/ol3/pull/3026) - Add support of reading WMTS Get Cap document ([@htulipe](https://github.com/htulipe))
* [#3201](https://github.com/openlayers/ol3/pull/3201) - Pass on opt_fast to parent clear function in ol.source.ServerVector (r=@elemoine,@gberaudo) ([@bartvde](https://github.com/bartvde))
* [#3199](https://github.com/openlayers/ol3/pull/3199) - Minor jsdoc fixes ([@fredj](https://github.com/fredj))
* [#3059](https://github.com/openlayers/ol3/pull/3059) - Cache the buffered extent value ([@fredj](https://github.com/fredj))
* [#3179](https://github.com/openlayers/ol3/pull/3179) - Disallow undefined values for ol.layer.Base ([@fredj](https://github.com/fredj))
* [#3161](https://github.com/openlayers/ol3/pull/3161) - Doc fix. writeFeaturesNode receives an array of Feature ([@3x0dv5](https://github.com/3x0dv5))
* [#3169](https://github.com/openlayers/ol3/pull/3169) - Fix default icon style in kml format ([@oterral](https://github.com/oterral))
* [#3190](https://github.com/openlayers/ol3/pull/3190) - Introduce `dragging` flag for MapBrowserEvent ([@tsauerwein](https://github.com/tsauerwein))
* [#3135](https://github.com/openlayers/ol3/pull/3135) - Make changing the label of ZoomToExtent/FullScreen control consistent ([@tsauerwein](https://github.com/tsauerwein))
* [#3186](https://github.com/openlayers/ol3/pull/3186) - Take the pixel ratio into account when clipping the layer ([@fredj](https://github.com/fredj))
* [#3183](https://github.com/openlayers/ol3/pull/3183) - Allow other params than 'mode' in example page query string. ([@htulipe](https://github.com/htulipe))
* [#2791](https://github.com/openlayers/ol3/pull/2791) - Re enable rotation button transition ([@fredj](https://github.com/fredj))
* [#3180](https://github.com/openlayers/ol3/pull/3180) - Add a getMap function to ol.FeatureOverlay (r=@ahocevar) ([@bartvde](https://github.com/bartvde))
* [#3176](https://github.com/openlayers/ol3/pull/3176) - Disallowed undefined rotation value ([@fredj](https://github.com/fredj))
* [#3177](https://github.com/openlayers/ol3/pull/3177) - Add example showing how to style polygon vertices ([@tsauerwein](https://github.com/tsauerwein))
* [#3174](https://github.com/openlayers/ol3/pull/3174) - Use view.getRotation or view.getResolution instead of view.getState ([@fredj](https://github.com/fredj))
* [#3108](https://github.com/openlayers/ol3/pull/3108) - Support skipping features in the WebGL renderer ([@tsauerwein](https://github.com/tsauerwein))
* [#3163](https://github.com/openlayers/ol3/pull/3163) - Use the layerStatesArray property from the frameState ([@fredj](https://github.com/fredj))
* [#3159](https://github.com/openlayers/ol3/pull/3159) - Don't pass specific options to the parent constructor ([@fredj](https://github.com/fredj))
* [#3065](https://github.com/openlayers/ol3/pull/3065) - Add hit-detection support for WebGL ([@tsauerwein](https://github.com/tsauerwein))
* [#3128](https://github.com/openlayers/ol3/pull/3128) - Allow rendering of feature when download of icon failed ([@oterral](https://github.com/oterral))
* [#3156](https://github.com/openlayers/ol3/pull/3156) - Move readProjectionFrom* functions to the base classes ([@fredj](https://github.com/fredj))
* [#3107](https://github.com/openlayers/ol3/pull/3107) - Also listen on loading images ([@elemoine](https://github.com/elemoine))
* [#3114](https://github.com/openlayers/ol3/pull/3114) - Specify node version in CONTRIBUTING.md ([@elemoine](https://github.com/elemoine))
* [#3106](https://github.com/openlayers/ol3/pull/3106) - Don't pass specific options to the parent constructor ([@fredj](https://github.com/fredj))
* [#3110](https://github.com/openlayers/ol3/pull/3110) - Use svg instead of png to get better image quality ([@PeterDaveHello](https://github.com/PeterDaveHello))
* [#2707](https://github.com/openlayers/ol3/pull/2707) - Generate source map of minified ol.js ([@gberaudo](https://github.com/gberaudo))
* [#3104](https://github.com/openlayers/ol3/pull/3104) - Don't pass renderBuffer option to the parent constructor ([@fredj](https://github.com/fredj))
* [#3096](https://github.com/openlayers/ol3/pull/3096) - popup example cleanup / simplification ([@fredj](https://github.com/fredj))
* [#3072](https://github.com/openlayers/ol3/pull/3072) - Optimize canvas hit detection by rendering features in a limited extent. ([@tschaub](https://github.com/tschaub))
* [#3101](https://github.com/openlayers/ol3/pull/3101) - Use bracket notation instead of goog.object functions. ([@tschaub](https://github.com/tschaub))
* [#3079](https://github.com/openlayers/ol3/pull/3079) - Exclude source files from docs. ([@tschaub](https://github.com/tschaub))
* [#3100](https://github.com/openlayers/ol3/pull/3100) - Assert that ol.layer.Tile#getPreload is always set ([@fredj](https://github.com/fredj))
* [#3084](https://github.com/openlayers/ol3/pull/3084) - Changes from the v3.1.x branch. ([@openlayers](https://github.com/openlayers))
* [#3089](https://github.com/openlayers/ol3/pull/3089) - Fixed URL link for test README ([@mike-mcgann](https://github.com/mike-mcgann))
* [#2894](https://github.com/openlayers/ol3/pull/2894) - Simplify CSS code in custom-controls example ([@fredj](https://github.com/fredj))
* [#3085](https://github.com/openlayers/ol3/pull/3085) - Fixed documentation typo for return value of ol.proj.Projection.isGlobal(). ([@mike-mcgann](https://github.com/mike-mcgann))
* [#3073](https://github.com/openlayers/ol3/pull/3073) - Make map's deviceOptions map options ([@ahocevar](https://github.com/ahocevar))
This is a patch release that fixes a regression with the select interaction in the [3.2.0 release](https://github.com/openlayers/ol3/releases/tag/v3.2.0).
## Changes
* [#3236](https://github.com/openlayers/ol3/pull/3236) - Select the uppermost feature. ([@tschaub](https://github.com/tschaub))
* The `ol.events.condition.mouseMove` function was replaced by `ol.events.condition.pointerMove` (see [#3281](https://github.com/openlayers/ol3/pull/3281)). For example, if you use `ol.events.condition.mouseMove` as the condition in a `Select` interaction then you now need to use `ol.events.condition.pointerMove`:
```js
var selectInteraction = new ol.interaction.Select({
condition: ol.events.condition.pointerMove
// …
});
```
## Overview of all changes
* [#3263](https://github.com/openlayers/ol3/pull/3263) - Support ArcGIS Rest Services ([@cwgrant](https://github.com/cwgrant))
* [#3295](https://github.com/openlayers/ol3/pull/3295) - Add RESTful to WMTS GetCapabilities optionsFromCapabilities ([@sarametz](https://github.com/sarametz))
* [#3304](https://github.com/openlayers/ol3/pull/3304) - Remove scale line inner padding ([@fredj](https://github.com/fredj))
* [#3303](https://github.com/openlayers/ol3/pull/3303) - Add constant for us-ft units ([@ahocevar](https://github.com/ahocevar))
* [#3018](https://github.com/openlayers/ol3/pull/3018) - Add SelectEvent to interaction ([@bjornharrtell](https://github.com/bjornharrtell))
* [#3301](https://github.com/openlayers/ol3/pull/3301) - Select interaction unit tests ([@bjornharrtell](https://github.com/bjornharrtell))
* [#3298](https://github.com/openlayers/ol3/pull/3298) - Make ol.source.Source inherit from ol.Object ([@fredj](https://github.com/fredj))
* [#3297](https://github.com/openlayers/ol3/pull/3297) - Add getters to ol.source.WMTS ([@fredj](https://github.com/fredj))
* [#3281](https://github.com/openlayers/ol3/pull/3281) - Fix mouseMove event type comparison for IE10-11, pointermove ([@adube](https://github.com/adube))
* [#3293](https://github.com/openlayers/ol3/pull/3293) - Add missing opacity option for ol.style.IconOptions ([@ahocevar](https://github.com/ahocevar))
* [#3284](https://github.com/openlayers/ol3/pull/3284) - Fix jsdoc type for arrays of listening keys ([@fredj](https://github.com/fredj))
* [#3278](https://github.com/openlayers/ol3/pull/3278) - Add goog.provide for ol.DrawEventType ([@elemoine](https://github.com/elemoine))
* [#3272](https://github.com/openlayers/ol3/pull/3272) - Added getter function to return the wrapped source within the cluster ([@acanimal](https://github.com/acanimal))
* [#3275](https://github.com/openlayers/ol3/pull/3275) - Add ol.layer.Heatmap#blur getter and setter ([@fredj](https://github.com/fredj))
* [#3142](https://github.com/openlayers/ol3/pull/3142) - WMTS Get Cap document with updated WMTS.optionsFromCapabilities function ([@sarametz](https://github.com/sarametz))
* [#3270](https://github.com/openlayers/ol3/pull/3270) - Make ol.Overlay autoPan default to false ([@elemoine](https://github.com/elemoine))
* [#3268](https://github.com/openlayers/ol3/pull/3268) - Fix autoPan in examples with ol.Overlay on hover ([@tsauerwein](https://github.com/tsauerwein))
* [#3256](https://github.com/openlayers/ol3/pull/3256) - Add autoPan option to ol.Overlay ([@tsauerwein](https://github.com/tsauerwein))
* [#3254](https://github.com/openlayers/ol3/pull/3254) - Use lineCap, lineJoin and miterLimit stroke properties in RegularShape ([@fredj](https://github.com/fredj))
* [#3252](https://github.com/openlayers/ol3/pull/3252) - Avoid leaking global listenerSpy. ([@tschaub](https://github.com/tschaub))
* [#3240](https://github.com/openlayers/ol3/pull/3240) - Changes from the v3.2.x branch. ([@openlayers](https://github.com/openlayers))
* [#3233](https://github.com/openlayers/ol3/pull/3233) - Four small fixes. ([@stweil](https://github.com/stweil))
* [#3232](https://github.com/openlayers/ol3/pull/3232) - Fix typos found by codespell. ([@stweil](https://github.com/stweil))
* [#3231](https://github.com/openlayers/ol3/pull/3231) - Make ol.layer.Heatmap#radius configurable ([@fredj](https://github.com/fredj))
* [#3225](https://github.com/openlayers/ol3/pull/3225) - Respect attributions passed to TileJSON source. ([@tschaub](https://github.com/tschaub))
* [#3223](https://github.com/openlayers/ol3/pull/3223) - Resize the canvas when the tile size changes. ([@tschaub](https://github.com/tschaub))
* [#3224](https://github.com/openlayers/ol3/pull/3224) - Provide the ability to get the layer name from a MapQuest source ([@bartvde](https://github.com/bartvde))
* [#3222](https://github.com/openlayers/ol3/pull/3222) - Add geodesic option for measure ([@bartvde](https://github.com/bartvde))
* [#3221](https://github.com/openlayers/ol3/pull/3221) - Select the uppermost feature ([@fredj](https://github.com/fredj))
* [#3211](https://github.com/openlayers/ol3/pull/3211) - Bing https logo fix. ([@photostu](https://github.com/photostu))
* [#3215](https://github.com/openlayers/ol3/pull/3215) - Allow reuse of layer rendering code without creating a map. ([@tschaub](https://github.com/tschaub))
* [#3383](https://github.com/openlayers/ol3/pull/3383) - GML3 tests time out in unit tests ([@bartvde](https://github.com/bartvde))
* [#3401](https://github.com/openlayers/ol3/pull/3401) - Allow GeoJSON to be serialized according to the right-hand rule. ([@tschaub](https://github.com/tschaub))
* [#3362](https://github.com/openlayers/ol3/pull/3362) - Configure proj4 options and transforms upon construction ([@ahocevar](https://github.com/ahocevar))
* [#3394](https://github.com/openlayers/ol3/pull/3394) - Fix fullscreen pseudo CSS class name ([@fredj](https://github.com/fredj))
* [#3399](https://github.com/openlayers/ol3/pull/3399) - Clarify when widths need to be configured on a tile grid ([@ahocevar](https://github.com/ahocevar))
* [#3398](https://github.com/openlayers/ol3/pull/3398) - Make sure that the return value of wrapX() is stable ([@ahocevar](https://github.com/ahocevar))
* [#3396](https://github.com/openlayers/ol3/pull/3396) - Move the compare function out of ol.interaction.Modify.handleDownEvent_ ([@fredj](https://github.com/fredj))
* [#3392](https://github.com/openlayers/ol3/pull/3392) - Fix switching class name of full-screen control ([@tsauerwein](https://github.com/tsauerwein))
* [#3391](https://github.com/openlayers/ol3/pull/3391) - Minor code cleanup ([@fredj](https://github.com/fredj))
* [#3388](https://github.com/openlayers/ol3/pull/3388) - Add new geometry layout option for polyline format ([@fredj](https://github.com/fredj))
* [#3376](https://github.com/openlayers/ol3/pull/3376) - Add ol.source.Tile support for wrapping around the x-axis ([@ahocevar](https://github.com/ahocevar))
* [#3378](https://github.com/openlayers/ol3/pull/3378) - Clarify where to ask questions ([@ahocevar](https://github.com/ahocevar))
* [#3380](https://github.com/openlayers/ol3/pull/3380) - Test the GeoJSON layout ([@fredj](https://github.com/fredj))
* [#3360](https://github.com/openlayers/ol3/pull/3360) - Don't unlisten image twice when disposing an ol.ImageTile ([@fredj](https://github.com/fredj))
* [#3361](https://github.com/openlayers/ol3/pull/3361) - Listen on localhost to avoid phantomjs browsing 0.0.0.0 ([@ahocevar](https://github.com/ahocevar))
* [#3365](https://github.com/openlayers/ol3/pull/3365) - Better docs for #getPointResolution ([@ahocevar](https://github.com/ahocevar))
* [#3363](https://github.com/openlayers/ol3/pull/3363) - New ol.proj features ([@bill-chadwick](https://github.com/bill-chadwick))
* [#3343](https://github.com/openlayers/ol3/pull/3343) - Line arrows example ([@fredj](https://github.com/fredj))
* [#3354](https://github.com/openlayers/ol3/pull/3354) - Mark ol.format.GeoJSON#writeFeature(s) option param optional ([@fredj](https://github.com/fredj))
* [#3346](https://github.com/openlayers/ol3/pull/3346) - Set the 'properties' member to null if the feature has not properties ([@fredj](https://github.com/fredj))
* [#3344](https://github.com/openlayers/ol3/pull/3344) - Minor code cleanup ([@fredj](https://github.com/fredj))
* [#3237](https://github.com/openlayers/ol3/pull/3237) - Add circles to Draw interaction. ([@Morgul](https://github.com/Morgul))
* [#3327](https://github.com/openlayers/ol3/pull/3327) - Add css to dist directory ([@ahocevar](https://github.com/ahocevar))
* [#3324](https://github.com/openlayers/ol3/pull/3324) - Add interface definition for ol.SelectEvent ([@ahocevar](https://github.com/ahocevar))
* [#3315](https://github.com/openlayers/ol3/pull/3315) - Fix Tissot indicatrix example description ([@fredj](https://github.com/fredj))
* [#3312](https://github.com/openlayers/ol3/pull/3312) - Fix HiDPI support for ArcGIS REST ([@ahocevar](https://github.com/ahocevar))
* [#2910](https://github.com/openlayers/ol3/pull/2910) - Support multiple featureTpes in GML parser ([@bartvde](https://github.com/bartvde))
* [#3309](https://github.com/openlayers/ol3/pull/3309) - Fix select event always reporting as multi select ([@bjornharrtell](https://github.com/bjornharrtell))
* [#3307](https://github.com/openlayers/ol3/pull/3307) - Handle all non-degree units in ol.control.ScaleLine ([@ahocevar](https://github.com/ahocevar))
The 3.5.0 release includes features and fixes from a whopping 129 pull requests since 3.4.0. This release removes a number of "experimental" features from the API, so take a close look at the notes below when upgrading.
## Upgrade notes
### `ol.Object` and `bindTo`
* The following experimental methods have been removed from `ol.Object`: `bindTo`, `unbind`, and `unbindAll`. If you want to get notification about `ol.Object` property changes, you can listen for the `'propertychange'` event (e.g. `object.on('propertychange', listener)`). Two-way binding can be set up at the application level using property change listeners. See [#3472](https://github.com/openlayers/ol3/pull/3472) for details on the change.
* The experimental `ol.dom.Input` component has been removed. If you need to synchronize the state of a dom Input element with an `ol.Object`, this can be accomplished using listeners for change events. For example, you might bind the state of a checkbox type input with a layer's visibility like this:
```js
var layer = new ol.layer.Tile();
var checkbox = document.querySelector('#checkbox');
checkbox.addEventListener('change', function() {
var checked = this.checked;
if (checked !== layer.getVisible()) {
layer.setVisible(checked);
}
});
layer.on('change:visible', function() {
var visible = this.getVisible();
if (visible !== checkbox.checked) {
checkbox.checked = visible;
}
});
```
### New Vector API
* The following experimental vector classes have been removed: `ol.source.GeoJSON`, `ol.source.GML`, `ol.source.GPX`, `ol.source.IGC`, `ol.source.KML`, `ol.source.OSMXML`, and `ol.source.TopoJSON`. You now will use `ol.source.Vector` instead.
For example, if you used `ol.source.GeoJSON` as follows:
```js
var source = new ol.source.GeoJSON({
url: 'features.json',
projection: 'EPSG:3857'
});
```
you will need to change your code to:
```js
var source = new ol.source.Vector({
url: 'features.json',
format: new ol.format.GeoJSON()
});
```
See http://openlayers.org/en/master/examples/vector-layer.html for a real example.
Note that you no longer need to set a `projection` on the source!
Previously the vector data was loaded at source construction time, and, if the data projection and the source projection were not the same, the vector data was transformed to the source projection before being inserted (as features) into the source.
The vector data is now loaded at render time, when the view projection is known. And the vector data is transformed to the view projection if the data projection and the source projection are not the same.
If you still want to "eagerly" load the source you will use something like this:
```js
var source = new ol.source.Vector();
$.ajax('features.json').then(function(response) {
var geojsonFormat = new ol.format.GeoJSON();
var features = geojsonFormat.readFeatures(response,
{featureProjection: 'EPSG:3857'});
source.addFeatures(features);
});
```
The above code uses jQuery to send an Ajax request, but you can obviously use any Ajax library.
See http://openlayers.org/en/master/examples/igc.html for a real example.
* Note about KML
If you used `ol.source.KML`'s `extractStyles` or `defaultStyle` options, you will now have to set these options on `ol.format.KML` instead. For example, if you used:
```js
var source = new ol.source.KML({
url: 'features.kml',
extractStyles: false,
projection: 'EPSG:3857'
});
```
you will now use:
```js
var source = new ol.source.Vector({
url: 'features.kml',
format: new ol.format.KML({
extractStyles: false
})
});
```
* The `ol.source.ServerVector` class has been removed. If you used it, for example as follows:
See http://openlayers.org/en/master/examples/vector-osm.html for a real example.
* The experimental `ol.loadingstrategy.createTile` function has been renamed to `ol.loadingstrategy.tile`. The signature of the function hasn't changed. See http://openlayers.org/en/master/examples/vector-osm.html for an example.
### Change to `ol.style.Icon`
* When manually loading an image for `ol.style.Icon`, the image size should now be set
with the `imgSize` option and not with `size`. `size` is supposed to be used for the
size of a sub-rectangle in an image sprite.
### Support for non-square tiles
The return value of `ol.tilegrid.TileGrid#getTileSize()` will now be an `ol.Size` array instead of a number if non-square tiles (i.e. an `ol.Size` array instead of a number as `tilsSize`) are used. To always get an `ol.Size`, the new `ol.size.toSize()` was added.
### Change to `ol.interaction.Draw`
When finishing a draw, the `drawend` event is now dispatched before the feature is inserted to either the source or the collection. This change allows application code to finish setting up the feature.
### Misc.
If you compile your application together with the library and use the `ol.feature.FeatureStyleFunction` type annotation (this should be extremely rare), the type is now named `ol.FeatureStyleFunction`.
## New features and fixes
* [#3646](https://github.com/openlayers/ol3/pull/3646) - Use graceful-fs in place of fs ([@elemoine](https://github.com/elemoine))
* [#3640](https://github.com/openlayers/ol3/pull/3640) - Make make fail on requires and whitespace errors ([@elemoine](https://github.com/elemoine))
* [#3644](https://github.com/openlayers/ol3/pull/3644) - added altclick select to selectfeatures example ([@t27](https://github.com/t27))
* [#3612](https://github.com/openlayers/ol3/pull/3612) - Add ol.source.WMTS#getUrls and getRequestEncoding ([@elemoine](https://github.com/elemoine))
* [#3616](https://github.com/openlayers/ol3/pull/3616) - Add support for freehand drawing to the Draw interaction ([@ahocevar](https://github.com/ahocevar))
* [#3634](https://github.com/openlayers/ol3/pull/3634) - Remove unused local variable ([@fredj](https://github.com/fredj))
* [#3629](https://github.com/openlayers/ol3/pull/3629) - Problems with XYZ coordinates in snap interaction ([@tsauerwein](https://github.com/tsauerwein))
* [#3633](https://github.com/openlayers/ol3/pull/3633) - Add a Makefile section to .editorconfig ([@elemoine](https://github.com/elemoine))
* [#3632](https://github.com/openlayers/ol3/pull/3632) - Make host-examples target copy index.js ([@elemoine](https://github.com/elemoine))
* [#3631](https://github.com/openlayers/ol3/pull/3631) - Restore Modify interaction constructor test ([@bjornharrtell](https://github.com/bjornharrtell))
* [#3527](https://github.com/openlayers/ol3/pull/3527) - Replace pake with make? ([@elemoine](https://github.com/elemoine))
* [#3624](https://github.com/openlayers/ol3/pull/3624) - Add a one sentence summary for several exportable symbols ([@marcjansen](https://github.com/marcjansen))
* [#3621](https://github.com/openlayers/ol3/pull/3621) - Fix typo in documentation comment ([@openlayers](https://github.com/openlayers))
* [#3614](https://github.com/openlayers/ol3/pull/3614) - GML2 parser does not parse all features ([@bartvde](https://github.com/bartvde))
* [#3619](https://github.com/openlayers/ol3/pull/3619) - Add a one sentence summary for ol.geom.* exportable symbols ([@marcjansen](https://github.com/marcjansen))
* [#3618](https://github.com/openlayers/ol3/pull/3618) - Replace non-breaking space (U+00A0) with regular space (U+0020). ([@tschaub](https://github.com/tschaub))
* [#3597](https://github.com/openlayers/ol3/pull/3597) - Remove dead link in api doc ([@fredj](https://github.com/fredj))
* [#3613](https://github.com/openlayers/ol3/pull/3613) - Add a one sentence summary for ol.interaction* exportable symbols ([@marcjansen](https://github.com/marcjansen))
* [#3611](https://github.com/openlayers/ol3/pull/3611) - Improve error handling in Esri JSON format ([@bartvde](https://github.com/bartvde))
* [#3560](https://github.com/openlayers/ol3/pull/3560) - Add an example showing how to create a permalink ([@tsauerwein](https://github.com/tsauerwein))
* [#3571](https://github.com/openlayers/ol3/pull/3571) - Add wrapX support for vector layers (canvas renderer only) ([@ahocevar](https://github.com/ahocevar))
* [#3605](https://github.com/openlayers/ol3/pull/3605) - vector-esri-edit.html uses non api method ([@bartvde](https://github.com/bartvde))
* [#3602](https://github.com/openlayers/ol3/pull/3602) - Rename ol.feature.FeatureStyleFunction to ol.FeatureStyleFunction. ([@tschaub](https://github.com/tschaub))
* [#3604](https://github.com/openlayers/ol3/pull/3604) - Add charset so that zoom out button shows correctly ([@bartvde](https://github.com/bartvde))
* [#3593](https://github.com/openlayers/ol3/pull/3593) - Add /examples/index.js to .gitignore ([@fredj](https://github.com/fredj))
* [#3592](https://github.com/openlayers/ol3/pull/3592) - Remove reference to binding in Collection docs ([@probins](https://github.com/probins))
* [#3591](https://github.com/openlayers/ol3/pull/3591) - Only draw the layer if visible and inside the resolution range ([@fredj](https://github.com/fredj))
* [#3528](https://github.com/openlayers/ol3/pull/3528) - Fix memory leak when removing layers from ol.layer.Group ([@fredj](https://github.com/fredj))
* [#3549](https://github.com/openlayers/ol3/pull/3549) - Move ol.*_DURATION const to a constructor option ([@fredj](https://github.com/fredj))
* [#3586](https://github.com/openlayers/ol3/pull/3586) - Simplify dragAndDropInteraction in examples. ([@probins](https://github.com/probins))
* [#3555](https://github.com/openlayers/ol3/pull/3555) - Esri JSON support ([@bartvde](https://github.com/bartvde))
* [#3583](https://github.com/openlayers/ol3/pull/3583) - Add a one sentence summary for ol.proj.* and ol.layer.* exportable symbols ([@marcjansen](https://github.com/marcjansen))
* [#3581](https://github.com/openlayers/ol3/pull/3581) - Always show links to related API documentation. ([@tschaub](https://github.com/tschaub))
* [#3582](https://github.com/openlayers/ol3/pull/3582) - Index what the examples require. ([@tschaub](https://github.com/tschaub))
* [#3580](https://github.com/openlayers/ol3/pull/3580) - Add a one sentence summary for ol.source.* exportable symbols ([@marcjansen](https://github.com/marcjansen))
* [#3551](https://github.com/openlayers/ol3/pull/3551) - Automatically add links to API-docs in examples ([@marcjansen](https://github.com/marcjansen))
* [#3575](https://github.com/openlayers/ol3/pull/3575) - Check proj equivalence by code. ([@nd0ut](https://github.com/nd0ut))
* [#3579](https://github.com/openlayers/ol3/pull/3579) - Use HTTPS were available. ([@tschaub](https://github.com/tschaub))
* [#3558](https://github.com/openlayers/ol3/pull/3558) - Example sources in examples dir and built examples in build/examples. ([@tschaub](https://github.com/tschaub))
* [#3550](https://github.com/openlayers/ol3/pull/3550) - Reduce differences between the rendering test runner and the standard test runner. ([@tschaub](https://github.com/tschaub))
* [#3576](https://github.com/openlayers/ol3/pull/3576) - Add KML options related note the upgrade notes ([@elemoine](https://github.com/elemoine))
* [#3573](https://github.com/openlayers/ol3/pull/3573) - Modify draw interaction dispatch order ([@gberaudo](https://github.com/gberaudo))
* [#3572](https://github.com/openlayers/ol3/pull/3572) - Do not return a null tileSize ([@ahocevar](https://github.com/ahocevar))
* [#3569](https://github.com/openlayers/ol3/pull/3569) - Fix link to Bootstrap documentation ([@fredj](https://github.com/fredj))
* [#3559](https://github.com/openlayers/ol3/pull/3559) - Add support for non-square tiles ([@ahocevar](https://github.com/ahocevar))
* [#3568](https://github.com/openlayers/ol3/pull/3568) - Move extractStyles option to ol.format.KML ([@fredj](https://github.com/fredj))
* [#3562](https://github.com/openlayers/ol3/pull/3562) - Simplify .ol-zoomslider and .ol-overviewmap CSS ([@fredj](https://github.com/fredj))
* [#3565](https://github.com/openlayers/ol3/pull/3565) - Move extractStyles option to ol.format.KML ([@fredj](https://github.com/fredj))
* [#3523](https://github.com/openlayers/ol3/pull/3523) - Update proj4 version to 2.3.6 ([@fredj](https://github.com/fredj))
* [#3556](https://github.com/openlayers/ol3/pull/3556) - Minor TileUTFGrid error fix ([@klokantech](https://github.com/klokantech))
* [#3557](https://github.com/openlayers/ol3/pull/3557) - Update FastClick externs to version 1.0.6 ([@fredj](https://github.com/fredj))
* [#3517](https://github.com/openlayers/ol3/pull/3517) - Add tests for previously untested classes ([@marcjansen](https://github.com/marcjansen))
* [#3548](https://github.com/openlayers/ol3/pull/3548) - Write the error stack instead of the error itself. ([@tschaub](https://github.com/tschaub))
* [#3542](https://github.com/openlayers/ol3/pull/3542) - Generate example index and rebuild examples on source changes. ([@tschaub](https://github.com/tschaub))
* [#3530](https://github.com/openlayers/ol3/pull/3530) - external resources not correctly in inline source of example ([@bartvde](https://github.com/bartvde))
* [#3544](https://github.com/openlayers/ol3/pull/3544) - Update comments about remaining GeoJSON work. ([@tschaub](https://github.com/tschaub))
* [#3531](https://github.com/openlayers/ol3/pull/3531) - Fix PointerEventHandler exception with Overlay containing SVG and IE9 ([@mantonovic](https://github.com/mantonovic))
* [#3521](https://github.com/openlayers/ol3/pull/3521) - Remove goog.isDefAndNotNull test on ol.layer.Group#getLayers result ([@fredj](https://github.com/fredj))
* [#3481](https://github.com/openlayers/ol3/pull/3481) - Proposal for a simpler vector API ([@elemoine](https://github.com/elemoine))
* [#3472](https://github.com/openlayers/ol3/pull/3472) - Remove the experimental bindTo method from ol.Object. ([@tschaub](https://github.com/tschaub))
* [#3505](https://github.com/openlayers/ol3/pull/3505) - Add a Create Custom Builds tutorial ([@elemoine](https://github.com/elemoine))
* [#3513](https://github.com/openlayers/ol3/pull/3513) - Remove layerGroup.setLayers(null) test ([@fredj](https://github.com/fredj))
* [#3509](https://github.com/openlayers/ol3/pull/3509) - Dispatch change event even when geometry is set to null ([@pgiraud](https://github.com/pgiraud))
* [#3510](https://github.com/openlayers/ol3/pull/3510) - Use sinon.spy to ensure change event is dispatched ([@pgiraud](https://github.com/pgiraud))
* [#3413](https://github.com/openlayers/ol3/pull/3413) - Add support for generic external modules with Browserify ([@tsauerwein](https://github.com/tsauerwein))
* [#3503](https://github.com/openlayers/ol3/pull/3503) - Use vector source instead of feature overlay in snap example. ([@tschaub](https://github.com/tschaub))
* [#3488](https://github.com/openlayers/ol3/pull/3488) - Add docs for exportable symbols. ([@tschaub](https://github.com/tschaub))
* [#3441](https://github.com/openlayers/ol3/pull/3441) - Add a "Compile Application and OpenLayers 3 Together" tutorial ([@elemoine](https://github.com/elemoine))
* [#3499](https://github.com/openlayers/ol3/pull/3499) - Update to closure-util 1.4.0 ([@elemoine](https://github.com/elemoine))
* [#3494](https://github.com/openlayers/ol3/pull/3494) - Mark VectorContext @api ([@gberaudo](https://github.com/gberaudo))
* [#3409](https://github.com/openlayers/ol3/pull/3409) - AssertionError in WMTS.optionsFromCapabilities. ([@bartvde](https://github.com/bartvde))
* [#3493](https://github.com/openlayers/ol3/pull/3493) - Add image loading events to ol.source.ImageStatic ([@tsauerwein](https://github.com/tsauerwein))
* [#3490](https://github.com/openlayers/ol3/pull/3490) - Add .editorconfig and instructions on its use. ([@tschaub](https://github.com/tschaub))
* [#3489](https://github.com/openlayers/ol3/pull/3489) - Use an abstract base class instead of IVectorContext. ([@gberaudo](https://github.com/gberaudo))
* [#3467](https://github.com/openlayers/ol3/pull/3467) - Update the coveralls badge. ([@openlayers](https://github.com/openlayers))
* [#3466](https://github.com/openlayers/ol3/pull/3466) - Include coveralls code-coverage badge in README. ([@marcjansen](https://github.com/marcjansen))
* [#3457](https://github.com/openlayers/ol3/pull/3457) - Integrate istanbul for test coverage ([@marcjansen](https://github.com/marcjansen))
* [#3446](https://github.com/openlayers/ol3/pull/3446) - Add updateWhileInteracting to olx.layer.VectorOptions ([@elemoine](https://github.com/elemoine))
* [#3438](https://github.com/openlayers/ol3/pull/3438) - Parser documentation and XML readme ([@gberaudo](https://github.com/gberaudo))
The v3.6.0 release includes features and fixes from 40 pull requests since v3.5.0. To simplify the code base, there were some changes to "experimental" features. Please follow the upgrade notes to make your applications work with the latest release.
## Upgrade notes
### `ol.interaction.Draw` changes
* The `minPointsPerRing` config option has been renamed to `minPoints`. It is now also available for linestring drawing, not only for polygons.
* The `ol.DrawEvent` and `ol.DrawEventType` types were renamed to `ol.interaction.DrawEvent` and `ol.interaction.DrawEventType`. This has an impact on your code only if your code is compiled together with ol3.
### `ol.tilegrid` changes
* The `ol.tilegrid.XYZ` constructor has been replaced by a static `ol.tilegrid.createXYZ()` function. The `ol.tilegrid.createXYZ()` function takes the same arguments as the previous `ol.tilegrid.XYZ` constructor, but returns an `ol.tilegrid.TileGrid` instance.
* The internal tile coordinate scheme for XYZ sources has been changed. Previously, the `y` of tile coordinates was transformed to the coordinates used by sources by calculating `-y-1`. Now, it is transformed by calculating `height-y-1`, where height is the number of rows of the tile grid at the zoom level of the tile coordinate.
* The `widths` constructor option of `ol.tilegrid.TileGrid` and subclasses is no longer available, and it is no longer necessary to get proper wrapping at the 180° meridian. However, for `ol.tilegrid.WMTS`, there is a new option `sizes`, where each entry is an `ol.Size` with the `width` ('TileMatrixWidth' in WMTS capabilities) as first and the `height` ('TileMatrixHeight') as second entry of the array. For other tile grids, users can
now specify an `extent` instead of `widths`. These settings are used to restrict the range of tiles that sources will request.
* For `ol.source.TileWMS`, the default value of `warpX` used to be `undefined`, meaning that WMS requests with out-of-extent tile BBOXes would be sent. Now `wrapX` can only be `true` or `false`, and the new default is `true`. No application code changes should be required, but the resulting WMS requests for out-of-extent tiles will no longer use out-of-extent BBOXes, but ones that are shifted to real-world coordinates.
## New features and fixes
* [#3764](https://github.com/openlayers/ol3/pull/3764) - Add tests and implementation for intersectsExtent (ol.geom.Geometry) ([@alvinlindstam](https://github.com/alvinlindstam))
* [#3757](https://github.com/openlayers/ol3/pull/3757) - Add mapBrowserEvent as a member of ol.SelectEvent ([@bjornharrtell](https://github.com/bjornharrtell))
* [#3759](https://github.com/openlayers/ol3/pull/3759) - Mark tilegrid.createTileCoordTransform() @api ([@gberaudo](https://github.com/gberaudo))
* [#3747](https://github.com/openlayers/ol3/pull/3747) - Make tileCoordTransform a member again ([@ahocevar](https://github.com/ahocevar))
* [#3751](https://github.com/openlayers/ol3/pull/3751) - Do not rely on remote services for tests ([@ahocevar](https://github.com/ahocevar))
* [#3749](https://github.com/openlayers/ol3/pull/3749) - Fix typo in API docs ([@marcjansen](https://github.com/marcjansen))
* [#3739](https://github.com/openlayers/ol3/pull/3739) - Simplify detection of scientific notation in WKT format ([@marcjansen](https://github.com/marcjansen))
* [#3741](https://github.com/openlayers/ol3/pull/3741) - Enhance docs of arguments and return values of callbacks / filters ([@marcjansen](https://github.com/marcjansen))
* [#3740](https://github.com/openlayers/ol3/pull/3740) - Add @fires to select interaction ([@probins](https://github.com/probins))
* [#3738](https://github.com/openlayers/ol3/pull/3738) - Improve doucmentation for ol.TileUrlFunctionType ([@ahocevar](https://github.com/ahocevar))
* [#3736](https://github.com/openlayers/ol3/pull/3736) - Fix invalid example HTML markup ([@fredj](https://github.com/fredj))
* [#3735](https://github.com/openlayers/ol3/pull/3735) - Snap example: remove featureoverlay from tags ([@probins](https://github.com/probins))
* [#3732](https://github.com/openlayers/ol3/pull/3732) - Add a method to bind button bluring on mouseout/focusout ([@marcjansen](https://github.com/marcjansen))
* [#3683](https://github.com/openlayers/ol3/pull/3683) - Improve Map docs for layers and layergroups ([@probins](https://github.com/probins))
* [#3720](https://github.com/openlayers/ol3/pull/3720) - Add missing goog.provides in drawinteraction.js ([@elemoine](https://github.com/elemoine))
* [#3725](https://github.com/openlayers/ol3/pull/3725) - Document default value for olx.interaction.ModifyOptions#pixelTolerance ([@fredj](https://github.com/fredj))
* [#3722](https://github.com/openlayers/ol3/pull/3722) - Use the correct TileCoord transform function ([@ahocevar](https://github.com/ahocevar))
* [#3692](https://github.com/openlayers/ol3/pull/3692) - Updates for building on Windows using Cygwin. ([@bill-chadwick](https://github.com/bill-chadwick))
* [#3718](https://github.com/openlayers/ol3/pull/3718) - Add a assertion for renderOrder ([@tsauerwein](https://github.com/tsauerwein))
* [#3711](https://github.com/openlayers/ol3/pull/3711) - Fix and test ol.color.blend ([@marcjansen](https://github.com/marcjansen))
* [#3673](https://github.com/openlayers/ol3/pull/3673) - More control over ol.interaction.Draw, to allow e.g. square drawing ([@ahocevar](https://github.com/ahocevar))
* [#3710](https://github.com/openlayers/ol3/pull/3710) - Add more tests for ol.extent ([@marcjansen](https://github.com/marcjansen))
* [#3709](https://github.com/openlayers/ol3/pull/3709) - vector-wfs example does not work in JSFiddle ([@bartvde](https://github.com/bartvde))
* [#3699](https://github.com/openlayers/ol3/pull/3699) - Add support for scientific notation to WKT format ([@marcjansen](https://github.com/marcjansen))
* [#3696](https://github.com/openlayers/ol3/pull/3696) - Add an example for various blend modes ([@marcjansen](https://github.com/marcjansen))
* [#3697](https://github.com/openlayers/ol3/pull/3697) - Use a valid SPDX license expression ([@marcjansen](https://github.com/marcjansen))
* [#3694](https://github.com/openlayers/ol3/pull/3694) - Correct typo in upgrade-notes ([@probins](https://github.com/probins))
* [#3689](https://github.com/openlayers/ol3/pull/3689) - Fix WMTS.optionsFromCapabilities if no OperationsMetadata section ([@probins](https://github.com/probins))
* [#3688](https://github.com/openlayers/ol3/pull/3688) - Add two missing properties to extern of WebGLContextAttributes ([@fredj](https://github.com/fredj))
* [#3682](https://github.com/openlayers/ol3/pull/3682) - Add a note about using the collection in addLayer ([@bartvde](https://github.com/bartvde))
* [#3649](https://github.com/openlayers/ol3/pull/3649) - More specific regex in serve.js ([@elemoine](https://github.com/elemoine))
* [#3677](https://github.com/openlayers/ol3/pull/3677) - Add metadata to examples, ([@tschaub](https://github.com/tschaub))
* [#3672](https://github.com/openlayers/ol3/pull/3672) - Add link to FAQ-document and fix internal links ([@marcjansen](https://github.com/marcjansen))
* [#3665](https://github.com/openlayers/ol3/pull/3665) - Add proj4js and projection definition files to example resources ([@marcjansen](https://github.com/marcjansen))
* [#3662](https://github.com/openlayers/ol3/pull/3662) - Clarify docs for renderBuffer option ([@tsauerwein](https://github.com/tsauerwein))
* [#3664](https://github.com/openlayers/ol3/pull/3664) - Link to download page. ([@tschaub](https://github.com/tschaub))
* [#3639](https://github.com/openlayers/ol3/pull/3639) - Add extent support to ol.tilegrid.TileGrid ([@ahocevar](https://github.com/ahocevar))
* [#3663](https://github.com/openlayers/ol3/pull/3663) - Readme should not include the version number. ([@tschaub](https://github.com/tschaub))
The v3.7.0 release includes features and fixes from 43 pull requests since v3.6.0. To simplify the code base, there were some changes to "experimental" features. Please follow the upgrade notes to make your applications work with the latest release.
## Upgrade notes
#### Removal of `ol.FeatureOverlay`
Instead of an `ol.FeatureOverlay`, we now use an `ol.layer.Vector` with an
With the removal of `ol.FeatureOverlay`, `zIndex` symbolizer properties of overlays are no longer stacked per map, but per layer/overlay. If you previously had multiple feature overlays where you controlled the rendering order of features by using `zIndex` symbolizer properties, you can now achieve the same rendering order only if all overlay features are on the same layer.
Note that `ol.FeatureOverlay#getFeatures()` returned an `{ol.Collection.<ol.Feature>}`, whereas `ol.source.Vector#getFeatures()` returns an `{Array.<ol.Feature>}`.
#### `ol.TileCoord` changes
Until now, the API exposed two different types of `ol.TileCoord` tile coordinates: internal ones that increase left to right and upward, and transformed ones that may increase downward, as defined by a transform function on the tile grid. With this change, the API now only exposes tile coordinates that increase left to right and upward.
Previously, tile grids created by OpenLayers either had their origin at the top-left or at the bottom-left corner of the extent. To make it easier for application developers to transform tile coordinates to the common XYZ tiling scheme, all tile grids that OpenLayers creates internally have their origin now at the top-left corner of the extent.
This change affects applications that configure a custom `tileUrlFunction` for an `ol.source.Tile`. Previously, the `tileUrlFunction` was called with rather unpredictable tile coordinates, depending on whether a tile coordinate transform took place before calling the `tileUrlFunction`. Now it is always called with OpenLayers tile coordinates. To transform these into the common XYZ tiling scheme, a custom `tileUrlFunction` has to change the `y` value (tile row) of the `ol.TileCoord`:
The `ol.tilegrid.TileGrid#createTileCoordTransform()` function which could be used to get the tile grid's tile coordinate transform function has been removed. This function was confusing and should no longer be needed now that application developers get tile coordinates in a known layout.
The code snippets below show how your application code needs to be changed:
Old application code (with `ol.tilegrid.TileGrid#createTileCoordTransform()`):
The replacement of `ol.tilegrid.Zoomify` is a plain `ol.tilegrid.TileGrid`, configured with `extent`, `origin` and `resolutions`. If the `size` passed to the `ol.source.Zoomify` source is `[width, height]`, then the extent for the tile grid will be `[0, -height, width, 0]`, and the origin will be `[0, 0]`.
#### Replace `ol.View.fitExtent()` and `ol.View.fitGeometry()` with `ol.View.fit()`
* This combines two previously distinct functions into one more flexible call which takes either a geometry or an extent.
* Rename all calls to `fitExtent` and `fitGeometry` to `fit`.
#### Change to `ol.interaction.Modify`
When single clicking a line or boundary within the `pixelTolerance`, a vertex is now created.
## New features and fixes
* [#3867](https://github.com/openlayers/ol3/pull/3867) - Do not require projection extent for x-wrapping tile sources ([@ahocevar](https://github.com/ahocevar))
* [#3635](https://github.com/openlayers/ol3/pull/3635) - Create vertex on boundary single click ([@bjornharrtell](https://github.com/bjornharrtell))
* [#3806](https://github.com/openlayers/ol3/pull/3806) - Do not clip canvas for vector layers when wrapping the world ([@ahocevar](https://github.com/ahocevar))
* [#3461](https://github.com/openlayers/ol3/pull/3461) - High level Modify interaction events ([@bjornharrtell](https://github.com/bjornharrtell))
* [#3864](https://github.com/openlayers/ol3/pull/3864) - Check projection.canWrapX() before wrapping tiles ([@klokantech](https://github.com/klokantech))
* [#3863](https://github.com/openlayers/ol3/pull/3863) - Handle CDATA in attribute parsing for GML format ([@nhambletCCRI](https://github.com/nhambletCCRI))
* [#3860](https://github.com/openlayers/ol3/pull/3860) - Update example layout. ([@tschaub](https://github.com/tschaub))
* [#3861](https://github.com/openlayers/ol3/pull/3861) - Don't force 'dom' renderer ([@openlayers](https://github.com/openlayers))
* [#3855](https://github.com/openlayers/ol3/pull/3855) - Adding an example with WMTS tiles from IGN Geoportail ([@pgiraud](https://github.com/pgiraud))
* [#3856](https://github.com/openlayers/ol3/pull/3856) - ol.source.TileVector(): bind success function of tileLoadFunction to source ([@plepe](https://github.com/plepe))
* [#3848](https://github.com/openlayers/ol3/pull/3848) - Check for exports before define. ([@tschaub](https://github.com/tschaub))
* [#3845](https://github.com/openlayers/ol3/pull/3845) - Prevent null array to be passed to an ol.Collection ([@fredj](https://github.com/fredj))
* [#3849](https://github.com/openlayers/ol3/pull/3849) - Pad min. and sec. with leading zeros in DMS notation ([@pgiraud](https://github.com/pgiraud))
* [#3842](https://github.com/openlayers/ol3/pull/3842) - Adding a feature-animation example ([@pgiraud](https://github.com/pgiraud))
* [#3833](https://github.com/openlayers/ol3/pull/3833) - Enable use of custom XHR loader for TileVector sources ([@bjornharrtell](https://github.com/bjornharrtell))
* [#3834](https://github.com/openlayers/ol3/pull/3834) - ArcGIS tiled example broken in Chrome ([@bartvde](https://github.com/bartvde))
* [#3828](https://github.com/openlayers/ol3/pull/3828) - Fix typo in upgrade notes ([@ahocevar](https://github.com/ahocevar))
* [#3826](https://github.com/openlayers/ol3/pull/3826) - Allow custom tileGrid in ol.source.XYZ ([@klokantech](https://github.com/klokantech))
* [#3815](https://github.com/openlayers/ol3/pull/3815) - Simplify tilegrid API and internals ([@ahocevar](https://github.com/ahocevar))
* [#3820](https://github.com/openlayers/ol3/pull/3820) - Make unmanaged vector layers behave more like ol.FeatureOverlay ([@ahocevar](https://github.com/ahocevar))
* [#3822](https://github.com/openlayers/ol3/pull/3822) - Correct docs for updateWhileInteracting ([@probins](https://github.com/probins))
* [#3818](https://github.com/openlayers/ol3/pull/3818) - Make geometry.transform api stable again. ([@probins](https://github.com/probins))
* [#3801](https://github.com/openlayers/ol3/pull/3801) - Respect the tile grid's extent in ol.source.TileVector ([@ahocevar](https://github.com/ahocevar))
* [#3810](https://github.com/openlayers/ol3/pull/3810) - Improve TileGrid documentation and examples ([@ahocevar](https://github.com/ahocevar))
* [#3808](https://github.com/openlayers/ol3/pull/3808) - Correct typo in OverlayOptions ([@probins](https://github.com/probins))
* [#3766](https://github.com/openlayers/ol3/pull/3766) - Add a clickTolerance option to the Draw interaction ([@elemoine](https://github.com/elemoine))
* [#3804](https://github.com/openlayers/ol3/pull/3804) - Remove sentence that was only meant for WMTS tile grids ([@ahocevar](https://github.com/ahocevar))
* [#3800](https://github.com/openlayers/ol3/pull/3800) - Remove further references to FeatureOverlay ([@probins](https://github.com/probins))
* [#3780](https://github.com/openlayers/ol3/pull/3780) - Only expose transformed tile coordinates to the API ([@ahocevar](https://github.com/ahocevar))
* [#3793](https://github.com/openlayers/ol3/pull/3793) - Use 'managed' instead of 'unmanaged' in LayerState ([@ahocevar](https://github.com/ahocevar))
* [#3792](https://github.com/openlayers/ol3/pull/3792) - Link to correct layer base class ([@marcjansen](https://github.com/marcjansen))
* [#3758](https://github.com/openlayers/ol3/pull/3758) - Removal of ol.FeatureOverlay ([@ahocevar](https://github.com/ahocevar))
* [#3775](https://github.com/openlayers/ol3/pull/3775) - Add ol-touch but keep ol-viewport className. ([@pgiraud](https://github.com/pgiraud))
* [#3713](https://github.com/openlayers/ol3/pull/3713) - Add missing propertyNames member for olx.format.WFSWriteGetFeatureOptions ([@bartvde](https://github.com/bartvde))
The v3.8.0 release includes features and fixes from 33 pull requests since v3.7.0. While summer vacations have slowed the pace of development a bit this month, there are some nice improvements in this release. See the complete list below for details.
* [#3214](https://github.com/openlayers/ol3/pull/3214) - Pixel manipulation with raster sources. ([@tschaub](https://github.com/tschaub))
* [#3946](https://github.com/openlayers/ol3/pull/3946) - Fix vertex deletion for Modify interaction on mobile devices. ([@Turbo87](https://github.com/Turbo87))
* [#3910](https://github.com/openlayers/ol3/pull/3910) - Do not provide an AMD environment to ol.ext modules. ([@ahocevar](https://github.com/ahocevar))
* [#3934](https://github.com/openlayers/ol3/pull/3934) - Fix `drawstart` and `drawend` events when drawing a point ([@fredj](https://github.com/fredj))
* [#3945](https://github.com/openlayers/ol3/pull/3945) - Simplify icon example and show popup at clicked position ([@ahocevar](https://github.com/ahocevar))
* [#3930](https://github.com/openlayers/ol3/pull/3930) - Use goog.functions.identity instead of goog.identityFunction ([@fredj](https://github.com/fredj))
* [#3929](https://github.com/openlayers/ol3/pull/3929) - Expand description for XYZ source ([@probins](https://github.com/probins))
* [#3933](https://github.com/openlayers/ol3/pull/3933) - Snap center to pixel to avoid floating point issues ([@ahocevar](https://github.com/ahocevar))
* [#3932](https://github.com/openlayers/ol3/pull/3932) - SnapOptions: Fix typo in pixelTolerance JSDoc ([@Turbo87](https://github.com/Turbo87))
* [#3906](https://github.com/openlayers/ol3/pull/3906) - Clear features properly when there is no spatial index ([@ahocevar](https://github.com/ahocevar))
* [#3896](https://github.com/openlayers/ol3/pull/3896) - Fire WebGL precompose event in same sequence as other renderers ([@ahocevar](https://github.com/ahocevar))
* [#3359](https://github.com/openlayers/ol3/pull/3359) - Enable deep clone of MultiPolygon. ([@Kenny806](https://github.com/Kenny806))
* [#3895](https://github.com/openlayers/ol3/pull/3895) - Rework the tile queue for multiple queues. ([@aisaacs](https://github.com/aisaacs))
* [#3894](https://github.com/openlayers/ol3/pull/3894) - Install Python dependencies without sudo. ([@tschaub](https://github.com/tschaub))
* [#3824](https://github.com/openlayers/ol3/pull/3824) - Improve docs for interaction.Select. ([@probins](https://github.com/probins))
* [#3884](https://github.com/openlayers/ol3/pull/3884) - Provide a debug loader for the library. ([@tschaub](https://github.com/tschaub))
* [#3883](https://github.com/openlayers/ol3/pull/3883) - Ignore layer filter for unmanaged layers ([@ahocevar](https://github.com/ahocevar))
* [#3859](https://github.com/openlayers/ol3/pull/3859) - Add in crossOrigin option ([@llambanna](https://github.com/llambanna))
* [#3873](https://github.com/openlayers/ol3/pull/3873) - Correct minor typo in modifyinteraction ([@probins](https://github.com/probins))
* [#3872](https://github.com/openlayers/ol3/pull/3872) - Correct event notations in ol.Feature ([@probins](https://github.com/probins))
The v3.9.0 release includes features and fixes from 62 pull requests since the v3.8.2 release. New features include:
* [#3986](https://github.com/openlayers/ol3/pull/3986) - Modify 'url' option of ol.source.Vector to accept a function ([@alvinlindstam](https://github.com/alvinlindstam))
* [#4069](https://github.com/openlayers/ol3/pull/4069) - Add Z-index to layers ([@gberaudo](https://github.com/gberaudo))
* [#4008](https://github.com/openlayers/ol3/pull/4008) - Add a Translate interaction ([@elemoine](https://github.com/elemoine))
See the complete list below for details. And see the following notes to know how to upgrade from v3.8.x to v3.9.0.
## Upgrade notes
#### `ol.style.Circle` changes
The experimental `getAnchor`, `getOrigin`, and `getSize` methods have been removed. The anchor and origin of a circle symbolizer are not modifiable, so these properties should not need to be accessed. The radius and stroke width can be used to calculate the rendered size of a circle symbolizer if needed:
* [#4064](https://github.com/openlayers/ol3/pull/4064) - Use a private variable to cache the default style array ([@fredj](https://github.com/fredj))
* [#4081](https://github.com/openlayers/ol3/pull/4081) - Update link to workshop. ([@tschaub](https://github.com/tschaub))
* [#4062](https://github.com/openlayers/ol3/pull/4062) - Remove ol.xml.makeParsersNS and use ol.xml.makeStructureNS instead ([@fredj](https://github.com/fredj))
* [#3986](https://github.com/openlayers/ol3/pull/3986) - Modify 'url' option of ol.source.Vector to accept a function ([@alvinlindstam](https://github.com/alvinlindstam))
* [#4059](https://github.com/openlayers/ol3/pull/4059) - Clarify drag interaction example to inform about ol.interaction.Translate ([@alvinlindstam](https://github.com/alvinlindstam))
* [#4069](https://github.com/openlayers/ol3/pull/4069) - Add Z-index to layers ([@gberaudo](https://github.com/gberaudo))
* [#4076](https://github.com/openlayers/ol3/pull/4076) - Add assertion for required option 'code' on ol.proj.Projection ([@weskamm](https://github.com/weskamm))
* [#4075](https://github.com/openlayers/ol3/pull/4075) - setOpacity of Image undefined ([@bartvde](https://github.com/bartvde))
* [#4073](https://github.com/openlayers/ol3/pull/4073) - Better type definition ([@fredj](https://github.com/fredj))
* [#4072](https://github.com/openlayers/ol3/pull/4072) - Update to closure-util 1.7.0 ([@elemoine](https://github.com/elemoine))
* [#4070](https://github.com/openlayers/ol3/pull/4070) - Make the debug server work regardless of the current working directory. ([@tschaub](https://github.com/tschaub))
* [#4067](https://github.com/openlayers/ol3/pull/4067) - Fix bootstrap class name in examples ([@fredj](https://github.com/fredj))
* [#4050](https://github.com/openlayers/ol3/pull/4050) - Use view.getRotation and view.getResolution instead of view.getState ([@fredj](https://github.com/fredj))
* [#4051](https://github.com/openlayers/ol3/pull/4051) - Move wrench node package to devDependencies ([@fredj](https://github.com/fredj))
* [#4002](https://github.com/openlayers/ol3/pull/4002) - Update closure-library to latest commit ([@fredj](https://github.com/fredj))
* [#4018](https://github.com/openlayers/ol3/pull/4018) - Fix rotate buttons in animation example ([@marcjansen](https://github.com/marcjansen))
* [#4013](https://github.com/openlayers/ol3/pull/4013) - Use a more recent version of marked ([@marcjansen](https://github.com/marcjansen))
* [#4017](https://github.com/openlayers/ol3/pull/4017) - Do not overwrite projections in the registry simply by using `new ol.proj.Projection()` ([@ahocevar](https://github.com/ahocevar))
* [#4008](https://github.com/openlayers/ol3/pull/4008) - Add a Translate interaction ([@elemoine](https://github.com/elemoine))
* [#3230](https://github.com/openlayers/ol3/pull/3230) - Add stroke to default editing style for geometry collections ([@pgiraud](https://github.com/pgiraud))
* [#4007](https://github.com/openlayers/ol3/pull/4007) - Do not use Function.prototype.bind in examples ([@elemoine](https://github.com/elemoine))
* [#3993](https://github.com/openlayers/ol3/pull/3993) - Replace base symbols with overridden ones when generating info.json ([@ahocevar](https://github.com/ahocevar))
* [#3992](https://github.com/openlayers/ol3/pull/3992) - Fix typo in Makefile ([@fredj](https://github.com/fredj))
* [#3989](https://github.com/openlayers/ol3/pull/3989) - Handle JSONP errors in ol.source.TileJSON ([@fredj](https://github.com/fredj))
* [#3983](https://github.com/openlayers/ol3/pull/3983) - Remove doc footer with timestamp. ([@tschaub](https://github.com/tschaub))
* [#3984](https://github.com/openlayers/ol3/pull/3984) - Style source control links in examples. ([@tschaub](https://github.com/tschaub))
* [#3982](https://github.com/openlayers/ol3/pull/3982) - Rebuild examples if package.json changes. ([@tschaub](https://github.com/tschaub))
This example uses OpenLayers v<span>{{ olVersion }}</span>. The <aid="latest-link"href="#"class="alert-link">latest</a> is v<spanid="latest-version"></span>.
</div>
<divclass="row-fluid">
<divclass="span12">
<h4id="title">{{ title }}</h4>
{{{ contents }}}
</div>
</div>
<divclass="row-fluid">
<divclass="span12">
<pid="shortdesc">{{ shortdesc }}</p>
<divid="docs">{{ md docs }}</div>
<divid="api-links">Related API documentation: {{{ js.apiHtml }}}</div>
This folder contains example templates. These templates are used to build the examples in the `examples/` folder. The resulting examples are written to the `build/examples` folder.
Although the main purpose of these examples is to demonstrate how to use the API, they also serve other purposes in the development cycle, and so are not exactly as they would be in normal application code:
* every time the library changes, they are compiled together with the library as a basic check that they remain in sync with the library
* they use a special loader script to enable defining at run time which build mode (raw/debug/advanced) to use
To enable this, examples have the following, not needed in application code:
* each html file loads `loader.js`; application code would not need this, but would instead load the appropriate library build file, either a hosted version or a custom build
* each js file starts with `goog.require` functions, used by the compiler; application code would only have these if the code is to be compiled together with the library and/or Closure library
* some js files use type definitions (comments with @type tags); these are also used by the compiler, and are only needed if the code is to be compiled together with the library
* html files load `resources/common.js` and some scripts use `common.getRendererFromQueryString()` to set the map renderer; application code would not need these
At the bottom of each example generated in the `build/examples` folder, a modified version of its source code is shown. That modified version can be run standalone and is usually used as starting point for users to extend examples into their own application.
<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>[Objects](ol.Object.html) can be kept in sync using the [bindTo()](ol.Object.html#bindTo) method.</p>
<p>A [DOM Input](ol.dom.Input.html) class is available to bind Object properties to HTML Input elements.</p></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.ObjectEvent](ol.ObjectEvent.html) with information on the changed property and old value.</p>
API elements marked as `experimental` provide stable and functioning code, but may change.
Any changes will be documented in upgrade notes so application code can be changed appropriately
before using the new version of the library. All other API elements will remain compatible throughout the 3.x releases so that no changes to existing application code are necessary when upgrading to a later version.
*Note*: The API change policy does not cover CSS class names that are used to theme the
OpenLayers UI.
*Note for Closure Compiler users compiling their application code together with OpenLayers*:
The names of types other than those in the list above (e.g. `ol.Pixel`) are subject to change. It
is therefore recommended to either use the resolved type as listed in the API docs (e.g.
`Array.<number>` instead of `ol.Pixel`), or pay attention to the upgrade notes, which will list
@@ -24,6 +24,8 @@ The second line tells the Closure compiler the type of the argument.
The third line (`@api`) marks the method as part of the api and thus exportable. The stability can be added as value, e.g. `@api stable`. Without such an api annotation, the method will not be documented in the generated API documentation. Symbols without an api annotation will also not be exportable (unless they are explicitly exported with a `goog.exportProperty` call).
The `@api` annotation can be used in conjunction with the `@inheritDoc` annotation to export a symbol that is documented on a parent class (where the method may be abstract). In general, `@api` annotations should never be used on abstract methods (only on their implementations).
### Events
Events are documented using `@fires` and `@event` annotations:
This documentation is for OpenLayers v<span id="package-version"><?js= version ?></span>. The <a id="latest-link" href="#" class="alert-link">latest</a> is v<span id="latest-version"></span>.
</div>
<?js= content ?>
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc <?js= env.version.number ?></a> on <?js= (new Date()) ?>
Certain questions arise more often than others when users ask for help. This
document tries to list some of the common questions that frequently get asked,
e.g. on [Stack Overflow](http://stackoverflow.com/questions/tagged/openlayers-3).
If you think a question (and naturally its answer) should be added here, feel
free to ping us or to send a pull request enhancing this document.
Table of contents:
* [What projection is OpenLayers using?](#what-projection-is-openlayers-using-)
* [How do I change the projection of my map?](#how-do-i-change-the-projection-of-my-map-)
* [Why is my map centered on the gulf of guinea (or africa, the ocean, null-island)?](#why-is-my-map-centered-on-the-gulf-of-guinea-or-africa-the-ocean-null-island-)
* [Why is the order of a coordinate [lon,lat], and not [lat,lon]?](#why-is-the-order-of-a-coordinate-lon-lat-and-not-lat-lon-)
* [Why aren't there any features in my source?](#why-aren-t-there-any-features-in-my-source-)
* [How do I force a re-render of the map?](#how-do-i-force-a-re-render-of-the-map-)
* [Why are my features not found?](#why-are-my-features-not-found-)
* [How do I create a custom build of OpenLayers?](#how-do-i-create-a-custom-build-of-openlayers-)
* [Do I need to write my own code using Closure library?](#do-i-need-to-write-my-own-code-using-closure-library-)
* [Do I need to compress my code with Closure compiler?](#do-i-need-to-compress-my-code-with-closure-compiler-)
## What projection is OpenLayers using?
Every map that you'll create with OpenLayers will have a view, and every view
will have a projection. As the earth is three-dimensional and round but the 2D
view of a map isn't, we need a mathematical expression to represent it. Enter
projections.
There isn't only one projection, but there are many common ones. Each projection
has different properties, in that it accurately represents distances, angles or
areas. Certain projections are better suited for different regions in the world.
Back to the original question: OpenLayers is capable of dealing with most
projections. If you do not explicitly set one, your map is going to use our
default which is the Web Mercator projection (EPSG:3857). The same projection is
used e.g. for the maps of the OpenStreetMap-project and commercial products such
as Bing Maps or Google Maps.
This projection is a good choice if you want a map which shows the whole world,
and you may need to have this projection if you want to e.g. use the
OpenStreetMap or Bing tiles.
## How do I change the projection of my map?
There is a good chance that you want to change the default projection of
OpenLayers to something more appropriate for your region or your specific data.
The projection of your map can be set through the `view`-property. Here are some
examples:
```javascript
// OpenLayers comes with support for the World Geodetic System 1984, EPSG:4326:
varmap=newol.Map({
view:newol.View({
projection:'EPSG:4326'
// other view properties like map center etc.
})
// other properties for your map like layers etc.
});
```
```javascript
// To use other projections, you have to register the projection in OpenLayers:
//
// By default OpenLayers does not know about the EPSG:21781 (Swiss) projection.
// So we create a projection instance for EPSG:21781 and pass it to
// ol.proj.addProjection to make it available to the library for lookup by its
// code.
varswissProjection=newol.proj.Projection({
code:'EPSG:21781',
// The extent is used to determine zoom level 0. Recommended values for a
// projection's validity extent can be found at http://epsg.io/.
As they are by convention drawn with west on the left and north at the top,
this means that `x` represents longitude, and `y` latitude. As stated above,
OpenLayers is designed to handle all projections, but the default view is in
projected Cartesian coordinates. It would make no sense to have duplicate
functions to handle coordinates in both the Cartesian `x,y` and `lat,lon`
systems, so the degrees of latitude and longitude should be entered as though
they were Cartesian, in other words, they are `lon,lat`.
If you have difficulty remembering which way round it is, use the language code
for English, `en`, as a mnemonic: East before North.
#### A practical example
So you want to center your map on a certain place on the earth and obviously you
need to have its coordinates for this. Let's assume you want your map centered
on Schladming, a beautiful place in Austria. Head over to the wikipedia
page for [Schladming](http://en.wikipedia.org/wiki/Schladming). In the top-right
corner there is a link to [GeoHack](http://tools.wmflabs.org/geohack/geohack.php?pagename=Schladming¶ms=47_23_39_N_13_41_21_E_type:city(4565)_region:AT-6),
which effectively tells you the coordinates are:
WGS84:
47° 23′ 39″ N, 13° 41′ 21″ E
47.394167, 13.689167
So the next step would be to put the decimal coordinates into an array and use
@@ -9,6 +9,14 @@ If you're eager to get your first OpenLayers 3 map on a page, dive into the [qui
For a more in-depth overview of OpenLayers 3 core concepts, check out the [tutorials](tutorials/).
Make sure to also check out the [OpenLayers 3 workshop](../../../ol3-workshop/).
Make sure to also check out the [OpenLayers 3 workshop](/workshop/en/).
Find additional reference material in the [API docs](../apidoc).
# Frequently Asked Questions (FAQ)
We have put together a document that lists [Frequently Asked Questions (FAQ)](faq.html) and our answers. Common problems that may arise when using OpenLayers 3 are explained there, and chances are you'll find an appropriate solution in this document.
# More questions?
If you cannot find an answer in the documentation or the FAQ, you can ask your question on [stackoverflow using the tag 'openlayers-3'](http://stackoverflow.com/questions/tagged/openlayers-3).
@@ -60,6 +60,12 @@ To include a map a web page you will need 3 things:
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.
**Optional:** If the application is intended to run on old platforms like Internet Explorer or Android 4.x, another script needs to be included before OpenLayers:
With this JavaScript code, a map object is created with a MapQuest Open Aerial layer zoomed on the African East coast. Let's break this down:
With this JavaScript code, a map object is created with an OSM layer zoomed on the African East coast. Let's break this down:
The following line creates an OpenLayers `Map` object. Just by itself, this does nothing since there's no layers or interaction attached to it.
@@ -114,20 +120,20 @@ The `layers: [ ... ]` array is used to define the list of layers available in th
```js
layers: [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
source: new ol.source.OSM()
})
]
```
Layers in OpenLayers 3 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)
The next part of the `Map` object is the `View`. The view allow 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.
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.
You will notice that the `center` specified is in lat/lon coordinates (EPSG:4326). Since the only layer we use is in Spherical Mercator projection (EPSG:3857), we can reproject them on the fly to be able to zoom the map on the right coordinates.
You will notice that the `center` specified is in lon/lat coordinates (EPSG:4326). Since the only layer we use is in Spherical Mercator projection (EPSG:3857), we can reproject them on the fly to be able to zoom the map on the right coordinates.
OpenLayers 3 is a big library providing a lot of functionality. So it is unlikely that an application will need and use all the functionality OpenLayers 3 provides. This is why creating application-specific OpenLayers 3 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 3. See the [Compiling Application with Closure Compiler](closure.html) tutorial for more information.
This particular tutorial explains how to create custom builds of OpenLayers 3.
## Requirements
OpenLayers 3'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/ol3/blob/master/DEVELOPING.md) for minimum version numbers required.
## Download OpenLayers
Obviously, creating a custom build requires the OpenLayers 3 source and specific build scripts.
To get the OpenLayers 3 source and the build scripts you can clone the `ol3` [repository](https://github.com/openlayers/ol3), 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 3 distribution using NPM:
$ npm install openlayers
This will download the latest stable version of OpenLayers 3, 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 3 uses for Closure.
You should now have everything you need to create custom builds of OpenLayers 3!
## 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"
],
"define":[
"goog.DEBUG=false"
],
"extra_annotation_name":[
"api","observable"
],
"compilation_level":"ADVANCED",
"manage_closure_dependencies":true
}
}
```
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 3's [`simple`](http://openlayers.org/en/master/examples/simple.html) example.
You are now ready to create your first OpenLayers 3 build. Use the following command to create the build:
The build command may take some time, but it should end with the following output in the console:
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 `define` config property above sets four `goog` properties for the Closure library. The OpenLayers 3 code also has defined values you can set.
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 all three renderers and all layer types are included by default. We only need one renderer, and only need the tile layer, so can exclude the others by setting these properties with `define`s. So add the following to the define section of the config above:
```
"ol.ENABLE_DOM=false",
"ol.ENABLE_WEBGL=false",
"ol.ENABLE_PROJ4JS=false",
"ol.ENABLE_IMAGE=false",
"ol.ENABLE_VECTOR=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 3 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 3 API. For examples `olx.js` includes extern definitions for OpenLayers 3's constructor options. You should always use these two 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` 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`](http://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.VectorEvent#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/olx.js",
"externs/oli.js"
],
"define":[
"ol.ENABLE_DOM=false",
"ol.ENABLE_WEBGL=false",
"ol.ENABLE_PROJ4JS=false",
"ol.ENABLE_IMAGE=false",
"goog.DEBUG=false"
],
"compilation_level":"ADVANCED",
"manage_closure_dependencies":true
}
}
```
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.VectorEvent` 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.
As this example uses a vector layer it is necessary to remove `"ol.ENABLE_VECTOR=false"` in the `define` section of the configuration.
## 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/ol3/tree/master/tasks/readme.md) for more information on the build scripts and the properties you can use in the build configuration file.
We'll be putting together a more comprehensive set of tutorials here. For now, you can take a look at the [introduction](introduction.html) and [basic concepts](concepts.html) tutorial. Stay tuned for more!
* [Introduction to OpenLayers 3](introduction.html)
* [Basic Concepts](concepts.html)
* [Create Custom Builds](custom-builds.html)
* [Bundle Application and OpenLayers using Browserify](browserify.html)
* [Compile Application and OpenLayers together](closure.html)
@@ -24,7 +24,9 @@ Although Closure library functions are widely used within OL3, none of them are
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 three renderers: Canvas, DOM, and WebGL. All three support raster data from tile/image servers, but only the Canvas renderer currently supports vector data. This means that only those browsers that [support Canvas](http://caniuse.com/canvas) can handle vector data. In particular, this excludes Internet Explorer versions before 9, though there is some support for those in the DOM renderer. Clearly, the WebGL renderer can only be used on those devices and browsers supporting WebGL.
The library currently includes three renderers: Canvas, DOM, and WebGL. All three support both raster data from tile/image servers, and vector data; WebGL however only supports Point vectors and 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.
@@ -39,6 +41,4 @@ Class namespaces, such as `ol.layer` have a base class type with the same name,
Source files are similarly organised, with a directory for each class namespace. Names are however all lower-case, and the subclasses repeat the superclass type in their name, for example, `ol/layer/vectorlayer.js`.
The naming structure means that there are sometimes 2 objects with the same name but different initial, such as `ol.feature`, a simple object with static functions to be used with features, and `ol.Feature`, a class used to instantiate new features. These two objects are however stored in the same file, in this case, `ol/feature.js`
OL3 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.
OpenLayers 3 has an ability to display raster data from WMS, WMTS, static images and many other sources in a different coordinate system than delivered from the server.
Transformation of the map projections of the image happens directly in a web browser.
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](http://epsg.io) code) on `ol.View`:
``` javascript
var map = new ol.Map({
target: 'map',
view: new ol.View({
projection: 'EPSG:3857', //HERE IS THE VIEW PROJECTION
center: [0, 0],
zoom: 2
}),
layers: [
new ol.layer.Tile({
source: new ol.source.TileWMS({
projection: 'EPSG:4326', //HERE IS THE DATA SOURCE PROJECTION
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.
Following example shows definition of a [British National Grid](http://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`:
``` javascript
map.setView(new ol.View({
projection: 'EPSG:27700',
center: [400000, 650000],
zoom: 4
}));
```
## 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 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)`.
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 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" />
This way we can support a wide range of projections from proj4js (or even custom transformation functions) on almost any hardware (with canvas 2d support) with a relatively small number of actual transformation calculations.
The precision of the reprojection is then limited by the number of triangles.
The reprojection process preserves transparency on the raster data supplied from the source (png or gif) and the gaps and no-data pixels generated by reprojection are automatically transparent.
###Dynamic triangulation
The above image above shows a noticeable error (especially on the edges) when the original image (left; EPSG:27700) is transformed with only a limited number of triangles (right; EPSG:3857).
The error can be minimized by increasing the number of triangles used.
Since some transformations require a more detail triangulation network, the dynamic triangulation process automatically measures reprojection error and iteratively subdivides to meet a specific error threshold:
For debugging, rendering of the reprojection edges can be enabled by `ol.source.TileImage#setRenderReprojectionEdges(true)`.
# 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).
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
The reprojection algorithm uses inverse transformation (from *view projection* to *data projection*).
For certain coordinate systems this can result in a "double occurrence" of the source data on a map.
For example, when reprojecting a map of Switzerland from EPSG:21781 to EPSG:3857, it is displayed twice: once at the proper place in Europe, but also in the Pacific Ocean near New Zealand, on the opposite side of the globe.
<img src="raster-reprojection-resources/double-occurrence.jpg" alt="Double occurrence of a reprojected map" width="600" />
Although this is mathematically correct behavior of the inverse transformation, visibility of the layer on multiple places is not expected by users.
A possible general solution would be to calculate the forward transformation for every vertex as well - but this would significantly decrease performance (especially for computationally expensive transformations).
Therefore a recommended workaround is to define a proper visibility extent on the `ol.layer.Tile` in the view projection.
Setting such a limit is demonstrated in the [reprojection demo example](http://openlayers.org/en/master/examples/reprojection.html).
### 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.
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).
This page's `map` element has its `tabindex` attribute set to `"0"`, that makes it focusable. To focus the map element you can either navigate to it using the "tab" key or use the skip link. When the `map` element is focused the + and - keys can be used to zoom in and out and the arrow keys can be used to pan.
Clicking on the "Zoom in" and "Zoom out" buttons below the map zooms the map in and out. You can navigate to the buttons using the "tab" key, and press the "enter" key to trigger the zooming action.
<divclass="row-fluid">
<divclass="span12">
<aclass="skiplink"href="#map">Go to map</a>
<divid="map"class="map"tabindex="0"></div>
</div>
</div>
<divclass="row-fluid">
<divclass="span12">
<h4id="title">Accessibility example</h4>
<pid="shortdesc">Example of an accessible map.</p>
<divid="docs">
<p>This page's <code>map</code> element has its <code>tabindex</code> attribute set to <code>"0"</code>, that makes it focusable. To focus the map element you can either navigate to it using the "tab" key or use the skip link. When the <code>map</code> element is focused the + and - keys can be used to zoom in and out and the arrow keys can be used to pan.</p>
<p>When clicked the "Zoom in" and "Zoom out" buttons below the map zoom the map in and out, respectively. You can navigate to the buttons using the "tab" key, and press the "enter" key to trigger the zooming action.</p>
<p>See the <ahref="accessible.js"target="_blank">accessible.js source</a> to see how this is done.</p>
This example shows how to use an ArcGIS REST MapService as tiles.
This source type supports Map and Image Services. For cached ArcGIS
services, better performance is available by using
<code>ol.source.XYZ</code> instead.
tags: arcgis, tile, tilelayer"
---
<divid="map"class="map"></div>
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.