UNPKG

16.9 kBMarkdownView Raw
1# v3.14.0
2
3## Summary
4
5The v3.14.0 release includes features and fixes from 93 pull requests since the v3.13.1 release. New features and improvements include:
6
7* New `source` option for the `ol.control.FullScreen`, to allow including other elements besides the map in a full screen view (#4679).
8* New `target` property for the Drag&Drop interaction allows using a different drop target than the map viewport (#4876).
9* `ol.style.RegularShape` has a new `rotateWithView` option, for controlling how regular shape symbols are rendered on rotated views (#4698).
10* New `layers` option for `ol.format.WMSGetFeatureInfo` format, to selectively only read features from specific layers (#4700).
11* New `precision` parameter for formatting coordinates with `ol.coordinate.toStringHDMS` (#4787).
12* Smarter tile queue for improved tile loading user experience when more than one tile layer is used (#4794).
13* Improved rendering performance for tile layers by rendering tiles directly to the map canvas (#4597).
14* The `goog.events` event system was replaced with our own lightweight event system. This significally reduces the build size (#4711). Replacement of other `goog.*` components with ES5 features or custom code marks a huge step towards the complete removal of the Closure Library dependency.
15
16## Upgrade notes
17
18#### Internet Explorer 9 support
19
20As of this release, OpenLayers requires a `requestAnimationFrame`/`cancelAnimationFrame` polyfill for IE 9 support. See https://cdn.polyfill.io/v2/docs/features/#requestAnimationFrame.
21
22#### Layer pre-/postcompose event changes
23
24It is the responsibility of the application to undo any canvas transform changes at the end of a layer 'precompose' or 'postcompose' handler. Previously, it was ok to set a null transform. The API now guarantees a device pixel coordinate system on the canvas with its origin in the top left corner of the map. However, applications should not rely on the underlying canvas being the same size as the visible viewport.
25
26Old code:
27```js
28layer.on('precompose', function(e) {
29 // rely on canvas dimensions to move coordinate origin to center
30 e.context.translate(e.context.canvas.width / 2, e.context.canvas.height / 2);
31 e.context.scale(3, 3);
32 // draw an x in the center of the viewport
33 e.context.moveTo(-20, -20);
34 e.context.lineTo(20, 20);
35 e.context.moveTo(-20, 20);
36 e.context.lineTo(20, -20);
37 // rely on the canvas having a null transform
38 e.context.setTransform(1, 0, 0, 1, 0, 0);
39});
40```
41New code:
42```js
43layer.on('precompose', function(e) {
44 // use map size and pixel ratio to move coordinate origin to center
45 var size = map.getSize();
46 var pixelRatio = e.frameState.pixelRatio;
47 e.context.translate(size[0] / 2 * pixelRatio, size[1] / 2 * pixelRatio);
48 e.context.scale(3, 3);
49 // draw an x in the center of the viewport
50 e.context.moveTo(-20, -20);
51 e.context.lineTo(20, 20);
52 e.context.moveTo(-20, 20);
53 e.context.lineTo(20, -20);
54 // undo all transforms
55 e.context.scale(1 / 3, 1 / 3);
56 e.context.translate(-size[0] / 2 * pixelRatio, -size[1] / 2 * pixelRatio);
57});
58```
59
60## Full list of changes
61
62 * [#4896](https://github.com/openlayers/openlayers/pull/4896) - Ignore XML sequence when comparing GML ([@ahocevar](https://github.com/ahocevar))
63 * [#4890](https://github.com/openlayers/openlayers/pull/4890) - ol.format.KML cleanup ([@fredj](https://github.com/fredj))
64 * [#4894](https://github.com/openlayers/openlayers/pull/4894) - Only run raster operations after image sources have loaded. ([@tschaub](https://github.com/tschaub))
65 * [#4892](https://github.com/openlayers/openlayers/pull/4892) - Stricter check for ImageData constructor ([@ahocevar](https://github.com/ahocevar))
66 * [#4891](https://github.com/openlayers/openlayers/pull/4891) - Fix tests so they all pass in IE9 ([@ahocevar](https://github.com/ahocevar))
67 * [#4889](https://github.com/openlayers/openlayers/pull/4889) - Use requestAnimation polyfill for examples and update release notes ([@ahocevar](https://github.com/ahocevar))
68 * [#4887](https://github.com/openlayers/openlayers/pull/4887) - Use less aggressive DOM function overrides ([@ahocevar](https://github.com/ahocevar))
69 * [#4885](https://github.com/openlayers/openlayers/pull/4885) - Mark overlayContainer and overlayContainerStopEvent as non-nullable ([@fredj](https://github.com/fredj))
70 * [#4884](https://github.com/openlayers/openlayers/pull/4884) - Remove use of goog.math.isFiniteNumber() ([@fredj](https://github.com/fredj))
71 * [#4881](https://github.com/openlayers/openlayers/pull/4881) - Update jquery to version 2.2.1 🚀 ([@openlayers](https://github.com/openlayers))
72 * [#4780](https://github.com/openlayers/openlayers/pull/4780) - Adapt the code for the new closure-compiler version ([@fredj](https://github.com/fredj))
73 * [#3453](https://github.com/openlayers/openlayers/pull/3453) - Consider multi in add/remove/toggle select logic ([@bjornharrtell](https://github.com/bjornharrtell))
74 * [#4876](https://github.com/openlayers/openlayers/pull/4876) - Add `target` property to Drag&Drop interaction ([@tsauerwein](https://github.com/tsauerwein))
75 * [#4854](https://github.com/openlayers/openlayers/pull/4854) - Always report skipped feature hits for the original layer ([@ahocevar](https://github.com/ahocevar))
76 * [#4877](https://github.com/openlayers/openlayers/pull/4877) - Update eslint to version 2.2.0 🚀 ([@openlayers](https://github.com/openlayers))
77 * [#4870](https://github.com/openlayers/openlayers/pull/4870) - Reuse dragListenerKeys_ local variable ([@fredj](https://github.com/fredj))
78 * [#4721](https://github.com/openlayers/openlayers/pull/4721) - Fix reprojection of raster sources with gutter ([@klokantech](https://github.com/klokantech))
79 * [#4874](https://github.com/openlayers/openlayers/pull/4874) - Assert we have a feature id ([@bartvde](https://github.com/bartvde))
80 * [#4869](https://github.com/openlayers/openlayers/pull/4869) - Improve precision of ol.reproj.render ([@klokantech](https://github.com/klokantech))
81 * [#4866](https://github.com/openlayers/openlayers/pull/4866) - Use requestAnimationFrame polyfill (for IE9) ([@ahocevar](https://github.com/ahocevar))
82 * [#4863](https://github.com/openlayers/openlayers/pull/4863) - Remove use of goog.dom.createElement ([@fredj](https://github.com/fredj))
83 * [#4864](https://github.com/openlayers/openlayers/pull/4864) - Use querySelectorAll instead of goog.dom.getElementsByClass ([@fredj](https://github.com/fredj))
84 * [#4597](https://github.com/openlayers/openlayers/pull/4597) - Render tiles directly to the map canvas ([@ahocevar](https://github.com/ahocevar))
85 * [#4862](https://github.com/openlayers/openlayers/pull/4862) - Add OSGeo badge ([@ahocevar](https://github.com/ahocevar))
86 * [#4845](https://github.com/openlayers/openlayers/pull/4845) - Fix geolocation error cast ([@gberaudo](https://github.com/gberaudo))
87 * [#4851](https://github.com/openlayers/openlayers/pull/4851) - Don't use goog.isBoolean() ([@marcjansen](https://github.com/marcjansen))
88 * [#4852](https://github.com/openlayers/openlayers/pull/4852) - Don't use goog.isString() ([@marcjansen](https://github.com/marcjansen))
89 * [#4849](https://github.com/openlayers/openlayers/pull/4849) - Fix docs of LogoOptions.prototype.src ([@openlayers](https://github.com/openlayers))
90 * [#4794](https://github.com/openlayers/openlayers/pull/4794) - Make tile loading count no longer depend on source count ([@ahocevar](https://github.com/ahocevar))
91 * [#4843](https://github.com/openlayers/openlayers/pull/4843) - Remove use of goog.dom.getParentElement ([@fredj](https://github.com/fredj))
92 * [#4839](https://github.com/openlayers/openlayers/pull/4839) - Add template type to ol.Collection ([@fredj](https://github.com/fredj))
93 * [#4847](https://github.com/openlayers/openlayers/pull/4847) - Update eslint to version 2.1.0 🚀 ([@openlayers](https://github.com/openlayers))
94 * [#4632](https://github.com/openlayers/openlayers/pull/4632) - Overloading fill color (polygon or text) with CanvasPattern and CanvasGradient ([@bjnsn](https://github.com/bjnsn))
95 * [#4842](https://github.com/openlayers/openlayers/pull/4842) - Remove use of goog.dom.createDom ([@fredj](https://github.com/fredj))
96 * [#4808](https://github.com/openlayers/openlayers/pull/4808) - Type cleanup ([@fredj](https://github.com/fredj))
97 * [#4737](https://github.com/openlayers/openlayers/pull/4737) - Use olx.format.ReadOptions in ol.interaction.DragAndDrop ([@fredj](https://github.com/fredj))
98 * [#4830](https://github.com/openlayers/openlayers/pull/4830) - Make sure window.proj4 is always restored in tests ([@ahocevar](https://github.com/ahocevar))
99 * [#4838](https://github.com/openlayers/openlayers/pull/4838) - Use regular expression instead of String#endsWith() check ([@ahocevar](https://github.com/ahocevar))
100 * [#4837](https://github.com/openlayers/openlayers/pull/4837) - Update metalsmith-layouts to version 1.5.4 🚀 ([@openlayers](https://github.com/openlayers))
101 * [#4836](https://github.com/openlayers/openlayers/pull/4836) - Use lowercase for all user agent checks ([@ahocevar](https://github.com/ahocevar))
102 * [#4833](https://github.com/openlayers/openlayers/pull/4833) - Upgrade linter and config. ([@tschaub](https://github.com/tschaub))
103 * [#4831](https://github.com/openlayers/openlayers/pull/4831) - Add navigation header to examples page ([@jonataswalker](https://github.com/jonataswalker))
104 * [#4824](https://github.com/openlayers/openlayers/pull/4824) - Don't use goog.string.newlines.* ([@marcjansen](https://github.com/marcjansen))
105 * [#4825](https://github.com/openlayers/openlayers/pull/4825) - Don't use goog.string.isEmpty ([@marcjansen](https://github.com/marcjansen))
106 * [#4823](https://github.com/openlayers/openlayers/pull/4823) - Fix type for layers option on ol.interaction.Select ([@ahocevar](https://github.com/ahocevar))
107 * [#4815](https://github.com/openlayers/openlayers/pull/4815) - wrapX false in synthetic examples ([@fredj](https://github.com/fredj))
108 * [#4810](https://github.com/openlayers/openlayers/pull/4810) - Add checks for undefined in controls ([@gberaudo](https://github.com/gberaudo))
109 * [#4787](https://github.com/openlayers/openlayers/pull/4787) - Add precision parameter for HDMS coordinate ([@pfanguin](https://github.com/pfanguin))
110 * [#4811](https://github.com/openlayers/openlayers/pull/4811) - Make ol.style.Style a @struct ([@fredj](https://github.com/fredj))
111 * [#4800](https://github.com/openlayers/openlayers/pull/4800) - Update phantomjs-prebuilt to version 2.1.4 🚀 ([@openlayers](https://github.com/openlayers))
112 * [#4792](https://github.com/openlayers/openlayers/pull/4792) - Use ol.events.listen instead of ol.Observable#on ([@fredj](https://github.com/fredj))
113 * [#4796](https://github.com/openlayers/openlayers/pull/4796) - Remove use of goog.isString() ([@marcjansen](https://github.com/marcjansen))
114 * [#4795](https://github.com/openlayers/openlayers/pull/4795) - Cleanup after goog.array, goog.object and goog.isDef removal ([@ahocevar](https://github.com/ahocevar))
115 * [#4791](https://github.com/openlayers/openlayers/pull/4791) - Remove unnecessary cast ([@fredj](https://github.com/fredj))
116 * [#4778](https://github.com/openlayers/openlayers/pull/4778) - Remove use of goog.object. ([@tschaub](https://github.com/tschaub))
117 * [#4789](https://github.com/openlayers/openlayers/pull/4789) - Use ol.array instead of goog.array ([@fredj](https://github.com/fredj))
118 * [#4788](https://github.com/openlayers/openlayers/pull/4788) - Remove unnecessary newlines ([@fredj](https://github.com/fredj))
119 * [#4731](https://github.com/openlayers/openlayers/pull/4731) - Remove all remaining unnecessary casts ([@gberaudo](https://github.com/gberaudo))
120 * [#4776](https://github.com/openlayers/openlayers/pull/4776) - Correct assertion message in ol.array.binarySearch-test ([@marcjansen](https://github.com/marcjansen))
121 * [#4711](https://github.com/openlayers/openlayers/pull/4711) - Removal of goog.events.* ([@ahocevar](https://github.com/ahocevar))
122 * [#4777](https://github.com/openlayers/openlayers/pull/4777) - Fix source.UrlTile URL expansion ([@gberaudo](https://github.com/gberaudo))
123 * [#4730](https://github.com/openlayers/openlayers/pull/4730) - Document ol.Geolocation error event ([@fredj](https://github.com/fredj))
124 * [#4772](https://github.com/openlayers/openlayers/pull/4772) - Use node.setAttribute to set namespaceURI of a node ([@adube](https://github.com/adube))
125 * [#4774](https://github.com/openlayers/openlayers/pull/4774) - Update graceful-fs to version 4.1.3 🚀 ([@openlayers](https://github.com/openlayers))
126 * [#4680](https://github.com/openlayers/openlayers/pull/4680) - Remove goog array. ([@nicholas-l](https://github.com/nicholas-l))
127 * [#4771](https://github.com/openlayers/openlayers/pull/4771) - Use innerHTML instead of innerText to populate the status element ([@fredj](https://github.com/fredj))
128 * [#4769](https://github.com/openlayers/openlayers/pull/4769) - Add opaque option to olx.source.OSMOptions ([@fredj](https://github.com/fredj))
129 * [#4736](https://github.com/openlayers/openlayers/pull/4736) - Properly detect feature on unmanaged layer for toggle selection ([@ahocevar](https://github.com/ahocevar))
130 * [#4756](https://github.com/openlayers/openlayers/pull/4756) - Remove VectorTile getSource re-definition of return value ([@adube](https://github.com/adube))
131 * [#4733](https://github.com/openlayers/openlayers/pull/4733) - Avoid rendering too big and too small images for vector tiles ([@ahocevar](https://github.com/ahocevar))
132 * [#4754](https://github.com/openlayers/openlayers/pull/4754) - Upgrade to mocha@2.4.5. ([@tschaub](https://github.com/tschaub))
133 * [#4750](https://github.com/openlayers/openlayers/pull/4750) - Update metalsmith-layouts to version 1.4.4 🚀 ([@openlayers](https://github.com/openlayers))
134 * [#4751](https://github.com/openlayers/openlayers/pull/4751) - Update phantomjs to version 2.1.3 🚀 ([@openlayers](https://github.com/openlayers))
135 * [#4741](https://github.com/openlayers/openlayers/pull/4741) - Report on installed versions in Travis. ([@openlayers](https://github.com/openlayers))
136 * [#4742](https://github.com/openlayers/openlayers/pull/4742) - Upgrade to eslint@2.0.0-beta.2. ([@tschaub](https://github.com/tschaub))
137 * [#4746](https://github.com/openlayers/openlayers/pull/4746) - Downgrade to mocha@2.3.4. ([@tschaub](https://github.com/tschaub))
138 * [#4740](https://github.com/openlayers/openlayers/pull/4740) - Update fs-extra to version 0.26.5 🚀 ([@openlayers](https://github.com/openlayers))
139 * [#4738](https://github.com/openlayers/openlayers/pull/4738) - Add unit tests for ol.control.Rotate and ol.control.Zoom ([@fredj](https://github.com/fredj))
140 * [#4718](https://github.com/openlayers/openlayers/pull/4718) - Improve raster reprojection behavior when tiles fail to load ([@klokantech](https://github.com/klokantech))
141 * [#4734](https://github.com/openlayers/openlayers/pull/4734) - Update sinon to version 1.17.3 🚀 ([@openlayers](https://github.com/openlayers))
142 * [#4726](https://github.com/openlayers/openlayers/pull/4726) - Update mocha to version 2.4.2 🚀 ([@openlayers](https://github.com/openlayers))
143 * [#4725](https://github.com/openlayers/openlayers/pull/4725) - Untangle vector tile feature reprojection ([@ahocevar](https://github.com/ahocevar))
144 * [#4735](https://github.com/openlayers/openlayers/pull/4735) - Add default value for defaultDataProjection ([@fredj](https://github.com/fredj))
145 * [#4732](https://github.com/openlayers/openlayers/pull/4732) - Fix '@see' link in src/ol/deviceorientation.js ([@fredj](https://github.com/fredj))
146 * [#4720](https://github.com/openlayers/openlayers/pull/4720) - Improve tileLoadFunction docs ([@ahocevar](https://github.com/ahocevar))
147 * [#4717](https://github.com/openlayers/openlayers/pull/4717) - Update phantomjs to version 2.1.2 🚀 ([@openlayers](https://github.com/openlayers))
148 * [#4679](https://github.com/openlayers/openlayers/pull/4679) - Add a source option for the full screen control ([@gaf-ag](https://github.com/gaf-ag))
149 * [#4712](https://github.com/openlayers/openlayers/pull/4712) - Add missing JSDoc tags ([@fredj](https://github.com/fredj))
150 * [#4700](https://github.com/openlayers/openlayers/pull/4700) - Add 'layers' option for WMSGetFeatureInfo format ([@adube](https://github.com/adube))
151 * [#4705](https://github.com/openlayers/openlayers/pull/4705) - Remove remaining unnecessary ol.source.State casts ([@gberaudo](https://github.com/gberaudo))
152 * [#4703](https://github.com/openlayers/openlayers/pull/4703) - Source options fixes. ([@gberaudo](https://github.com/gberaudo))
153 * [#4698](https://github.com/openlayers/openlayers/pull/4698) - Add rotateWithView option to ol.style.RegularShape ([@fredj](https://github.com/fredj))
154 * [#4697](https://github.com/openlayers/openlayers/pull/4697) - Bind tileUrlFunction to the source ([@gberaudo](https://github.com/gberaudo))