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.
This task publishes an existing tag to the npm registry. To publish a new release, create a commit that updates the version number in package.json (e.g. to "3.1.0"). Then create a tag, push to GitHub, and run the publish task. Assuming "openlayers" is the remote for the canonical repo, this would look like the following:
git tag -a v3.1.0 -m "3.1.0"
git push --tags openlayers
./tasks/publish.sh 3.1.0
The task creates a build for each of the `PROFILES` in `publish.sh` (these correspond to `.json` files in the `config` directory). Builds are generated in the `dist` directory. Our `package.json` specifies `dist/ol.js` as the "main" build. So when people use a module loader to `require('openlayers')`, they get the full build. It is also possible to load a debug build (e.g. `require('openlayers/dist/ol-debug')`), and we can publish additional builds by adding `config` files and updating `PROFILES` in `publish.sh`.
The `.npmignore` file determines what is *not* included in the package (note that `node_modules` are always ignored). So if additional items are added to `.gitignore` that should not be included in the npm package, they need to go in `.npmignore` as well (ideally, we don't need to generate anything else outside of the `build` directory that doesn't belong in the package).
When concatenating the Closure Library, base.js creates a new `goog` object if there is not already one in scope. Later, `goog.global` is assigned the value of `this`. Calls to `goog.provide` create "namespace" objects by assigning to `goog.global`. To ensure that `goog` is the same as `goog.global.goog`, we need to create a new `goog` object in the scope of base.js and assign it to `this.goog`.
ol.Map#getTarget returns an element or a string, depending on what was passed to setTarget. This commit adds a getTargetElement method that always returns an Element.
With this change, application developers are able to define styles that
render a different geometry than the feature geometry. This can e.g. be
used to render an interior point of a polygon instead of the polygon, or
to render symbols like arrows along lines.
When configuring a Select interaction with a custom condition that
includes mousemove, panning the map will not work any more. This is
because the return value of handleMapBrowserEvent is determined by
checking for a default condition function. By checking for the
underlying event type instead, we gain flexibility with custom condition
functions.
Constructing an instance of `ol.interaction.DragPan` with no options should be possible, the reference to `opt_options` makes this throw an error when no options are passed.
A typo in 65b8e0f915 introduced this bug.
Before that, 18 zoom levels were used. Now we're using 19, which appears
to be available with full world coverage.
I am using tilegrid to request elevation data tiles side by side of a raster layer. It would be nice if these two method was public avaible such I could use the tilegrid to convert mouse coordinates to tile coordinates to request backend tiles.
The elevation tiles are not shown as a layer directly but rather used to compute and show information in relationship to mouse curser or map view.
This would save me the time of adding another tilegrid implementation in my application specific context.
This makes ol.tilegrid.TileGrid#createTileCoordTransform return the identity function. This makes it possible to use ol.source.TileVector with an ol.tilegrid.TileGrid (as opposed to an ol.tilegrid.XYZ).
Bootstrap sets both the max-width and max-height of all image elements to 100%. When attributions are removed from their containing element, this causes logos to shrink.
CommonJS style modules will either assign `exports` to `module` or will assign properties to `exports`. This allows us to work with either style:
module.exports = Foo;
or
exports.Foo = Foo;
Support for additional properties that are assigned to `exports` (or non-function values assigned to `module.exports`) will likely take additional typedef work in the wrapper.
The constructor for ol.source.TileImage accepts an option for the tileClass,
but ol.source.WMTS does not pass this to the parent. This pull request adds
that in.
Should avoid Travis to pass even though there are errors.
Waiting for the check-examples to finish to get all the errors.
It may also be necessary in order to free system resources like file
descriptors.
I've contacted the maintainer of the https://www.npmjs.org/package/openlayers package to see if we can take over ownership. Until then, we can publish packages under the name 'ol'.
Instead of incrementing and then doubling, calculate the child tile range by doubling and then incrementing.
With this change, tile coord [0, 0, 0] has the four following children:
[1, 0, 0] [1, 1, 0]
[1, 0, 1] [1, 1, 1]
Without this change, tile coord [0, 0, 0] had the nine following children:
[1, 0, 0] [1, 1, 0] [1, 2, 0]
[1, 0, 1] [1, 1, 1] [1, 2, 1]
[1, 0, 2] [1, 1, 2] [1, 2, 2]
With this change map.setView(null) is permitted, but map.setView(undefined) is not. map.getView now always returns a defined value, which may be null is setView was called with null.
Depending on compilation flags, applying a transform used to either:
- work;
- fail throwing an abstract method not implemented message;
- fail silently.
Now it should consistently work, like the other geometries.
Adding a polygon factory method creating an approximation of a circle on
a plane would be useful for users wanting the circle to be deformed.
It would be similar to the `circular` function which creates an
approximation of a circle on a sphere.
Instead of changing the button opacity in the control, only add/remove
a css class (ol-hidden). This let the developer easily change the
behavior by updating the css.
goog.style.setOpacity handles the IE8 case (but we are doing the same
above in the same function) and Firefox prior to version 3.5 (latest
stable release in April 2011).
See https://developer.mozilla.org/en-US/docs/Web/CSS/opacity
This commit changes the signature of ol.layer.Group#getLayers from {ol.Collection.<ol.layer.Base>|undefined} to {!ol.Collection.<ol.layer.Base>}. In this way the caller is guaranteed that getLayers returns a dereferencable object.
This change adds setters for symbolizer properties. In addition, it
introduces a mutable flag on all styles. By default, this is set to
true. ol.style.createStyleFunction sets it to false for all static
styles.
The new setters assert that the mutable flag is true, so whenever an
application tries to set a symbolizer property on a style that was
assigned to a vector layer or feature overlay, the assertion will fail.
Becasue typedefs sometimes use namespaces that are actually
constructors, we need to process typedefs after symbols to avoid
duplicate entries for such namespace types.
When ol.Overlay has set positioning is set to right or bottom, no offset is applied. I added the missing calculations.
I made 2 fiddles showing the bahaviour before and after.
The divs in hte fiddles are named after their positioning (anchor point)! Not the actual position!
Before: http://jsfiddle.net/simon_seyock/ob7ggtx6/
As you can see, on div named "bottom-right" no offset at all is applied. On "bottom-center" it is only applied horizontally and on "center-right" only vertically.
After: http://jsfiddle.net/simon_seyock/sL2f3nL9/2/
All offsets are applied correctly, you could draw a straight line through the anchor points of every div.
This change adds all information that is needed to generate the externs
file to build/info.json, so tasks/generate-externs.js no longer needs
to spawn JSDoc.
This reworks the changes in #2442 so we always include the version info, regardless of whether the module is run as main or not. This also addresses a few lint related issues.
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.
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:
* 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.
[OpenLayers 3](http://openlayers.org/) is a high-performance, feature-packed library for creating interactive maps on the web.
Check out the [hosted examples](http://ol3js.org/en/master/examples/), the [workshop](http://ol3js.org/ol3-workshop/) or poke around the evolving [API docs](http://ol3js.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`
## Documentation
Check out the [hosted examples](http://openlayers.org/en/master/examples/), the [workshop](http://openlayers.org/workshop/) or [API docs](http://openlayers.org/en/master/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`
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 3.1.0 release includes a whopping 214 merged pull requests since 3.0.0. Of note, the WebGL renderer [now supports point rendering](https://github.com/openlayers/ol3/pull/2967). You can use [UTFGrids for interaction](https://github.com/openlayers/ol3/pull/3015)! Styles can now specify [alternate geometries for rendering](https://github.com/openlayers/ol3/pull/3010). Library builds [can now be loaded](https://github.com/openlayers/ol3/pull/3039) with module loaders like Browserify or RequireJS. You can now symbolize point features with stars, squares, enneadecagons, or [any other regular(ish) polygon](https://github.com/openlayers/ol3/pull/2706). See the full list of [changes](#changes) below.
## Upgrade notes
The 3.1.0 release maintains a backwards-compatible API with the 3.0.0 release, so upgrades should be painless. Some special considerations below.
* If you are using a `ol.source.ImageStatic`, you no longer need to provide an `imageSize` option if you don't want any special scaling on your image (see [#2796](https://github.com/openlayers/ol3/pull/2796)).
* Instead of calling `obj.unByKey(key)` you can now call `ol.Observable.unByKey(key)` (see [#2794](https://github.com/openlayers/ol3/pull/2794)).
* If you were using `format.writeFeatures(features)`, note that this method returns a string for all feature formats. We considered the previous behavior a bug (see [#3003](https://github.com/openlayers/ol3/pull/3003)).
* The `obj.dispatchChangeEvent()` method is now spelled `obj.changed()`. This method is still unstable (see [#2684](https://github.com/openlayers/ol3/pull/2684)).
## Changes
* [#3076](https://github.com/openlayers/ol3/pull/3076) - Add script to standardize changelog creation. ([@tschaub](https://github.com/tschaub))
* [#3074](https://github.com/openlayers/ol3/pull/3074) - Remove misplaced function annotation. ([@fredj](https://github.com/fredj))
* [#3071](https://github.com/openlayers/ol3/pull/3071) - Add task for publishing to npm. ([@tschaub](https://github.com/tschaub))
* [#3070](https://github.com/openlayers/ol3/pull/3070) - Define goog and assign to global when generating UMD debug builds. ([@tschaub](https://github.com/tschaub))
* [#3044](https://github.com/openlayers/ol3/pull/3044) - Mark Image style constructor properties `@api` ([@gberaudo](https://github.com/gberaudo))
* [#3052](https://github.com/openlayers/ol3/pull/3052) - Add a testcase for parsing GML feature with only boundedBy ([@bartvde](https://github.com/bartvde))
* [#3051](https://github.com/openlayers/ol3/pull/3051) - Remove // NOCOMPILE from vector-wfs ([@elemoine](https://github.com/elemoine))
* [#2699](https://github.com/openlayers/ol3/pull/2699) - No need for featureNS and featureType to be quoted ([@bartvde](https://github.com/bartvde))
* [#2996](https://github.com/openlayers/ol3/pull/2996) - Add getter functions for points and angle in ol.style.RegularShape ([@bartvde](https://github.com/bartvde))
* [#3046](https://github.com/openlayers/ol3/pull/3046) - Need exportable constructor for constructor options in olx ([@ahocevar](https://github.com/ahocevar))
* [#3043](https://github.com/openlayers/ol3/pull/3043) - Use // NOCOMPILE for vector-wfs ([@elemoine](https://github.com/elemoine))
* [#3042](https://github.com/openlayers/ol3/pull/3042) - Print example name in check-examples exception ([@gberaudo](https://github.com/gberaudo))
* [#3032](https://github.com/openlayers/ol3/pull/3032) - Extension points for custom controls and interactions ([@elemoine](https://github.com/elemoine))
* [#3017](https://github.com/openlayers/ol3/pull/3017) - Use writeFeatures instead of writeFeaturesNode in GPX and KML example (r=@elemoine) ([@bartvde](https://github.com/bartvde))
* [#3014](https://github.com/openlayers/ol3/pull/3014) - Simplify hit detection code ([@elemoine](https://github.com/elemoine))
* [#3003](https://github.com/openlayers/ol3/pull/3003) - The writeFeatures method should always return a string (r=@elemoine) ([@bartvde](https://github.com/bartvde))
* [#3011](https://github.com/openlayers/ol3/pull/3011) - opt_options may not be defined, use options ([@pagameba](https://github.com/pagameba))
* [#3009](https://github.com/openlayers/ol3/pull/3009) - Fix hit detection bug ([@elemoine](https://github.com/elemoine))
* [#3002](https://github.com/openlayers/ol3/pull/3002) - Passing options to RegularShape is mandatory ([@elemoine](https://github.com/elemoine))
* [#2967](https://github.com/openlayers/ol3/pull/2967) - Add support for drawing points with WebGL ([@camptocamp](https://github.com/camptocamp))
* [#2701](https://github.com/openlayers/ol3/pull/2701) - Writing GeoJSON does not respect the feature's geometryName ([@bartvde](https://github.com/bartvde))
* [#3000](https://github.com/openlayers/ol3/pull/3000) - Explain that return of ol.color.asArray should not be modified ([@bartvde](https://github.com/bartvde))
* [#2997](https://github.com/openlayers/ol3/pull/2997) - Use new demo GeoServer location ([@ahocevar](https://github.com/ahocevar))
* [#2976](https://github.com/openlayers/ol3/pull/2976) - Add an example to show off ol.style.RegularShape ([@bartvde](https://github.com/bartvde))
* [#2992](https://github.com/openlayers/ol3/pull/2992) - Add support for finding features at a given coordinates for vector tiles - fixes ([@pgiraud](https://github.com/pgiraud))
* [#2987](https://github.com/openlayers/ol3/pull/2987) - Image layer renderers use source projection if given and equivalent ([@kartverket](https://github.com/kartverket))
* [#2975](https://github.com/openlayers/ol3/pull/2975) - Use offsetX and offsetY if available ([@fredj](https://github.com/fredj))
* [#2973](https://github.com/openlayers/ol3/pull/2973) - Making GetTileCoordFor methods public avaible ([@s093294](https://github.com/s093294))
* [#2986](https://github.com/openlayers/ol3/pull/2986) - Add support for finding features at a given coordinates for vector tiles ([@pgiraud](https://github.com/pgiraud))
* [#2937](https://github.com/openlayers/ol3/pull/2937) - Clip layer rendering to limited extent. ([@tschaub](https://github.com/tschaub))
* [#2971](https://github.com/openlayers/ol3/pull/2971) - Two ol.source.TileVector fixes ([@elemoine](https://github.com/elemoine))
* [#2981](https://github.com/openlayers/ol3/pull/2981) - Use lineDash in ol.style.Circle's and ol.style.RegularShape's stroke (r=@fredj,@elemoine) ([@bartvde](https://github.com/bartvde))
* [#2982](https://github.com/openlayers/ol3/pull/2982) - Allow radius1 as an alias for radius in ol.style.RegularShape ([@bartvde](https://github.com/bartvde))
* [#2980](https://github.com/openlayers/ol3/pull/2980) - Export ol.source.TileVector#getFeatures in built mode ([@pgiraud](https://github.com/pgiraud))
* [#2979](https://github.com/openlayers/ol3/pull/2979) - Support OGC srs urns without an EPSG database version ([@bartvde](https://github.com/bartvde))
* [#2978](https://github.com/openlayers/ol3/pull/2978) - Fix zoom levels for the MapQuest Street layer ([@ahocevar](https://github.com/ahocevar))
* [#2889](https://github.com/openlayers/ol3/pull/2889) - Add GetFeatureInfo format ([@fgravin](https://github.com/fgravin))
* [#2965](https://github.com/openlayers/ol3/pull/2965) - Fix pan with select interaction in mousemove mode. ([@tonio](https://github.com/tonio))
* [#2960](https://github.com/openlayers/ol3/pull/2960) - LayerGroup extent should be used if extent not set on child layer ([@bartvde](https://github.com/bartvde))
* [#2956](https://github.com/openlayers/ol3/pull/2956) - Revert "Remove mousewheel event name workaround" ([@fredj](https://github.com/fredj))
* [#2959](https://github.com/openlayers/ol3/pull/2959) - Fix typo in selector ([@ahocevar](https://github.com/ahocevar))
* [#2895](https://github.com/openlayers/ol3/pull/2895) - Move font-family customization to layout.css ([@fredj](https://github.com/fredj))
* [#2931](https://github.com/openlayers/ol3/pull/2931) - Improvement to view docs ([@elemoine](https://github.com/elemoine))
* [#2906](https://github.com/openlayers/ol3/pull/2906) - Assume a latitude, longitude order for Polyline format ([@fredj](https://github.com/fredj))
* [#2927](https://github.com/openlayers/ol3/pull/2927) - Make it possible to programmatically finish drawing ([@elemoine](https://github.com/elemoine))
* [#2928](https://github.com/openlayers/ol3/pull/2928) - Do not rename handleMapBrowserEvent internally ([@elemoine](https://github.com/elemoine))
* [#2924](https://github.com/openlayers/ol3/pull/2924) - Readability rearangement in canvasmaprenderer.js ([@gberaudo](https://github.com/gberaudo))
* [#2911](https://github.com/openlayers/ol3/pull/2911) - List events fired in the navigation. ([@tschaub](https://github.com/tschaub))
* [#2921](https://github.com/openlayers/ol3/pull/2921) - Small feature overlay optimization ([@gberaudo](https://github.com/gberaudo))
* [#2897](https://github.com/openlayers/ol3/pull/2897) - Remove pointerup listener on controls ([@fredj](https://github.com/fredj))
* [#2888](https://github.com/openlayers/ol3/pull/2888) - Element boundedBy must not be set as geometry field on GML reading ([@fgravin](https://github.com/fgravin))
* [#2903](https://github.com/openlayers/ol3/pull/2903) - Improved docs for icon options ([@elemoine](https://github.com/elemoine))
* [#2900](https://github.com/openlayers/ol3/pull/2900) - Allow build.js task to add header. ([@tschaub](https://github.com/tschaub))
* [#2893](https://github.com/openlayers/ol3/pull/2893) - Don't pass an object to goog.dom.createDom for the class name ([@fredj](https://github.com/fredj))
* [#2781](https://github.com/openlayers/ol3/pull/2781) - Use a standard title attribute for the control buttons ([@fredj](https://github.com/fredj))
* [#2852](https://github.com/openlayers/ol3/pull/2852) - Add missing space between class names ([@fredj](https://github.com/fredj))
* [#2891](https://github.com/openlayers/ol3/pull/2891) - Introduce a load function for image sources ([@ahocevar](https://github.com/ahocevar))
* [#2885](https://github.com/openlayers/ol3/pull/2885) - Add wrapX option to TileJSON source ([@elemoine](https://github.com/elemoine))
* [#2890](https://github.com/openlayers/ol3/pull/2890) - Use correct layer property names ([@elemoine](https://github.com/elemoine))
* [#2887](https://github.com/openlayers/ol3/pull/2887) - Explicitly pass coordinate dimension before transforming. ([@tschaub](https://github.com/tschaub))
* [#2886](https://github.com/openlayers/ol3/pull/2886) - Use ternary notation ([@elemoine](https://github.com/elemoine))
* [#2869](https://github.com/openlayers/ol3/pull/2869) - Export useful xml functions ([@tonio](https://github.com/tonio))
* [#2884](https://github.com/openlayers/ol3/pull/2884) - Make WKT methods throw errors instead of calling a method that throws. ([@tschaub](https://github.com/tschaub))
* [#2746](https://github.com/openlayers/ol3/pull/2746) - Add versioning for GML format ([@fgravin](https://github.com/fgravin))
* [#2882](https://github.com/openlayers/ol3/pull/2882) - Allow olx.source.WMTSOptions#requestEncoding to be a string ([@fredj](https://github.com/fredj))
* [#2881](https://github.com/openlayers/ol3/pull/2881) - Add default requestEncoding in documentation ([@fredj](https://github.com/fredj))
* [#2877](https://github.com/openlayers/ol3/pull/2877) - Remove FIXME in src/ol/structs/rbush.js ([@fredj](https://github.com/fredj))
* [#2870](https://github.com/openlayers/ol3/pull/2870) - Use bulk-insertion for addFeatures ([@tsauerwein](https://github.com/tsauerwein))
* [#2856](https://github.com/openlayers/ol3/pull/2856) - Allow layer source to be set. ([@tschaub](https://github.com/tschaub))
* [#2875](https://github.com/openlayers/ol3/pull/2875) - Avoid modifying `map.logos_` with each frame. ([@tschaub](https://github.com/tschaub))
* [#2872](https://github.com/openlayers/ol3/pull/2872) - Remove the beforepropertychange event from ol.Object ([@fredj](https://github.com/fredj))
* [#2868](https://github.com/openlayers/ol3/pull/2868) - Remove doc about dispatching events. ([@tschaub](https://github.com/tschaub))
* [#2871](https://github.com/openlayers/ol3/pull/2871) - Make `npm install` a dependency of node based targets. ([@tschaub](https://github.com/tschaub))
* [#2867](https://github.com/openlayers/ol3/pull/2867) - Support for importing CommonJS style modules (like rbush). ([@openlayers](https://github.com/openlayers))
* [#2865](https://github.com/openlayers/ol3/pull/2865) - Add old value to property change events ([@elemoine](https://github.com/elemoine))
* [#2835](https://github.com/openlayers/ol3/pull/2835) - Use correct Stamen URL for SSL. ([@j16sdiz](https://github.com/j16sdiz))
* [#2839](https://github.com/openlayers/ol3/pull/2839) - Dependency updates and new package name. ([@tschaub](https://github.com/tschaub))
* [#2840](https://github.com/openlayers/ol3/pull/2840) - Fewer point resolution tests. ([@tschaub](https://github.com/tschaub))
* [#2836](https://github.com/openlayers/ol3/pull/2836) - Give priority to feature's style instead of source's style ([@oterral](https://github.com/oterral))
* [#2834](https://github.com/openlayers/ol3/pull/2834) - Use ADVANCED instead of ADVANCED_OPTIMIZATIONS ([@fredj](https://github.com/fredj))
* [#2833](https://github.com/openlayers/ol3/pull/2833) - Avoid too many files open with graceful-fs@3.0.3. ([@tschaub](https://github.com/tschaub))
* [#2815](https://github.com/openlayers/ol3/pull/2815) - Fix jquery.min.js path in xyz-esri-4326-512 example ([@fredj](https://github.com/fredj))
* [#2756](https://github.com/openlayers/ol3/pull/2756) - Add an example for using an Esri 512x512 tile server in EPSG:4326 (r=@elemoine) ([@bartvde](https://github.com/bartvde))
* [#2814](https://github.com/openlayers/ol3/pull/2814) - Add missing whitespaces in CSS calc ([@fredj](https://github.com/fredj))
* [#2811](https://github.com/openlayers/ol3/pull/2811) - Remove defaultProjection and object from typedef ([@fredj](https://github.com/fredj))
* [#2779](https://github.com/openlayers/ol3/pull/2779) - Update jQuery to 1.9.1 ([@fredj](https://github.com/fredj))
* [#2810](https://github.com/openlayers/ol3/pull/2810) - Remove unused properties from olx.source.TileVectorOptions ([@pagameba](https://github.com/pagameba))
* [#2808](https://github.com/openlayers/ol3/pull/2808) - Remove reprojectTo option from olx.source.OSMXMLOptions ([@fredj](https://github.com/fredj))
* [#2805](https://github.com/openlayers/ol3/pull/2805) - Enable subclassing Interaction in public API ([@sweco-sebhar](https://github.com/sweco-sebhar))
* [#2798](https://github.com/openlayers/ol3/pull/2798) - Update closure-util to version 1.0.0 ([@fredj](https://github.com/fredj))
* [#2785](https://github.com/openlayers/ol3/pull/2785) - Use goog.* types in externs ([@ahocevar](https://github.com/ahocevar))
* [#2792](https://github.com/openlayers/ol3/pull/2792) - Use valid mediatype for GPX export. ([@pgiraud](https://github.com/pgiraud))
* [#2784](https://github.com/openlayers/ol3/pull/2784) - Add 'tooltip'-tag to KML example. ([@marcjansen](https://github.com/marcjansen))
* [#2782](https://github.com/openlayers/ol3/pull/2782) - Hide the rotate control when the rotation is 0 ([@fredj](https://github.com/fredj))
* [#2774](https://github.com/openlayers/ol3/pull/2774) - Remove unused distinctFeatures object in ol.interaction.Modify#handlePointerDown ([@fredj](https://github.com/fredj))
* [#2771](https://github.com/openlayers/ol3/pull/2771) - Allow package to be published in npm registry. ([@tschaub](https://github.com/tschaub))
* [#2773](https://github.com/openlayers/ol3/pull/2773) - Type-related changes to ol.style.Image ([@elemoine](https://github.com/elemoine))
* [#2751](https://github.com/openlayers/ol3/pull/2751) - Export constructors and options of ol.source.Source children ([@gberaudo](https://github.com/gberaudo))
* [#2772](https://github.com/openlayers/ol3/pull/2772) - Rename updatefeature event to changefeature ([@fredj](https://github.com/fredj))
* [#2766](https://github.com/openlayers/ol3/pull/2766) - Make interaction "active" an ol.Object property ([@elemoine](https://github.com/elemoine))
* [#2765](https://github.com/openlayers/ol3/pull/2765) - Treat unknown opt types as Object in ol externs ([@elemoine](https://github.com/elemoine))
* [#2759](https://github.com/openlayers/ol3/pull/2759) - Fix test failures. ([@tschaub](https://github.com/tschaub))
* [#2762](https://github.com/openlayers/ol3/pull/2762) - Report test failures to the console. ([@tschaub](https://github.com/tschaub))
* [#2768](https://github.com/openlayers/ol3/pull/2768) - Write the function name correctly in the doc. ([@xamgreen](https://github.com/xamgreen))
* [#2764](https://github.com/openlayers/ol3/pull/2764) - Remove rtree example ([@fredj](https://github.com/fredj))
* [#2763](https://github.com/openlayers/ol3/pull/2763) - Miscellaneous coding style and typo fixes ([@fredj](https://github.com/fredj))
* [#2742](https://github.com/openlayers/ol3/pull/2742) - Dispatch an 'updatefeature' from the vector source ([@fredj](https://github.com/fredj))
* [#2747](https://github.com/openlayers/ol3/pull/2747) - Fix incorrect web address. ([@lazaruslarue](https://github.com/lazaruslarue))
* [#2745](https://github.com/openlayers/ol3/pull/2745) - DragBox Interaction: getGeometry return type can be ol.geom.Polygon (r=@fredj) ([@bartvde](https://github.com/bartvde))
* [#2741](https://github.com/openlayers/ol3/pull/2741) - issue with reading scientific notation coordinates in ol.format.GML (r=@fredj) ([@bartvde](https://github.com/bartvde))
* [#2739](https://github.com/openlayers/ol3/pull/2739) - Revert "Function circular renamed to createCircularOnSphere" ([@elemoine](https://github.com/elemoine))
* [#2616](https://github.com/openlayers/ol3/pull/2616) - Target for attribution links differs between maps ([@fredj](https://github.com/fredj))
* [#2740](https://github.com/openlayers/ol3/pull/2740) - Make interactions activable and deactivable ([@elemoine](https://github.com/elemoine))
* [#2727](https://github.com/openlayers/ol3/pull/2727) - Rename ol.geom.Polygon#circular to createCircularOnSphere ([@elemoine](https://github.com/elemoine))
* [#2730](https://github.com/openlayers/ol3/pull/2730) - Do not call toLowerCase when forming a change:property event ([@elemoine](https://github.com/elemoine))
* [#2728](https://github.com/openlayers/ol3/pull/2728) - Mark `ol.extent.getIntersection` as stable. ([@tschaub](https://github.com/tschaub))
* [#2726](https://github.com/openlayers/ol3/pull/2726) - Make ol.Feature#setStyle accept null ([@elemoine](https://github.com/elemoine))
* [#2724](https://github.com/openlayers/ol3/pull/2724) - Error when compiling individual example ([@fredj](https://github.com/fredj))
* [#1959](https://github.com/openlayers/ol3/pull/1959) - Add a feature box selection example ([@elemoine](https://github.com/elemoine))
* [#2722](https://github.com/openlayers/ol3/pull/2722) - Make ol.Map#setView do not accept undefined ([@elemoine](https://github.com/elemoine))
* [#2696](https://github.com/openlayers/ol3/pull/2696) - Consistent circle transform. ([@gberaudo](https://github.com/gberaudo))
* [#2717](https://github.com/openlayers/ol3/pull/2717) - Change the control visibility by using css class ([@fredj](https://github.com/fredj))
* [#2715](https://github.com/openlayers/ol3/pull/2715) - Add an EPSG:3857 map to Tissot example ([@elemoine](https://github.com/elemoine))
* [#2714](https://github.com/openlayers/ol3/pull/2714) - Set the opacity directly to element.style.opacity ([@fredj](https://github.com/fredj))
* [#2647](https://github.com/openlayers/ol3/pull/2647) - Upgrade closure library version ([@fredj](https://github.com/fredj))
* [#2549](https://github.com/openlayers/ol3/pull/2549) - Use goog.array.ASSUME_NATIVE_FUNCTIONS define ([@fredj](https://github.com/fredj))
* [#2711](https://github.com/openlayers/ol3/pull/2711) - Remove Google Maps example ([@elemoine](https://github.com/elemoine))
* [#2684](https://github.com/openlayers/ol3/pull/2684) - Rename ol.Observable#dispatchChangeEvent() to #changed() ([@ahocevar](https://github.com/ahocevar))
* [#2678](https://github.com/openlayers/ol3/pull/2678) - Mutable symbolizer properties for styles ([@ahocevar](https://github.com/ahocevar))
* [#2568](https://github.com/openlayers/ol3/pull/2568) - re-implement auto-configure code for ol.format.GML (r=@ahocevar) ([@bartvde](https://github.com/bartvde))
* [#2704](https://github.com/openlayers/ol3/pull/2704) - Use pool thread for calling bin/check-example.js. ([@gberaudo](https://github.com/gberaudo))
* [#2698](https://github.com/openlayers/ol3/pull/2698) - StaticVector is not an abstract base class ([@ahocevar](https://github.com/ahocevar))
* [#2702](https://github.com/openlayers/ol3/pull/2702) - Add vector layer in export-map example ([@fredj](https://github.com/fredj))
* [#2687](https://github.com/openlayers/ol3/pull/2687) - Use ol.LEGACY_IE_SUPPORT and ol.IS_LEGACY_IE define ([@fredj](https://github.com/fredj))
* [#2675](https://github.com/openlayers/ol3/pull/2675) - Remove undefined from ol.Map#getLayers return type ([@fredj](https://github.com/fredj))
* [#2692](https://github.com/openlayers/ol3/pull/2692) - Unset z-index in overlay example ([@fredj](https://github.com/fredj))
* [#2681](https://github.com/openlayers/ol3/pull/2681) - Make tileSize a config option for ol.source.XYZ ([@ahocevar](https://github.com/ahocevar))
* [#2534](https://github.com/openlayers/ol3/pull/2534) - Document ol.geom.Polygon#getLinearRing function ([@fredj](https://github.com/fredj))
* [#2677](https://github.com/openlayers/ol3/pull/2677) - Add TextStyle offsets getters to API. ([@gberaudo](https://github.com/gberaudo))
* [#2676](https://github.com/openlayers/ol3/pull/2676) - ol.FeatureOverlay: use the feature style if defined ([@fredj](https://github.com/fredj))
* [#2656](https://github.com/openlayers/ol3/pull/2656) - Set ol.layer.Image#getSource return type to ol.source.Image ([@fredj](https://github.com/fredj))
* [#2651](https://github.com/openlayers/ol3/pull/2651) - ol.layer.Vector.getSource return type specialisation. ([@gberaudo](https://github.com/gberaudo))
* [#2663](https://github.com/openlayers/ol3/pull/2663) - Set tracking property to false on geolocation error ([@fredj](https://github.com/fredj))
* [#2662](https://github.com/openlayers/ol3/pull/2662) - Delegate transformation in ol.source.FormatVector#readFeatures to `ol.format.*` ([@gingerik](https://github.com/gingerik))
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 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 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>
@@ -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 conjunciton 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:
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.